Udo Grabowski
2008-Nov-27 18:16 UTC
[zfs-discuss] 2008.11 rc2 weird zpool import behaviour
Hello, after installing 2008.11 and accidently locking up the administrative account by giving it userid=0, I cannot login to our machine (only role based access allowed). So I tried it the usual way: boot from 2008.11 live-cd, then ''zpool import -f -R /a rpool'' or ''zpool import -f -R /a 23532453453 root_pool'' (tried both variants, id is fake). The weird effect is that, although zfs list shows that rpool/ROOT/opensolaris is mounted on /a, I can only see a few directories (/a/export/home/,/a/rpool), but no files at all, and also not the usual root directories ! So no way to change /a/etc/shadow and /a/etc/passwd. Booting again from the disk, everything is fine (except no login possible...). What''s going on here ? A rc2 bug ? Any other ways to get the pool into a usable state ? -- This message posted from opensolaris.org
I found I had to set the mount point property for the rpool/ROOT/opensolaris filesystem; zfs mount it and do the edits and then unmount and reset the mount point property back to root (I made the mistake of messing up the user_attr file). Udo Grabowski wrote:> Hello, > after installing 2008.11 and accidently locking up the administrative account by > giving it userid=0, I cannot login to our machine (only role based access allowed). > So I tried it the usual way: boot from 2008.11 live-cd, then ''zpool import -f -R /a rpool'' > or ''zpool import -f -R /a 23532453453 root_pool'' (tried both variants, id is fake). > > The weird effect is that, although zfs list shows that rpool/ROOT/opensolaris is mounted > on /a, I can only see a few directories (/a/export/home/,/a/rpool), but no files at all, and > also not the usual root directories ! So no way to change /a/etc/shadow and > /a/etc/passwd. > Booting again from the disk, everything is fine (except no login possible...). > > What''s going on here ? A rc2 bug ? Any other ways to get the pool into a usable state ?
Am I right in thinking that it hadn''t mounted the pool, but a directory of the same name was there? -- This message posted from opensolaris.org
Udo Grabowski
2008-Nov-27 22:14 UTC
[zfs-discuss] 2008.11 rc2 weird zpool import behaviour
Tried setting the mountpoint explicitly already, gives exactly the same behaviour. There wasn''t a directory of the same name (tried with /a existing and /a not existing before the import/mountpoint setting), and zpool status and zfs list show exactly what is expected. But only the mountpoints under /a and a few of the subdirectories there appear, not a single file. zpool status before the import was empty, so no duplicate rpool. Tried setting mountpoint to legacy and mounted by hand somewhere, exactly the same strange appearance. We''ve root on zfs over a year now with SXDE 01/08 (fiddled at lot with zfs to get it running before it was officially possible), and never have seen such a behaviour. -- This message posted from opensolaris.org
Udo Grabowski wrote:> Tried setting the mountpoint explicitly already, gives exactly the same > behaviour. There wasn''t a directory of the same name (tried with /a existing > and /a not existing before the import/mountpoint setting), and zpool status > and zfs list show exactly what is expected. But only the mountpoints under /a > and a few of the subdirectories there appear, not a single file. zpool status before the > import was empty, so no duplicate rpool. Tried setting mountpoint to legacy > and mounted by hand somewhere, exactly the same strange appearance. > We''ve root on zfs over a year now with SXDE 01/08 (fiddled at lot with zfs to get it > running before it was officially possible), and never have seen such a behaviour.That is odd - I just went through it here on a virtualbox system: o boot from the iso image o fire up an terminal window and did the following: zpool import -f rpool o cd /rpool and this only shows two directories for boot and etc o zfs set mountpoint=/foo rpool/ROOT/opensolaris o zfs mount rpool/ROOT/opensolaris o ls /foo and all the pieces are there Is this what you are doing ? Note /foo did not exist. ta pete
Udo Grabowski
2008-Nov-28 14:16 UTC
[zfs-discuss] 2008.11 rc2 weird zpool import behaviour
Ok, your procedure differs slightly from what I''ve done: zfs import -f rpool zfs set mountpoint=/a rpool/ROOT/opensolaris ls -l /a Setting mountpoint AND explicitly mounting indeed gives the files back ! I didn''t mount it explicitly after setting mountpoint to /a, since it used to be mounted automatically then, also mounted via ''mount -F zfs rpool/ROOT/opensolaris /a'', but with setting mountpoint of opensolaris to legacy. Doesn''t it automatically mount when mountpoint is set any longer ? Or is this behaviour a consequence of the mount failure on import when it tries to mount over / ? Thanks a lot for the hints, you saved my day ! -- This message posted from opensolaris.org
Peter Dennis - Sustaining Engineer
2008-Nov-28 14:49 UTC
[zfs-discuss] 2008.11 rc2 weird zpool import behaviour
Udo Grabowski wrote:> Ok, your procedure differs slightly from what I''ve done: > zfs import -f rpool > zfs set mountpoint=/a rpool/ROOT/opensolaris > ls -l /a > > Setting mountpoint AND explicitly mounting indeed gives the files back ! > > I didn''t mount it explicitly after setting mountpoint to /a, since it used to be > mounted automatically then, also mounted via ''mount -F zfs rpool/ROOT/opensolaris /a'', > but with setting mountpoint of opensolaris to legacy. > Doesn''t it automatically mount when mountpoint is set any longer ? Or is > this behaviour a consequence of the mount failure on import when it tries > to mount over / ?I suspect that is the reason - simply because all the other filesystems are mounted (well in my case anyway).> > Thanks a lot for the hints, you saved my day !Great stuff.