Welcome 微信登录

首页 / 操作系统 / Linux / RedHat 5.8内/home目录移植到新建的存储

RedHat 5.8内/home目录移植到新建的存储:1. Check for available space:vgdisplayfdisk -lIn 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/sdb13. Create a volume groupvgcreate vg_newVolumeName /dev/sdb14. Display attributes of volume group and check the space available "Free PE / Size"vgdisplay vg_newVolumeName5. 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_newVolumeName6. Creating the file system for lv_home mkfs.ext4/3 /dev/mapper/vg_newVolumeName-lv_home7. 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 directorymkdir /tmp/hometmpmount /dev/mapper/vg_newVolumeName-lv_home /tmp/hometmprsync -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 bytes10. 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 1Note: 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 1Remember 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相关信息见RedHat 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=10Linux yum错误解决方法Java学习实践:Eclipse安装步骤相关资讯      RedHat 5.8 
  • RedHat 5.8 安装Oracle 11gR2_Grid  (01/30/2013 08:02:02)
本文评论 查看全部评论 (0)
表情: 姓名: 字数