Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I move /usr & /var to a seperate drive? 2

Status
Not open for further replies.

linuxMaestro

Instructor
Jan 12, 2004
183
US
How can I move /usr & /var to a seperate drive?

/usr and /var a full and I have deleted everything I can, how can I move them to a seperate drive?
/dev/sda5 3028080 2808456 65804 98% /usr
/dev/sda6 3028080 2641632 232628 92% /var
 
Sure, no problem.

1: Make sure the hard drive is added to the system and formated correctly. Look at my faq for adding a second hard drive to a linux system.

2: Copy all of /usr and /var to the new hard drive using cp -a

3: Edit the /etc/fstab to point the new /usr and /var to the new hard drive.

4: Reboot.

That should be it.

>---------------------------------------Lawrence Feldman
SR. QA. Engineer SNAP Appliance
lfeldman@snapappliance.com

 
Thanks!

What would the exact cp -a command be if I'm putting in a secondary master drive? (/dev/hdc1)?

Would this work?
cp -a /usr /dev/hdc1
cp -a /usr /dev/hdc2
 
You will need to make a temporary mount point to copy the files to.

mkdir /mnt/hdc

mount /dev/hdc1 /mnt/hdc

cp -av /usr/ /mnt/hdc

cp -av /var /mnt/hdc


Then umount /mnt/hdc.

then edit the fstab and reboot.


>---------------------------------------Lawrence Feldman
SR. QA. Engineer SNAP Appliance
lfeldman@snapappliance.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top