move usr & var dir to other harddrive
Hola.... Everyone Seems like everybody's busy to write a blog in this site. So, I'm the one who start this Blog and the one who start to write the article in this blog. :)
Last week, I got one problem with my Linux Box (Actually it's RHEL3 x86_64) 64bit Workstation. That Workstation act like a geographic applications and NFS server for past 4 years. Now that one's usr partition showing out of disk space. One thing is if we're using LVM2, that won't be a problem but ever since we're using that workstation we just used normal partition.
So, I'm just added new SCSI drive to that WS and do some changes. Here's the step by step changes that I've made-
- su - #password:
- #mkdir /usr1
- #e2label /dev/sdc1 /usr1 #mount /dev/sdc1 /usr1
- # cd /usr (old partition) # find . -depth -print0 | sudo cpio --null --sparse -pvd /usr1 above line's copy all the files and folder from old usr partition.
- # cd /etc # cp /etc/fstab /tmp
- # vi /etc/fstab #comment out the old /usr (mounting point)#
#LABEL=/usr /usr ext3 defaults 1 2
then save that fstab file and reboot .
- Then boot the system with RHEL3 disc 1, boot into rescue mode. # linux rescue
#system is mount in /mnt/sysimage/ #rm -rf /mnt/sysimage/usr #mv /mnt/sysimage/usr1 /mnt/sysimage/usr
Now /usr partition is under / . So, you can change on line in /etc/fstab
LABEL=/usr1 /usr ext3 defaults 1 2
Save the changes and reboot.
And that's it... you just moved the /usr partition to New Harddisk.




