Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Building Gentoo with a separate /usr
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
SProkofiev
n00b
n00b


Joined: 23 Apr 2012
Posts: 10

PostPosted: Sun Mar 10, 2013 3:18 am    Post subject: Building Gentoo with a separate /usr Reply with quote

With the jump to udev-197-r8 updating Portage has become more tenuous. I had posted previously on ways to do this without breaking
Gentoo. Dracut was suggested and more recently I noted genkernel may be used to create an initramfs. I'm told that I may
roll my own more simply.

I've installed a second hard drive on which to build a new system while maintaining my current system in a running condition.

My intent is to use the following partition scheme:

/
/var
/tmp
/opt
/home
/usr

and in my case a separate partition /distfiles to maintain source code.

Of course, there will be a swap partition.

I had considered LVM2 as well, but as I will have one HDD I'm not sure that really is possible.

So the bottle neck right now is just what I need to do so that my new system will boot with
/usr on a separate partition. I use grub (not grub2) so I wonder just what I must put there
and what I must build into my kernel.

I've been told I can use genkernel to build initramfs, but if rolling it myself is possible I'd like
to do that.

Any suggestions or pointers to specific HOWTOs would be appreciated.

Thanks.
_________________
"Of all tyrannies, a tyranny sincerely exercised for the good of its victims may be the most oppressive... [T]hose
who torment us for our own good will torment us without end for they do so with the approval of their own conscience."

C.S. Lewis
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8594

PostPosted: Sun Mar 10, 2013 4:48 am    Post subject: Reply with quote

Since this is a new system with the opportunity to arrange things in any way you like, why make /usr separate? I have always used separate /usr for historical reasons, but due to the continuing degradation of udev functionality, I have made it a point to build new systems with an integrated /usr.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Mar 10, 2013 4:41 pm    Post subject: Reply with quote

SProkofiev,

I wrote
NeddySeagoon's Rough Guide to >=udev-182
a while ago but on rereading it looks "mostly harmless". Use ldd to check for library versions - they may have changed.
_________________
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
ssuominen
Developer
Developer


Joined: 30 Sep 2005
Posts: 2000
Location: Finland

PostPosted: Sun Mar 10, 2013 6:27 pm    Post subject: Reply with quote

NeddySeagoon wrote:
SProkofiev,

I wrote
NeddySeagoon's Rough Guide to >=udev-182
a while ago but on rereading it looks "mostly harmless". Use ldd to check for library versions - they may have changed.


Except udev is not related to the separate /usr problem, at least anymore. udev-197-r8 and higher works fine with separate /usr without anything special. The other points in the post might still be accurate though
Back to top
View user's profile Send private message
krenshala
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jan 2006
Posts: 81
Location: Austin TX, NorAm, Sol III

PostPosted: Fri Mar 15, 2013 12:59 am    Post subject: Reply with quote

ssuominen wrote:
NeddySeagoon wrote:
SProkofiev,

I wrote
NeddySeagoon's Rough Guide to >=udev-182
a while ago but on rereading it looks "mostly harmless". Use ldd to check for library versions - they may have changed.


Except udev is not related to the separate /usr problem, at least anymore. udev-197-r8 and higher works fine with separate /usr without anything special. The other points in the post might still be accurate though

I haven't had time to keep up on the situation, but what happened to change things so udev no longer requires /usr (and I assume /var) to be part of the root partition? I'm happy about this, as I am another user that prefers to have /usr (and /var) as their own partitions, but I'm curious what changed. Was it just enough people complaining about the "do it our way or else" changes to udev or something else?
_________________
krenshala
:wq
Back to top
View user's profile Send private message
SProkofiev
n00b
n00b


Joined: 23 Apr 2012
Posts: 10

PostPosted: Wed Mar 20, 2013 3:21 am    Post subject: Building Gentoo with a separate /usr [SOLVED - Maybe] Reply with quote

Thank you, all, for this information. I was unaware of the progression of things and I am very happy to hear this development.


I think I will image my current system to a new drive and then update Portage to see how things go. I follow up
with my results when I am able to complete this.

Thanks again to the developers for their input. As usual I have found the Gentoo forums to be an invaluable
resource from an educational perspective as well as a system perspective.

Thanks.
_________________
"Of all tyrannies, a tyranny sincerely exercised for the good of its victims may be the most oppressive... [T]hose
who torment us for our own good will torment us without end for they do so with the approval of their own conscience."

C.S. Lewis
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Fri Mar 29, 2013 11:35 am    Post subject: Reply with quote

Hu wrote:
Since this is a new system with the opportunity to arrange things in any way you like, why make /usr separate? I have always used separate /usr for historical reasons, but due to the continuing degradation of udev functionality, I have made it a point to build new systems with an integrated /usr.


Just an observation on my part...

For me, it saved my ar*e having my OS file systems separate from heavily written file systems.

I had a RAM failure, which would only show up when GCC was compiling big projects like Chromium or Libre Office and GCC would crash.

I didn't realise it was a RAM, although I should have, as this is the second time this has happened, over the years.

But, because I had faulty RAM, my /home, /var and /tmp file systems all developed various levels of corruption, to such an extent, my /home system failed completely and I had to resort to my backups.

If I had followed the general trend nowadays to keep everything in one file system, my system would have been completely screwed, whereas my system only had a couple of file systems with problems, but the system still operated and I was able to do the restore without resorting to a rescue disk.

Regardless, I have separate /usr and udev-197 with no initramfs or any special startup script with no significant problems - the only problem I see so far is an attempt to set alsasound during boot fails (because /usr is missing), which I really couldn't care less about.
_________________
...Lyall
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2424
Location: Germany

PostPosted: Fri Mar 29, 2013 1:19 pm    Post subject: Reply with quote

lyallp wrote:
If I had followed the general trend nowadays to keep everything in one file system


If that's a trend, how about the trend of making backups of everything? Failure is always possible.

Also, merging / and /usr doesn't mean you're going to have "everything in one filesystem". In fact if you have a filesystem for everything, then your root filesystem will be one thing: pretty much empty. /bin /sbin and /etc are like what, 50MB at most? /root doesn't usually have files in it, so...

That's why I had no trouble at all merging my / and /usr... I simply moved all the root files onto the /usr partition. Also freed 4G of space I previously wasted on a useless-empty / partition. It's something.

lyallp wrote:
the only problem I see so far is an attempt to set alsasound during boot fails (because /usr is missing), which I really couldn't care less about.


I like my default mixer settings loaded on boot, thank you very much. I realize this may happen for KDE/Gnome users later on anyway, but my music already starts playing before the graphical interface even comes up (thanks to mpd), so it's kind of important at boot stage.

I wager you'll see more errors of that kind in the future... the more people combine / and /usr, the fewer people will notice problems that arise only with separate /usr. It's not worth any kind of hassle
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Fri Mar 29, 2013 10:30 pm    Post subject: Reply with quote

My root filesystem is only 512mb, even that is way over size, it only needs to be 200mb and have room to spare. It's only so big now because it allows me to play with multiple kernel builds.

The root filesystem is the critical filesystem for booting, without it, no Gentoo. /usr is optional, if it goes walkabouts, I can still boot and recover.

As i mentioned in my post, I used my backups, so I follow a trend.

With regards to alsasound, who cares, the desktop apps do that instead, even my minimal fluxbox sorts that out.

Finally, you don't move root into /usr, you move /usr into root. There is always a root filesystem, it just depends on how big and how much you load it with.

It's almost funny, this particular argument is as bad as the 'which way should a toilet roll be mounted, roll over or under', it's almost a religious thing.
_________________
...Lyall
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8594

PostPosted: Sat Mar 30, 2013 12:29 am    Post subject: Reply with quote

Like frostschutz, I never intended for you to combine everything. I suggested only that you combine /usr and / on the basis that, as of when I wrote that, I believed udev had poor support for handling separate /usr without external hacks. I suspect that frostschutz moved / into /usr because he had adequate free space in the /usr filesystem to rearrange files that way, but insufficient space in / to bring /usr into it. The procedure would be to boot into a rescue environment, mount both / and /usr as /mnt/gentoo and /mnt/gentoo/usr respectively, then (untested):
Code:
cd /mnt/gentoo/usr
mkdir znewusr
mv *
mv znewusr usr
cd ..
tar --one-file-system --create --file - . | tar -C usr -x -f -
This rearranges all files and directories previously at the root of the /usr filesystem to reside inside a directory named usr, then copies all files from your old root filesystem into the now clean root of the usr filesystem. You then reconfigure the kernel to treat this new merged filesystem as root.

I use a separate /boot, so my root filesystem can be quite small and still permit me to retain multiple kernels.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Mar 30, 2013 10:58 am    Post subject: Reply with quote

The root /usr merge and subsequent breakage is not a udev problem.
The merge has been happening for some time and udev had been papering over the cracks with varying degrees of success, for some time too.

The breakage became obvious when udev stopped papering over the cracks.
The udev change only served to make the underlying issues visible, it did not cause them.

So ...
you go with the flow and put /usr on /
you use some other udev substiiute ... including a static /dev that does not need /usr
you use an initrd, which in effect, becomes root

If you use an initrd on Gentoo, you need to understand whats in it and what it does, this means you need to make your own, so when it breaks, you know how to fix it.
You can put enough in the initrd so it behaves like root before the move to /usr began, or you can become resigned to using another boot image to rescue you box when the initrd breaks.

My preference, I use an initrd that contains only userspace tools. The kernel can do everything else itself. That means I don't update the initrd for every kernel and the initrd is pretty much like firmware. It never changes. I need an initrd anyway as everything is in LVM on raid5, except /boot. Adding /usr and /var mounting was little more than an irritation.
_________________
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
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Sat Mar 30, 2013 12:09 pm    Post subject: Reply with quote

I admit, I do have a laptop with a custom built initrd, LVM on a luks encrypted partition required it.

However, my home pc has RAID, LVM and doesn't (yet) use an initrd, and still has separate /var and /usr..

I accept I will have to deal with udev at some point, but not yet...

:)
_________________
...Lyall
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Mar 30, 2013 12:21 pm    Post subject: Reply with quote

lyallp,

You must also use kernel raid auto assembly, which is depreciated.
One day you will update your kernel and your raid won't assemble.
_________________
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
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Sat Mar 30, 2013 10:03 pm    Post subject: Reply with quote

Sheesh, now I am getting depressed, looks like a complete rebuild is in order.

My install is years old...
_________________
...Lyall
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Mar 30, 2013 10:09 pm    Post subject: Reply with quote

lyallp,

You just need to move away from raid auto assembly before a kernel update forces you to.
That way you can do it in your own time.
_________________
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
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing 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