Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
combining /usr and /usr/local partitions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Sun Apr 11, 2004 2:10 am    Post subject: combining /usr and /usr/local partitions Reply with quote

Working with other distros i found it beneficial to have separate /usr and /usr/local partitions as I ended up compiling and installing many programs from source in /usr/local instead of using packages. With Gentoo this becomes the rare occasion instead of the norm.
As it turns out now, working with Gentoo, my /usr/local partition is under utilized and my /usr partition is too full and in turn it also seems less practical to have now have them separated. So I want to combine the two partitions into one. Both are currently reiserfs filesystems in case that matters.

Current setup:
Code:

/dev/hda2             2.8G  2.8G   57M  99% /usr
/dev/hda3             1.9G   49M  1.9G   3% /usr/local

There are other paritions as well (hda1 through hda10) and I do have access to another drive in order to copy/move but don't want to tie it up permanently.

Basically, with hda2 and hda3 being contiguous primary partitions:
Code:

/dev/hda2              13         377     2931862+  83  Linux
/dev/hda3             378         620     1951897+  83  Linux

Can this process be accomplished by copying /usr and /usr/local to the spare drive, then using fdisk to delete hda2 and hda3, following by creating a larger hda2 using the space of both, making the filesystem, and then moving the data back?

IOW, is using fdisk in this fashion safe, without harm coming to my other partitions?

Will the other paritions remain numbered the same (hda4 is an extended partition) so that the only fstab change would be the removal of hda3 mount?

Also Is "cp -a" all that is necessary for proper data movement for these purposes?

Are there any holes in my plan? Are their better or safer ways to do this?

Thanks much.

Chris
_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Sun Apr 11, 2004 11:11 am    Post subject: Re: combining /usr and /usr/local partitions Reply with quote

darkphader wrote:
Can this process be accomplished by copying /usr and /usr/local to the spare drive, then using fdisk to delete hda2 and hda3, following by creating a larger hda2 using the space of both, making the filesystem, and then moving the data back?


In theory this should work as long as you get the numbers just right. I've seen people do it, but never done it myself.

darkphader wrote:
IOW, is using fdisk in this fashion safe, without harm coming to my other partitions?


Using fdisk is safe as long as you don't mess anything up. If you do mess it up exit using 'q', that way it won't save any changes.

darkphader wrote:
Will the other paritions remain numbered the same (hda4 is an extended partition) so that the only fstab change would be the removal of hda3 mount?


Not sure about this.

darkphader wrote:
Also Is "cp -a" all that is necessary for proper data movement for these purposes?


I usually use rsync for copying large amounts of stuff:

Code:
rsync -avz /usr/ /path/to/spare


a = archive (like with cp), v = verbose and z = compress.

darkphader wrote:
Are there any holes in my plan? Are their better or safer ways to do this?


There is a possibility of you messing up your partitions and loosing data on them, if you're not 100% confident in doing it there is a safer option. If you copy the /usr/local stuff to /usr and the /usr/share stuff to /dev/hda3, then change the fstab entry for /usr/local/ to point to /usr/share instead. It's not a proper single partition but it would give you more space in /usr.

HTH
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54304
Location: 56N 3W

PostPosted: Sun Apr 11, 2004 11:20 am    Post subject: Reply with quote

darkphader,

Portage keeps a lot of junk in /usr/portage.
Its quite safe to move all of this to say /usr/local/portage and create a symbolic link from /usr/portage to /usr/local/portage.
You can fix it without the symlink by editing /etc/make.conf but then your make.conf becomes non starndard.

You can do the same thing with other directories, providing none of the contents are in use.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Mon Apr 12, 2004 2:50 am    Post subject: Reply with quote

I went ahead with the plan as outined and all came out OK.
There was no renumbering of the remianing partitions, hda3 just went away.
Thanks.
_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Wed Aug 04, 2004 11:34 pm    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic.php?t=75699
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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