View previous topic :: View next topic |
Author |
Message |
nss Guru
Joined: 04 Oct 2004 Posts: 389
|
Posted: Sun Sep 02, 2007 5:13 am Post subject: copy a directory and change fstab |
|
|
Right now, I have a separate partition for /usr/local that is 2GB. I also have a 500MB / partition and no separate partition for /opt. So basically, / has more used space than I planned and so I think I'll mount the /opt directory in place of /usr/local.
I _think_ this will work:
1.) boot with a livecd
2.) backup the contents of /usr/local and /opt by-
Code: | # cp -dpPR /usr/local/ /backup/place/
# cp -dpPR /opt /backup/place/ |
3.) remove /opt and /usr/local
4.) change fstab and remount
5.) put the backups back by-
Code: | # cp -dpPR /backup/place/usr/local/ /usr/
# cp -dpPR /backup/place/opt/ / |
Do I have the correct options? Should this method work? _________________ gentoo good to be true |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Sun Sep 02, 2007 5:35 am Post subject: |
|
|
Should work. Couple tips, though. You don't have to use cp -dpPR; cp -a does the same thing. You don't need to boot the LiveCD either. Just make sure nothing is using anything in either directory, then do:
Code: |
cp -a /usr/local /backup/usrlocal && cp -a /opt /backup/opt && rm -rf /opt/* /usr/local/* && mv /backup/usrlocal/* /opt/ && mv /backup/opt/* /usr/local/ && umount /usr/local /opt
|
Now, edit /etc/fstab and swap the devices, then remount. _________________ Thomas S. Howard |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|