public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] fsck separate /usr
@ 2012-05-13  0:43 Alex Schuster
  2012-05-13  0:54 ` Canek Peláez Valdés
  2012-05-13 14:02 ` Philip Webb
  0 siblings, 2 replies; 11+ messages in thread
From: Alex Schuster @ 2012-05-13  0:43 UTC (permalink / raw
  To: gentoo-user

Hi there!

I'm using the new udev with a separate /usr partition. It was encrypted,
and it seems there is no solution yet for this, so I moved it over to an
unencrypted volume - no problem, /usr is one partition where encryption
does not make that much sense anyway. Works, but after an unclean shutdown
(reading files in /proc/<pid>/ was not a good idea) /usr wants to be
fsck'ed. But it is already mounted at that stage.

The boot process just continues, but I wonder what one should do to make
the fsck run. Except for using a live cd.

Maybe I should just enlarge my root partition and move /usr there, at
least this would avoid all the trouble. But I'm used to many separate
partitions, and like it that way.

	Wonko



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13  0:43 [gentoo-user] fsck separate /usr Alex Schuster
@ 2012-05-13  0:54 ` Canek Peláez Valdés
  2012-05-13  3:54   ` kwkhui
  2012-05-13 10:46   ` Alex Schuster
  2012-05-13 14:02 ` Philip Webb
  1 sibling, 2 replies; 11+ messages in thread
From: Canek Peláez Valdés @ 2012-05-13  0:54 UTC (permalink / raw
  To: gentoo-user

On Sat, May 12, 2012 at 7:43 PM, Alex Schuster <wonko@wonkology.org> wrote:
> Hi there!
>
> I'm using the new udev with a separate /usr partition.

How do you create your initramfs? The new udev (>= 182, I believe)
requires the use of an initramfs if you have a separated /usr.

> It was encrypted,
> and it seems there is no solution yet for this.

dracut has two modules, crypt and crypt-gpg, that maybe do what you are needing.

> so I moved it over to an
> unencrypted volume - no problem, /usr is one partition where encryption
> does not make that much sense anyway. Works, but after an unclean shutdown
> (reading files in /proc/<pid>/ was not a good idea) /usr wants to be
> fsck'ed. But it is already mounted at that stage.

That's the reason you need an initramfs.

> The boot process just continues, but I wonder what one should do to make
> the fsck run. Except for using a live cd.

With an initramfs.

> Maybe I should just enlarge my root partition and move /usr there, at
> least this would avoid all the trouble. But I'm used to many separate
> partitions, and like it that way.

You can have every directory under / on a different partition (even
/etc), if you use an initramfs.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13  0:54 ` Canek Peláez Valdés
@ 2012-05-13  3:54   ` kwkhui
  2012-05-13  4:25     ` Canek Peláez Valdés
  2012-05-13 10:46   ` Alex Schuster
  1 sibling, 1 reply; 11+ messages in thread
From: kwkhui @ 2012-05-13  3:54 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1732 bytes --]

On Sat, 12 May 2012 19:54:24 -0500
Canek Peláez Valdés <caneko@gmail.com> wrote:

> On Sat, May 12, 2012 at 7:43 PM, Alex Schuster <wonko@wonkology.org>
> wrote:
> > Hi there!
> >
> > I'm using the new udev with a separate /usr partition.
> 
> How do you create your initramfs? The new udev (>= 182, I believe)
> requires the use of an initramfs if you have a separated /usr.
> 
> > It was encrypted,
> > and it seems there is no solution yet for this.
> 
> dracut has two modules, crypt and crypt-gpg, that maybe do what you
> are needing.
> 
> > so I moved it over to an
> > unencrypted volume - no problem, /usr is one partition where
> > encryption does not make that much sense anyway. Works, but after
> > an unclean shutdown (reading files in /proc/<pid>/ was not a good
> > idea) /usr wants to be fsck'ed. But it is already mounted at that
> > stage.
> 
> That's the reason you need an initramfs.

No, that's the reason you want the filesystem's fsck to be included in
the initramfs.

> > The boot process just continues, but I wonder what one should do to
> > make the fsck run. Except for using a live cd.
> 
> With an initramfs.

Using initramfs is necessary but itself not sufficient.

One can create an initramfs (from scratch) that does nothing but
mount /usr (with only busybox and a few /dev nodes, plus whatever other
tools needed to find /usr, viz. lvm, cryptsetup and friends, assuming
the necessary drivers are built in the kernel and not as modules ---
see e.g. the old gentoo wiki at
http://www.gentoo-wiki.info/HOWTO_Custom_Initramfs_From_Scratch ).

The initramfs needs to have the relevant fsck tools (plus dependencies)
if it was to perform fsck.

Kerwin.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13  3:54   ` kwkhui
@ 2012-05-13  4:25     ` Canek Peláez Valdés
  0 siblings, 0 replies; 11+ messages in thread
From: Canek Peláez Valdés @ 2012-05-13  4:25 UTC (permalink / raw
  To: gentoo-user

On Sat, May 12, 2012 at 10:54 PM,  <kwkhui@hkbn.net> wrote:
> On Sat, 12 May 2012 19:54:24 -0500
> Canek Peláez Valdés <caneko@gmail.com> wrote:
>
>> On Sat, May 12, 2012 at 7:43 PM, Alex Schuster <wonko@wonkology.org>
>> wrote:
>> > Hi there!
>> >
>> > I'm using the new udev with a separate /usr partition.
>>
>> How do you create your initramfs? The new udev (>= 182, I believe)
>> requires the use of an initramfs if you have a separated /usr.
>>
>> > It was encrypted,
>> > and it seems there is no solution yet for this.
>>
>> dracut has two modules, crypt and crypt-gpg, that maybe do what you
>> are needing.
>>
>> > so I moved it over to an
>> > unencrypted volume - no problem, /usr is one partition where
>> > encryption does not make that much sense anyway. Works, but after
>> > an unclean shutdown (reading files in /proc/<pid>/ was not a good
>> > idea) /usr wants to be fsck'ed. But it is already mounted at that
>> > stage.
>>
>> That's the reason you need an initramfs.
>
> No, that's the reason you want the filesystem's fsck to be included in
> the initramfs.
>
>> > The boot process just continues, but I wonder what one should do to
>> > make the fsck run. Except for using a live cd.
>>
>> With an initramfs.
>
> Using initramfs is necessary but itself not sufficient.
>
> One can create an initramfs (from scratch) that does nothing but
> mount /usr (with only busybox and a few /dev nodes, plus whatever other
> tools needed to find /usr, viz. lvm, cryptsetup and friends, assuming
> the necessary drivers are built in the kernel and not as modules ---
> see e.g. the old gentoo wiki at
> http://www.gentoo-wiki.info/HOWTO_Custom_Initramfs_From_Scratch ).
>
> The initramfs needs to have the relevant fsck tools (plus dependencies)
> if it was to perform fsck.

Dracut (and I believe genkernel, but I don't use it, so I'm not sure)
does all of that (and more, if so desired) for you.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13  0:54 ` Canek Peláez Valdés
  2012-05-13  3:54   ` kwkhui
@ 2012-05-13 10:46   ` Alex Schuster
  2012-05-13 12:27     ` Dale
  1 sibling, 1 reply; 11+ messages in thread
From: Alex Schuster @ 2012-05-13 10:46 UTC (permalink / raw
  To: gentoo-user

Canek Peláez Valdés writes:

> On Sat, May 12, 2012 at 7:43 PM, Alex Schuster <wonko@wonkology.org>
> wrote:

> > I'm using the new udev with a separate /usr partition.
> 
> How do you create your initramfs? The new udev (>= 182, I believe)
> requires the use of an initramfs if you have a separated /usr.

I'm using gekernel.

> > It was encrypted,
> > and it seems there is no solution yet for this.
> 
> dracut has two modules, crypt and crypt-gpg, that maybe do what you are
> needing.

Maybe, I did not (yet?) try dracut.

> > so I moved it over to an
> > unencrypted volume - no problem, /usr is one partition where
> > encryption does not make that much sense anyway. Works, but after an
> > unclean shutdown (reading files in /proc/<pid>/ was not a good
> > idea) /usr wants to be fsck'ed. But it is already mounted at that
> > stage.
> 
> That's the reason you need an initramfs.
> 
> > The boot process just continues, but I wonder what one should do to
> > make the fsck run. Except for using a live cd.
> 
> With an initramfs.

Not with mine :)  Maybe I'll give dracut a try. It seems to be a nice
utility, and I was about to try it, but then I read about Dale's problems
and decided to stay with genkernel for a while.

> > Maybe I should just enlarge my root partition and move /usr there, at
> > least this would avoid all the trouble. But I'm used to many separate
> > partitions, and like it that way.
> 
> You can have every directory under / on a different partition (even
> /etc), if you use an initramfs.

Which I do, every partition (including /) is on LVM, and except
for /usr, /usr/src and portage stuff, all is encrypted. But maybe it's
time to drop some partitions, and maybe include at least /usr and /tmp in
the root partition. /usr would be encrypted again then, but the overhead
seems to be small, so why not.

	Wonko



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13 10:46   ` Alex Schuster
@ 2012-05-13 12:27     ` Dale
  0 siblings, 0 replies; 11+ messages in thread
From: Dale @ 2012-05-13 12:27 UTC (permalink / raw
  To: gentoo-user

Alex Schuster wrote:

> Not with mine :)  Maybe I'll give dracut a try. It seems to be a nice
> utility, and I was about to try it, but then I read about Dale's problems
> and decided to stay with genkernel for a while.

> 
> 	Wonko
> 
> 


I'm not sure but I think the reason I was having so much trouble was
that I didn't remove the failed try at a init thingy in the kernel
itself.  I tried that first but it didn't work. When I started trying to
use dracut, I didn't even think to disable or remove the in kernel one.

I have updated my kernel several times since and I have not had a single
issue.  So, if you decide to use dracut, make sure you clean out the old
cruft first.

That said, I didn't know dracut could do the file system checks before
mounting and doing the switch_root thing.  I see it include the programs
but never seen it actually do the check.  Makes me wonder.

Dale

:-)  :-)

-- 
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!

Miss the compile output?  Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13  0:43 [gentoo-user] fsck separate /usr Alex Schuster
  2012-05-13  0:54 ` Canek Peláez Valdés
@ 2012-05-13 14:02 ` Philip Webb
  2012-05-13 15:11   ` Alex Schuster
  1 sibling, 1 reply; 11+ messages in thread
From: Philip Webb @ 2012-05-13 14:02 UTC (permalink / raw
  To: gentoo-user

120513 Alex Schuster wrote:
> I'm using the new udev with a separate /usr partition ...
> after an unclean shutdown
> -- reading files in /proc/<pid>/ was not a good idea --
> /usr wants to be fsck'ed. But it is already mounted at that stage.
> Maybe I should just enlarge my root partition and move /usr there

Did you see my description of how I did that ? -- see list 120506 .
The actual process took me  2 h 30 m , but preparations spread out longer.
Everything else is working just as before,
but I don't have to bother ever about Initramfs (whatever that is : smile),
& can update Udev without any worries when it becomes stable.  HTH

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13 14:02 ` Philip Webb
@ 2012-05-13 15:11   ` Alex Schuster
  2012-05-13 17:08     ` Neil Bothwick
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Schuster @ 2012-05-13 15:11 UTC (permalink / raw
  To: gentoo-user

Philip Webb writes:

> 120513 Alex Schuster wrote:
> > I'm using the new udev with a separate /usr partition ...
> > after an unclean shutdown
> > -- reading files in /proc/<pid>/ was not a good idea --
> > /usr wants to be fsck'ed. But it is already mounted at that stage.
> > Maybe I should just enlarge my root partition and move /usr there
> 
> Did you see my description of how I did that ? -- see list 120506 .
> The actual process took me  2 h 30 m , but preparations spread out
> longer. Everything else is working just as before,
> but I don't have to bother ever about Initramfs (whatever that is :
> smile), & can update Udev without any worries when it becomes stable.
> HTH

I saw that, but here it will be much easier. All is on LVM here, so this should do it:

# enlarge root partition
lvresize -L +17G /dev/weird/root
cryptsetup resize root
resize2fs /dev/mapper/root

# make sure /usr is not being written to. For other partitions, I'd
# create an LVM snapshot
mount -o remount,ro /usr

# mount root to another place, without mounts like /usr showing up there
mkdir /tmp/bindroot
mount -o bind / /tmp/bindroot

# copy data over
rsync -ax /usr /tmp/bindroot/

# remove /usr stuff from fstab and dmcrypt
sed "/\/dev\/weird\/usr/ d" /etc/fstab
sed -i "/^target=usr2$/{N;N:N:d}" /etc/conf.d/dmcrypt

# done!
reboot

No need for downtime except for the reboot, I guess I cannot unmount /usr
otherwise.

	Wonko



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13 15:11   ` Alex Schuster
@ 2012-05-13 17:08     ` Neil Bothwick
  2012-05-13 17:27       ` Alex Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Neil Bothwick @ 2012-05-13 17:08 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

On Sun, 13 May 2012 17:11:55 +0200, Alex Schuster wrote:

> # copy data over
> rsync -ax /usr /tmp/bindroot/

It would be wise to remount /usr read-only before doing this.

> No need for downtime except for the reboot, I guess I cannot
> unmount /usr otherwise.

You could drop to single user mode to unmount /usr, but as that involves
stopping and restarting just about every service, it is just as
convenient to reboot... unless you are aiming for some sort of uptime
record.


-- 
Neil Bothwick

In possession of a mind not merely twisted, but actually sprained.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13 17:08     ` Neil Bothwick
@ 2012-05-13 17:27       ` Alex Schuster
  2012-05-13 17:44         ` Neil Bothwick
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Schuster @ 2012-05-13 17:27 UTC (permalink / raw
  To: gentoo-user

Neil Bothwick writes:

> On Sun, 13 May 2012 17:11:55 +0200, Alex Schuster wrote:
> 
> > # copy data over
> > rsync -ax /usr /tmp/bindroot/
> 
> It would be wise to remount /usr read-only before doing this.

Yes, as written a few lines above what you quoted :)

> > No need for downtime except for the reboot, I guess I cannot
> > unmount /usr otherwise.
> 
> You could drop to single user mode to unmount /usr, but as that involves
> stopping and restarting just about every service, it is just as
> convenient to reboot... 

Probably much much more convenient. I even guess the downtime of any
service would actually be less.

> unless you are aiming for some sort of uptime record.

The record is about 420 days, and it will last for a while. So rebooting
every few weeks is okay :)  But it's cool that I _could_ do this without
a reboot.

	Wonko



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] fsck separate /usr
  2012-05-13 17:27       ` Alex Schuster
@ 2012-05-13 17:44         ` Neil Bothwick
  0 siblings, 0 replies; 11+ messages in thread
From: Neil Bothwick @ 2012-05-13 17:44 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

On Sun, 13 May 2012 19:27:07 +0200, Alex Schuster wrote:

> > It would be wise to remount /usr read-only before doing this.  
> 
> Yes, as written a few lines above what you quoted :)

:P


-- 
Neil Bothwick

Do hungry crows have ravenous appetites?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-05-13 17:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-13  0:43 [gentoo-user] fsck separate /usr Alex Schuster
2012-05-13  0:54 ` Canek Peláez Valdés
2012-05-13  3:54   ` kwkhui
2012-05-13  4:25     ` Canek Peláez Valdés
2012-05-13 10:46   ` Alex Schuster
2012-05-13 12:27     ` Dale
2012-05-13 14:02 ` Philip Webb
2012-05-13 15:11   ` Alex Schuster
2012-05-13 17:08     ` Neil Bothwick
2012-05-13 17:27       ` Alex Schuster
2012-05-13 17:44         ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox