Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
copy a directory and change fstab
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
nss
Guru
Guru


Joined: 04 Oct 2004
Posts: 389

PostPosted: Sun Sep 02, 2007 5:13 am    Post subject: copy a directory and change fstab Reply with quote

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
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Sun Sep 02, 2007 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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