LVM might have locked me out

rchamberland rchamberland at chs.ca
Mon Oct 29 16:17:47 UTC 2007



> -----Original Message-----
> From: redhat-sysadmin-list-bounces at redhat.com [mailto:redhat-sysadmin-
> list-bounces at redhat.com] On Behalf Of Herta Van den Eynde
> Sent: Friday, October 26, 2007 7:27 PM
> To: redhat-sysadmin-list at redhat.com
> Subject: Re: LVM might have locked me out
> 
> On 27/10/2007, rchamberland <rchamberland at chs.ca> wrote:
> >
> > Thanks Herta, especially for refraining from making comments about
> newbie
> > mistakes. :)
> >
> > I tried that and it's not looking good.  The rescue system can't find
> any
> > existing linux system, it even says it can't see any hard drives.  I can
> get
> > a shell but it doesn't see anything beyond that.  Mount /mnt/sysimg
> doesn't
> > work because there is no sysimg.
> >
> > When I cold boot without the rescue disk I can get a wonky "filesystem
> > repair" shell that gives errors and needs full command paths.  That
> shell
> > sees the old /etc/fstab but it's read-only and vi just gives me an error
> > when I try to overwrite.
> >
> > I think fstab may be locked by fstab-sync.  However, that command seems
> to
> > be stored in /usr/sbin, which seems to be empty - probably messed up by
> my
> > lvm stupidity.  On the other hand, how can that be...
> >
> > I'll wait until Monday and if there doesn't seem any way around it I
> guess
> > I'll have to do a full reinstall.  Not looking forward to that but oh
> well.
> >
> > Rob C
> >
> >
> >
> > -----Original Message-----
> > From: redhat-sysadmin-list-bounces at redhat.com
> > [mailto:redhat-sysadmin-list-bounces at redhat.com] On Behalf Of Herta Van
> den
> > Eynde
> > Sent: Friday, October 26, 2007 4:43 PM
> > To: redhat-sysadmin-list at redhat.com
> > Subject: Re: LVM might have locked me out
> >
> > On 26/10/2007, rchamberland <rchamberland at chs.ca> wrote:
> > >
> > >
> > >
> > >
> > > I'm using RHEL4.  I had a system with RAID1/5 where the RAID 5 disks
> were
> > > uninitialized, so I went into LVM and created some logical volumes out
> of
> > > them.  I didn't know what to mount them to so I set them to mount to /
> > until
> > > I figured that out.  I created the volumes, then locked the machine
> and
> > went
> > > to lunch.
> > >
> > >
> > >
> > > When I came back my password wasn't working, the lock screen won't let
> me
> > > change login, and when I SSH into the machine my root and user
> passwords
> > > aren't being accepted.  Ctl-Alt-F1 gives me a login prompt only, when
> I
> > > enter something it just gives me another login prompt, no password
> > request.
> > >
> > >
> > >
> > > Looks like I messed up.
> > >
> > >
> > >
> > > I'm not sure how to proceed now.  Any suggestions?  I'm not exactly
> sure
> > how
> > > I messed up, but I guess the OS can't find /etc/passwd now? I'm afraid
> to
> > > cold reboot in case it makes the problem worse.
> > >
> > >
> > You might be able to cold boot into single user mode.  If not, cold
> > boot off an installation CD into rescue mode.  In both cases, fix
> > /etc/fstab.
> >
> > Kind regards,
> >
> > Herta
> 
> We've all been newbies, Rob, and given all the products that are out
> there,  most of us are bound to be newbies again at one time or
> another, so just ignore derisive comments made by people who forgot
> what that was like.
> 
> A bit amazed that the rescue boot doesn't see the old filesystems.
> 
> Once you've booted in single user mode, try mounting / in rw mode
> ("mount -o rw xxx", where xxx is whatever device the original / is
> on).  You should then be able to modify fstab.
> 
> If not, keep us posted.
> 
> Kind regards,
> 
> Herta
> 
> P.S. Most lists prefer bottom post replies.  It makes it easier to
> read the problem top-down.
> 
> --
> redhat-sysadmin-list mailing list
> redhat-sysadmin-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-sysadmin-list



So my problem was that I needed to undo the change I made in LVM (where I
stupidly mounted my new volumes to / and this locked me out) but that I
couldn't edit fstab because it was locked.  

It turns out that in "Filesystem Repair" mode everything is read-only.  So
what I did was:

mount -o remount,rw /

Then:

cp /etc/fstab /etc/fstab.bad
cp /etc/fstab.old /etc/fstab
restart -r now

And voila, everything came back up.  In LVM my new volumes are simply
showing as unmounted.

Thank you to Herta, Dongwu and Anil, your suggestions allowed me to take
stock of the situation.  This was a weird problem.

Rob C








More information about the redhat-sysadmin-list mailing list