System Recovery

Jarod Wilson jarod at wilsonet.com
Tue Jul 15 14:17:28 EDT 2008


On Tue, 2008-07-15 at 13:42 -0400, Ben Scott wrote:
> On Tue, 2008-07-15 at 11:05 -0400, Labitt, Bruce wrote:
> >> Attempt to read block from filesystem resulted in short read while
> >> trying to open /var.
> 
> On Tue, Jul 15, 2008 at 11:59 AM, Jarod Wilson <jarod at wilsonet.com> wrote:
> > You need to give it a block device, not a file system path. i.e., you
> > need to pass /dev/foo to fsck, not /var.
> 
>   I was wondering about that.  While specifying the block device is
> certainly a good idea, if it was getting confused about what "/var"
> meant, fsck would generally emit a "/var: Is a directory" or "/var:
> Not a block device" sort of error.  The "short read" message implies
> that fsck considered "/var" a mount point and resolved it to a block
> device.  No?

If you're running from the rescue env, I don't think e2fsck knows to
look in /mnt/sysimage/etc/fstab to resolve mount points, and if the
rescue env auto-mounted /var, it would actually be at /mnt/sysimage/var,
so I don't *think* it would work in that situation, but I certainly
could be wrong.

Now, if you're running from the actual system, fsck /mntpoint actually
does definitely do the right thing and resolve to the correct block
device, which admittedly, I didn't realize it did until I just checked
on one of my own RHEL5 boxes here. :)

# df -h /rhel4
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              31G  3.6G   26G  13% /rhel4

# fsck /rhel4
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/dev/sda2 is mounted.  

WARNING!!!  Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)? no

check aborted.



-- 
Jarod Wilson
jarod at wilsonet.com



More information about the gnhlug-discuss mailing list