RedHat 5.8内/home目录移植到新建的存储
来源:互联网 发布:mac地址可以随便改吗 编辑:程序博客网 时间:2024/05/20 23:06
1. Check for available space:
vgdisplay
fdisk -l
In case you don't have space available on the existent volume group, add a new disk or new partition.
2. Initialize the new disk or partition for use by LVM (in this case we are using sdb as an example name)
pvcreate /dev/sdb1
3. Create a volume group
vgcreatevg_newVolumeName /dev/sdb1
4. Display attributes of volume group and check the space available "Free PE / Size"
vgdisplayvg_newVolumeName
5. Create a logical volume in vg_newVolumeName. The following will create the new logical volumes for lv_home (adjust the size accordingly with your needs):
lvcreate -L 5G--name lv_home vg_newVolumeName
6. Creating the file system for lv_home
mkfs.ext4/3 /dev/mapper/vg_newVolumeName-lv_home
7. Note: Now you have the LVM ready, a few more steps to move home.
8. mount new home to /tmp/hometmp and Copy the content of home and to new home directory
mkdir /tmp/hometmp
mount /dev/mapper/vg_newVolumeName-lv_home/tmp/hometmp
rsync -avz /home/ /tmp/hometmp/
9. Check if the temporary directory matches the original directory.
diff /home/ /tmp/hometmp/
ls -la /home/
ls -la /tmp/hometmp/
du -s /home/
du -s /tmp/hometmp/
'du' shows the size in bytes
10. edit /etc/fstab and use new storage as home dirctory On RHEL6:
blkid (this command will show you the UUID for lv_home). Take a note for the output.
Edit the file /etc/fstab adding the lines:
UUID=example-UUID-for-lv_home /home ext4 defaults 1 1
Note: Make sure to inform the UUID accordingly with the blkid output:
On RHEL 5 or older:
/dev/vg_newVolumeName/lv_home /home ext3 defauls 1 1
Remember to double check the paths and also the filesystem type, such as ext3 or ext4, accordingly with your system, the above are examples only.
11. reboot your server and check out whether the new home directory is working properly.
- RedHat 5.8内/home目录移植到新建的存储
- ubuntu 新建用户到指定的目录
- Ubuntu 16.04 /home 目录迁移到独立分区的方法
- Ubuntu 16.04 /home 目录迁移到独立分区的方法
- RedHat 挂载DVD到目录
- Redhat的目录结构
- java在远程linux服务器中切换目录和新建目录,把本地文件上传到新建的目录中
- java在远程linux服务器中切换目录和新建目录,把本地文件上传到新建的目录中
- 移植仙剑游戏到redhat
- Cocos2d-X游戏【泰然网《跑酷》】JS到C++移植2:如何新建一个项目,引擎目录结构介绍
- 迁移Home目录到独立分区
- 迁移/home目录到单独分区
- ubunt重装后复制之前home的文件到新的home目录出现不属于当前用户的问题
- 修改Cygwin的home目录
- ubuntu tips: Move /home to it’s own partition(移动"/home"目录到单独的分区)
- 使用parted将/home目录重新mount到新的硬盘的方法
- 将/home目录重新mount到新的硬盘的方法
- linux挂载windows文件夹到linu的/home/fuli目录下面
- listprefernce
- 略论软件模块的加载策略
- Ext.data.Store
- 单节点rac无法启动
- Android之旅二 资源文件的访问
- RedHat 5.8内/home目录移植到新建的存储
- java 处理properties文件中 占位符
- spring.net错误排查 Error creating context 'spring.root': InputStream is null from Resource
- JavaScript经典教程重磅推荐,值得拥有的书籍。
- java读取命令行参数又一方法
- ADO方式访问数据库,一些注意事项
- 微博为什么这么火,微博如何给企业带来收益。
- Android AsyncTask 的使用
- C++使用VS2010导出Excel的方法及步骤