Discussion:
[linux-lvm] disk recovery - mounting external USB lvm2 volume
Allan Wolfe
2007-07-16 01:30:40 UTC
Permalink
I had a motherboard start to throw hardware errors, so I pulled the disk
with FC6 loaded and did away with the computer. I have installed the disk
in a USB drive enclosure and am trying to mount it as a usb drive to pull
the data off onto a new computer. I get the following error when mounting
it:

$ sudo mount -t ext3 /dev/sdb2 /media/other
mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

$ dmesg | tail
sdb: sdb1 sdb2
sd 5:0:0:0: Attached scsi disk sdb
sd 5:0:0:0: Attached scsi generic sg2 type 0
kjournald starting. Commit interval 5 seconds
EXT3 FS on sdb1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Can't find ext3 filesystem on dev sdb2.
VFS: Can't find ext3 filesystem on dev sdb2.

$ sudo fdisk -l -u /dev/sdb

Disk /dev/sdb: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders, total 78140160 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 63 208844 104391 83 Linux
/dev/sdb2 208845 78140159 38965657+ 8e Linux LVM


hald can automatically assisted in mounting /dev/sdb1 (/boot).

I could use some help in understanding how to get the drive mounted since
it was originally an lvm2 volume with ext3 filesystem laid on top of it.
Thanks in advance.
Brian McCullough
2007-07-16 01:40:07 UTC
Permalink
Post by Allan Wolfe
$ sudo mount -t ext3 /dev/sdb2 /media/other
mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Disk /dev/sdb: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders, total 78140160 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 63 208844 104391 83 Linux
/dev/sdb2 208845 78140159 38965657+ 8e Linux LVM
I could use some help in understanding how to get the drive mounted since
it was originally an lvm2 volume with ext3 filesystem laid on top of it.
Allan,

You said it right there. Also, the fdisk output shows you something
too.

As you can see, the disk partition type is "LVM" and, in fact, when
mount looks at that partition to try and determine what file system type
to mount, all it sees is LVM, which mount doesn't understand.

Just before I give you the answer, what were the names of your VG and LV
in the old system? If they conflict with the present system, does it
run LVM disks as well, you will have problems mounting even with what I
tell you.

In any case, if you issue "vgchange -a y" at your command line, the LVM2
system in your current machine will rescan all attached disk-like
devices and find your USB disk's LVM partition. If the name doesn't
conflict with something in your system already, you can then go ahead
and mount the Logical Volumes that are found, just as you tried with the
Physical Volume, /dev/sdb2.

That is a rather short version of the explanation, so if it is "clear as
mud," feel free to ask again, and several people here will be able to
help you with your FC6 system.


Hope that helps,
Brian
Allan Wolfe
2007-07-17 02:28:01 UTC
Permalink
Thanks Brian. This is starting to make sense. The Fedora 7 and the old FC6
both are named the defaults. Here is the result from the vgchange:

$ sudo vgchange -a y
2 logical volume(s) in volume group "VolGroup00" now active
2 logical volume(s) in volume group "VolGroup00" now active

Digging around in the man pages, it looks to me as though I will need to
rename the active/current volume using vgrename command, change the
/etc/fstab to the new name and then follow on with mounting the old volume
using the old default volume.

Am I on the right track? Thanks for your help.
Post by Brian McCullough
Post by Allan Wolfe
$ sudo mount -t ext3 /dev/sdb2 /media/other
mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Disk /dev/sdb: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders, total 78140160 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 63 208844 104391 83 Linux
/dev/sdb2 208845 78140159 38965657+ 8e Linux LVM
I could use some help in understanding how to get the drive mounted
since
Post by Allan Wolfe
it was originally an lvm2 volume with ext3 filesystem laid on top of it.
Allan,
You said it right there. Also, the fdisk output shows you something
too.
As you can see, the disk partition type is "LVM" and, in fact, when
mount looks at that partition to try and determine what file system type
to mount, all it sees is LVM, which mount doesn't understand.
Just before I give you the answer, what were the names of your VG and LV
in the old system? If they conflict with the present system, does it
run LVM disks as well, you will have problems mounting even with what I
tell you.
In any case, if you issue "vgchange -a y" at your command line, the LVM2
system in your current machine will rescan all attached disk-like
devices and find your USB disk's LVM partition. If the name doesn't
conflict with something in your system already, you can then go ahead
and mount the Logical Volumes that are found, just as you tried with the
Physical Volume, /dev/sdb2.
That is a rather short version of the explanation, so if it is "clear as
mud," feel free to ask again, and several people here will be able to
help you with your FC6 system.
Hope that helps,
Brian
_______________________________________________
linux-lvm mailing list
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Brian McCullough
2007-07-17 03:12:15 UTC
Permalink
Post by Allan Wolfe
Thanks Brian. This is starting to make sense. The Fedora 7 and the old FC6
$ sudo vgchange -a y
2 logical volume(s) in volume group "VolGroup00" now active
2 logical volume(s) in volume group "VolGroup00" now active
Digging around in the man pages, it looks to me as though I will need to
rename the active/current volume using vgrename command, change the
/etc/fstab to the new name and then follow on with mounting the old volume
using the old default volume.
Am I on the right track? Thanks for your help.
Yes, you are. However, I recommend that you plan every step carefully,
so that you don't wind up with an unbootable system. Make sure that you
have renamed the "local" LVM volumes, the fstab entries and anything
that might depend on those names. ( some things can break, but you had
better make sure that you can boot -- by the way, what do the entries in
grub.conf refer to? )



Brian
Allan Wolfe
2007-07-18 01:41:41 UTC
Permalink
Yes. The grub.conf does refer to the logical volume. I also see
/etc/blkid/blkid.tab which looks like it is built at boot time (kudzu?).

Thanks for the advise. Before doing anything, I'll back up what is
sacred;-)
Post by Allan Wolfe
Post by Allan Wolfe
Thanks Brian. This is starting to make sense. The Fedora 7 and the old
FC6
Post by Allan Wolfe
$ sudo vgchange -a y
2 logical volume(s) in volume group "VolGroup00" now active
2 logical volume(s) in volume group "VolGroup00" now active
Digging around in the man pages, it looks to me as though I will need to
rename the active/current volume using vgrename command, change the
/etc/fstab to the new name and then follow on with mounting the old
volume
Post by Allan Wolfe
using the old default volume.
Am I on the right track? Thanks for your help.
Yes, you are. However, I recommend that you plan every step carefully,
so that you don't wind up with an unbootable system. Make sure that you
have renamed the "local" LVM volumes, the fstab entries and anything
that might depend on those names. ( some things can break, but you had
better make sure that you can boot -- by the way, what do the entries in
grub.conf refer to? )
Brian
_______________________________________________
linux-lvm mailing list
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Bryn M. Reeves
2007-07-18 10:30:12 UTC
Permalink
Post by Allan Wolfe
Yes. The grub.conf does refer to the logical volume. I also see
/etc/blkid/blkid.tab which looks like it is built at boot time (kudzu?).
The /etc/blkid/blkid.tab file is the libblkid persistent device cache.
It's used by the blkid command and other users of the library (e.g.
e2fsprogs). It's always validated prior to use and is indexed by UUID,
label etc, so there's no need to worry about updating it when device
nodes change.

Kind regards,
Bryn.
Allan Wolfe
2007-07-31 14:29:03 UTC
Permalink
Thanks Bryn for the added info.

I finally wound back around to finish the renaming of my local volume name.
It was successful after figuring out that the lvm commands are packaged as
the single "lvm" command on the Fedora Rescue CD. I also discovered that
the initrd had to be expanded and modified and repacked. There was a
reference there as well.

Thanks for your help.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Allan Wolfe
Yes. The grub.conf does refer to the logical volume. I also see
/etc/blkid/blkid.tab which looks like it is built at boot time (kudzu?).
The /etc/blkid/blkid.tab file is the libblkid persistent device cache.
It's used by the blkid command and other users of the library (e.g.
e2fsprogs). It's always validated prior to use and is indexed by UUID,
label etc, so there's no need to worry about updating it when device
nodes change.
Kind regards,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFGneu06YSQoMYUY94RAg2oAKCABfby/SZtrOyLZ8zTZcr1FdKzjwCgj9Tn
Z9Axek7SWivOMiBbSYxOjCs=
=ySEM
-----END PGP SIGNATURE-----
_______________________________________________
linux-lvm mailing list
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Loading...