FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 07-19-2010, 07:06 PM
Alex Schuster
 
Default unmounting /usr in single user mode

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
 
Old 07-19-2010, 07:34 PM
Kacper Kopczyński
 
Default unmounting /usr in single user mode

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
 
Old 07-19-2010, 08:00 PM
Alan McKinnon
 
Default unmounting /usr in single user mode

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
 
Old 07-20-2010, 04:20 PM
Allan Gottlieb
 
Default unmounting /usr in single user mode

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
 
Old 07-20-2010, 04:23 PM
Allan Gottlieb
 
Default unmounting /usr in single user mode

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
 
Old 07-20-2010, 04:24 PM
Allan Gottlieb
 
Default unmounting /usr in single user mode

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
 

Thread Tools




All times are GMT. The time now is 03:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org