Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Moving /usr partition to a new partition
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
gentoofrm
n00b
n00b


Joined: 05 Mar 2004
Posts: 39

PostPosted: Tue Mar 16, 2004 5:06 am    Post subject: Moving /usr partition to a new partition Reply with quote

I didn't expect my /usr to become bigger than 4GB. So, I had to create a new partition on the same hard drive and move it.
I summarzied a few tips and Q&As in the forum:
Quote:
My old /usr was on hda7.
My new /usr is on hda8.
You need to change the hda numbers of yours accordingly.

Quote:
1] Create a new partition
* File system must be "hard compiled" into the kernel (not as a module)

Quote:
2] Create a mount point & mount the new partition
# mkdir /mnt/new
# nano /etc/fstab
/dev/hda8 /mnt/new ext3 defaults 0 1
# reboot

Quote:
3] Copy the content of /usr into this partition (be careful, the content, not /usr)
# cp -a /usr/* /mnt/new
# mv /usr/* /mnt/new (easier / can skip step 5/ but might be risky for some newbies like me])

Quote:
4] # nano /etc/fstab
Replace /dev/hda8 /mnt/new ext3 defaults 0 1
with /dev/hda8 /usr ext3 defaults 0 1
# reboot

Quote:
5] Clean-up (skip this if you use mv in step 3])
mount / partition (the one that used to contain /usr) in /mnt/new
# mount /dev/hda7 /mnt/new

delete the content of the old /usr
# rm -r /mnt/new/usr/*
# umount /mnt/new

Quote:
* Do not unmount /usr.
When you mount the new partition to /usr,
it will silently switch from your / partition to your new partition
Back to top
View user's profile Send private message
MighMoS
Guru
Guru


Joined: 24 Apr 2003
Posts: 416
Location: @ ~

PostPosted: Wed Mar 17, 2004 2:17 am    Post subject: Reply with quote

Um, rather than cp -a, which will change owner ship of everything, change into your /usr directory, and do
Code:
tar -cf - .|(cd /mnt/newusr&&tar -xpvf -)

_________________
jabber: MighMoS@jabber.org

localhost # export HOME=`which heart`
Back to top
View user's profile Send private message
Frodg
l33t
l33t


Joined: 11 Feb 2004
Posts: 761

PostPosted: Wed Mar 17, 2004 2:26 am    Post subject: Reply with quote

make sure you use "nano -w" or things go horribly wrong
_________________
Aerosolo ergo sum - I spray therefore I am

Gentoo - Registered Linux User # 361400
Back to top
View user's profile Send private message
MighMoS
Guru
Guru


Joined: 24 Apr 2003
Posts: 416
Location: @ ~

PostPosted: Wed Mar 17, 2004 2:27 am    Post subject: Reply with quote

What's the -w flag do? (I've always used vim)
_________________
jabber: MighMoS@jabber.org

localhost # export HOME=`which heart`
Back to top
View user's profile Send private message
Frodg
l33t
l33t


Joined: 11 Feb 2004
Posts: 761

PostPosted: Wed Mar 17, 2004 3:00 am    Post subject: Reply with quote

Code:
-w, --nowrap
Do not wrap long lines at any length. This option overrides any value for -r.


therefore doesn't screw up the coding.....
_________________
Aerosolo ergo sum - I spray therefore I am

Gentoo - Registered Linux User # 361400
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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