public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] unmounting /usr in single user mode
@ 2010-07-19 18:58 Allan Gottlieb
  2010-07-19 19:06 ` Alex Schuster
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Allan Gottlieb @ 2010-07-19 18:58 UTC (permalink / raw
  To: gentoo-user

I am unable to umount /usr in single user mode on an old system.
I believe the system is baselayout-1 and is amd64.
The trouble is open files, at least some of which appear to be related
to bash and locale (see the files below).

I use grub.  On the kernel line can I specify sh instead of bash?
I know sh is linked to bash, but hope that it will not use locale.

I need to umount /usr so that I can resize it (I use lvm and have
already extended the logical volume).  Specifically i want to execute
umount /usr
resize2fs /dev/vg/usr
mount /usr

(I realize I will probably need an e2fsck).

On my new system (baselayout-2), this was easy as /usr is not mounted
when rebooting into single user mode.

thanks,
allan

output of lsof | grep usr

bash      1907 root  mem       REG              254,0  1772320 245830 /usr/lib64/locale/locale-archive
bash      1907 root  mem       REG              254,0    26050 230642 /usr/lib64/gconv/gconv-modules.cache
bash      2125 root  mem       REG              254,0  1772320 245830 /usr/lib64/locale/locale-archive
bash      2125 root  mem       REG              254,0    26050 230642 /usr/lib64/gconv/gconv-modules.cache
lsof      2149 root  txt       REG              254,0   131144  92097 /usr/bin/lsof
lsof      2149 root  mem       REG              254,0  1772320 245830 /usr/lib64/locale/locale-archive
grep      2150 root  mem       REG              254,0  1772320 245830 /usr/lib64/locale/locale-archive
grep      2150 root  mem       REG              254,0    26050 230642 /usr/lib64/gconv/gconv-modules.cache
lsof      2151 root  txt       REG              254,0   131144  92097 /usr/bin/lsof
lsof      2151 root  mem       REG              254,0  1772320 245830 /usr/lib64/locale/locale-archive


output of fuser /usr/lib64/locale/locale-archive

  1907  2125

and 1907 was /bin/bash



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

* Re: [gentoo-user] unmounting /usr in single user mode
  2010-07-19 18:58 [gentoo-user] unmounting /usr in single user mode Allan Gottlieb
@ 2010-07-19 19:06 ` Alex Schuster
  2010-07-20 16:20   ` Allan Gottlieb
  2010-07-19 19:34 ` Kacper Kopczyński
  2010-07-19 20:00 ` Alan McKinnon
  2 siblings, 1 reply; 7+ messages in thread
From: Alex Schuster @ 2010-07-19 19:06 UTC (permalink / raw
  To: gentoo-user

Allan Gottlieb writes:

> I am unable to umount /usr in single user mode on an old system.
> I believe the system is baselayout-1 and is amd64.
> The trouble is open files, at least some of which appear to be related
> to bash and locale (see the files below).
> 
> I use grub.  On the kernel line can I specify sh instead of bash?
> I know sh is linked to bash, but hope that it will not use locale.

Why not use a live-cd?

> I need to umount /usr so that I can resize it (I use lvm and have
> already extended the logical volume).  Specifically i want to execute
> umount /usr
> resize2fs /dev/vg/usr
> mount /usr

As long as you extend the size, resizing works online, without the need to 
unmount a partition. That's only necessary when reducing the size. Hooray!

> (I realize I will probably need an e2fsck).

True if the partition is unmounted.

	Wonko



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

* Re: [gentoo-user] unmounting /usr in single user mode
  2010-07-19 18:58 [gentoo-user] unmounting /usr in single user mode Allan Gottlieb
  2010-07-19 19:06 ` Alex Schuster
@ 2010-07-19 19:34 ` Kacper Kopczyński
  2010-07-20 16:24   ` Allan Gottlieb
  2010-07-19 20:00 ` Alan McKinnon
  2 siblings, 1 reply; 7+ messages in thread
From: Kacper Kopczyński @ 2010-07-19 19:34 UTC (permalink / raw
  To: gentoo-user

Dnia 2010-07-19, o godz. 14:58:37
Allan Gottlieb <gottlieb@nyu.edu> napisał(a):

> I am unable to umount /usr in single user mode on an old system.
> I believe the system is baselayout-1 and is amd64.
> The trouble is open files, at least some of which appear to be related
> to bash and locale (see the files below).
> 
> I use grub.  On the kernel line can I specify sh instead of bash?
> I know sh is linked to bash, but hope that it will not use locale.
> 
> I need to umount /usr so that I can resize it (I use lvm and have
> already extended the logical volume).  Specifically i want to execute
> umount /usr
> resize2fs /dev/vg/usr
> mount /usr
> 
> (I realize I will probably need an e2fsck).
> 
> On my new system (baselayout-2), this was easy as /usr is not mounted
> when rebooting into single user mode.
> 
> thanks,
> allan
> 
> output of lsof | grep usr
> 
> bash      1907 root  mem       REG              254,0  1772320
> 245830 /usr/lib64/locale/locale-archive bash      1907 root
> mem       REG              254,0    26050
> 230642 /usr/lib64/gconv/gconv-modules.cache bash      2125 root
> mem       REG              254,0  1772320
> 245830 /usr/lib64/locale/locale-archive bash      2125 root
> mem       REG              254,0    26050
> 230642 /usr/lib64/gconv/gconv-modules.cache lsof      2149 root
> txt       REG              254,0   131144  92097 /usr/bin/lsof
> lsof      2149 root  mem       REG              254,0  1772320
> 245830 /usr/lib64/locale/locale-archive grep      2150 root
> mem       REG              254,0  1772320
> 245830 /usr/lib64/locale/locale-archive grep      2150 root
> mem       REG              254,0    26050
> 230642 /usr/lib64/gconv/gconv-modules.cache lsof      2151 root
> txt       REG              254,0   131144  92097 /usr/bin/lsof
> lsof      2151 root  mem       REG              254,0  1772320
> 245830 /usr/lib64/locale/locale-archive
> 
> 
> output of fuser /usr/lib64/locale/locale-archive
> 
>   1907  2125
> 
> and 1907 was /bin/bash
> 

Because of /usr/lib I think you should use LiveCD.

If you really need to do this in single user mode try busybox and its
shell - create a link like:
cd /bin; ln -s /bin/busybox bsh

-- 
Kacper Kopczyński



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

* Re: [gentoo-user] unmounting /usr in single user mode
  2010-07-19 18:58 [gentoo-user] unmounting /usr in single user mode Allan Gottlieb
  2010-07-19 19:06 ` Alex Schuster
  2010-07-19 19:34 ` Kacper Kopczyński
@ 2010-07-19 20:00 ` Alan McKinnon
  2010-07-20 16:23   ` Allan Gottlieb
  2 siblings, 1 reply; 7+ messages in thread
From: Alan McKinnon @ 2010-07-19 20:00 UTC (permalink / raw
  To: gentoo-user; +Cc: Allan Gottlieb

On Monday 19 July 2010 20:58:37 Allan Gottlieb wrote:
> I am unable to umount /usr in single user mode on an old system.
> I believe the system is baselayout-1 and is amd64.
> The trouble is open files, at least some of which appear to be related
> to bash and locale (see the files below).
> 
> I use grub.  On the kernel line can I specify sh instead of bash?

Not directly. grub and init does not know about, or even care about, bash.

You can change root's shell in /etc/passwd to sh and bash should run in sh 
mode. Or you can append init=/bin/sh to the grub boot line and try that. You 
will of course have to run all the init scripts yourself as init will not run 
when you do this. And you can't reboot either - when you exit the shell in 
this mode you'll get a panic




> I know sh is linked to bash, but hope that it will not use locale.
> 
> I need to umount /usr so that I can resize it (I use lvm and have
> already extended the logical volume).  Specifically i want to execute
> umount /usr
> resize2fs /dev/vg/usr
> mount /usr
> 
> (I realize I will probably need an e2fsck).
> 
> On my new system (baselayout-2), this was easy as /usr is not mounted
> when rebooting into single user mode.
> 
> thanks,
> allan
> 
> output of lsof | grep usr
> 
> bash      1907 root  mem       REG              254,0  1772320 245830
> /usr/lib64/locale/locale-archive bash      1907 root  mem       REG       
>       254,0    26050 230642 /usr/lib64/gconv/gconv-modules.cache bash     
> 2125 root  mem       REG              254,0  1772320 245830
> /usr/lib64/locale/locale-archive bash      2125 root  mem       REG       
>       254,0    26050 230642 /usr/lib64/gconv/gconv-modules.cache lsof     
> 2149 root  txt       REG              254,0   131144  92097 /usr/bin/lsof
> lsof      2149 root  mem       REG              254,0  1772320 245830
> /usr/lib64/locale/locale-archive grep      2150 root  mem       REG       
>       254,0  1772320 245830 /usr/lib64/locale/locale-archive grep     
> 2150 root  mem       REG              254,0    26050 230642
> /usr/lib64/gconv/gconv-modules.cache lsof      2151 root  txt       REG   
>           254,0   131144  92097 /usr/bin/lsof lsof      2151 root  mem    
>   REG              254,0  1772320 245830 /usr/lib64/locale/locale-archive
> 
> 
> output of fuser /usr/lib64/locale/locale-archive
> 
>   1907  2125
> 
> and 1907 was /bin/bash

-- 
alan dot mckinnon at gmail dot com



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

* Re: [gentoo-user] unmounting /usr in single user mode
  2010-07-19 19:06 ` Alex Schuster
@ 2010-07-20 16:20   ` Allan Gottlieb
  0 siblings, 0 replies; 7+ messages in thread
From: Allan Gottlieb @ 2010-07-20 16:20 UTC (permalink / raw
  To: gentoo-user

Alex Schuster <wonko@wonkology.org> writes:

> Allan Gottlieb writes:
>
>> I am unable to umount /usr in single user mode on an old system.
>> I believe the system is baselayout-1 and is amd64.
>> The trouble is open files, at least some of which appear to be related
>> to bash and locale (see the files below).
>> 
>> I use grub.  On the kernel line can I specify sh instead of bash?
>> I know sh is linked to bash, but hope that it will not use locale.
>
> Why not use a live-cd?

Good idea.  I certainly have a gentoo installation CD.
I guess I need to ensure lvm is running.  I would try this now except
for your intriguing comment below 

>> I need to umount /usr so that I can resize it (I use lvm and have
>> already extended the logical volume).  Specifically i want to execute
>> umount /usr
>> resize2fs /dev/vg/usr
>> mount /usr
>
> As long as you extend the size, resizing works online, without the need to 
> unmount a partition. That's only necessary when reducing the size. Hooray!

This is by far be the easiest soln.  I was misled by lvm howto
(http://www.tldp.org/HOWTO/LVM-HOWTO/extendlv.html), referred to by the
gentoo lvm guide.  The howto states

  ext2/ext3

  Unless you have patched your kernel with the ext2online patch it is
  necessary to unmount the file system before resizing it. (It seems
  that the online resizing patch is rather dangerous, so use at your own
  risk)

   # umount /dev/myvg/homevol/dev/myvg/homevol
   # resize2fs /dev/myvg/homevol
   # mount /dev/myvg/homevol /home

However, this document's latest copyright notice is 2006 and clearly the
kernel has evolved.  Indeed the current man page for resize2fs
states that the file system can indeed be extended while mounted
(providing it is mounted as ext3).

thanks for setting me straight.
allan



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

* Re: [gentoo-user] unmounting /usr in single user mode
  2010-07-19 20:00 ` Alan McKinnon
@ 2010-07-20 16:23   ` Allan Gottlieb
  0 siblings, 0 replies; 7+ messages in thread
From: Allan Gottlieb @ 2010-07-20 16:23 UTC (permalink / raw
  To: gentoo-user

Alan McKinnon <alan.mckinnon@gmail.com> writes:

> On Monday 19 July 2010 20:58:37 Allan Gottlieb wrote:
>> I am unable to umount /usr in single user mode on an old system.
>> I believe the system is baselayout-1 and is amd64.
>> The trouble is open files, at least some of which appear to be related
>> to bash and locale (see the files below).
>> 
>> I use grub.  On the kernel line can I specify sh instead of bash?
>
> Not directly. grub and init does not know about, or even care about, bash.
>
> You can change root's shell in /etc/passwd to sh and bash should run in sh 
> mode. Or you can append init=/bin/sh to the grub boot line and try that. You 
> will of course have to run all the init scripts yourself as init will not run 
> when you do this. And you can't reboot either - when you exit the shell in 
> this mode you'll get a panic

Thanks for the information.

allan



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

* Re: [gentoo-user] unmounting /usr in single user mode
  2010-07-19 19:34 ` Kacper Kopczyński
@ 2010-07-20 16:24   ` Allan Gottlieb
  0 siblings, 0 replies; 7+ messages in thread
From: Allan Gottlieb @ 2010-07-20 16:24 UTC (permalink / raw
  To: gentoo-user

Kacper Kopczyński <capsel@matrix.inten.pl> writes:

> Because of /usr/lib I think you should use LiveCD.

Yes I should have done that originally.

> If you really need to do this in single user mode try busybox and its
> shell - create a link like:
> cd /bin; ln -s /bin/busybox bsh

thanks,
allan



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

end of thread, other threads:[~2010-07-20 17:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-19 18:58 [gentoo-user] unmounting /usr in single user mode Allan Gottlieb
2010-07-19 19:06 ` Alex Schuster
2010-07-20 16:20   ` Allan Gottlieb
2010-07-19 19:34 ` Kacper Kopczyński
2010-07-20 16:24   ` Allan Gottlieb
2010-07-19 20:00 ` Alan McKinnon
2010-07-20 16:23   ` Allan Gottlieb

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