LinHES Forums
http://forums.linhes.org/

lvm crash
http://forums.linhes.org/viewtopic.php?f=6&t=18186
Page 1 of 2

Author:  rkshack [ Fri Apr 18, 2008 10:34 pm ]
Post subject:  lvm crash

Everything was working well with my system. Last night my system froze. I rebooted today and I got a message to run fsck. I ran it. I rebooted the computer again and I can not access my lvm that I had set up. I had /dev/vg/myth mounted to myth. Nothing is there currently. I have looked in lvm with lvdisplay etc and the computer sees the logical volume. Help I am not sure where to go next.

Rkshack

Author:  tjc [ Fri Apr 18, 2008 10:38 pm ]
Post subject: 

Have you tried the recreate_lvm.sh script? It's nondestructive and should do everything needed if the VGs are just not being recognized.

Also see the disaster recovery pages on the wiki for more things to try.

Author:  rkshack [ Fri Apr 18, 2008 11:15 pm ]
Post subject: 

This is what I got with the command:




Reading all physical volumes. This may take a while...
Found volume group "vg" using metadata type lvm2
Unmounting drives
Fixing up /etc/fstab
Restoring /dev/vg/myth
1 logical volume(s) in volume group "vg" now active
Shutting down LVM Volume Groups...
0 logical volume(s) in volume group "vg" now active
Setting up LVM Volume Groups...
Reading all physical volumes. This may take a while...
Found volume group "vg" using metadata type lvm2
1 logical volume(s) in volume group "vg" now active
mount: you must specify the filesystem type
Setting LVM to start on boot.
System startup links for /etc/init.d/lvm already exist.


How do I specify the filesystem type?

rkshack

Author:  cliffsjunk [ Sat Apr 19, 2008 2:45 am ]
Post subject: 

When mount says that you must specify a file system type it usually
means that the automatic fs type detection is failing and that usually
means that the file system is badly broken.

I would run fsck on it before mounting it by shutting down with
a reboot and a forced fsck at startup thus:
Code:
shutdown -rF now


You can tell mount to mount an ext3 fs with the -t parameter thus:
Code:
mount -t ext3 /dev/mapper/vg  /myth


Cliff

Author:  rkshack [ Sat Apr 19, 2008 7:58 am ]
Post subject: 

When I type in:

mount -t ext3 /dev/mapper/vg /myth

I get:

mount: special device /dev/mapper/vg does not exist

I entered

mount -t ext3 /dev/vg/myth /myth

and I get:
mount: wrong fs type, bad option, bad superblock on /dev/vg/myth,
missing codepage or other error

What am I doing wrong?

rkshack

Author:  rkshack [ Sat Apr 19, 2008 9:11 am ]
Post subject:  changed auto to ext3

I changed auto to ext3 in fstab. Now I get the below error in fsck log:


fsck 1.40-WIP (14-Nov-2006)
fsck.ext3: Bad magic number in super-block while trying to open /dev/vg/myth
/dev/vg/myth:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

fsck died with exit status 8


I have not tried e2fsck yet.

rkshack

Author:  tjc [ Sat Apr 19, 2008 10:02 am ]
Post subject: 

Well unless you formatted it as xfs or jfs then that is the best hope.

BTW - If you created the FS with large file options (sparse super blocks and such) you may need to do a little math to locate the backup super blocks, mostly just multiplying by the appropriate power of 2.

Author:  rkshack [ Sat Apr 19, 2008 10:11 am ]
Post subject: 

I used
e2fsck /dev/sda -nf

and got:
e2fsck: Device or resource busy while trying to open /dev/sda
Filesystem mounted or opened exclusively by another program?


I do not have sda mounted. I went ahead and tried to umount it anyway and nothing happened. How do I stop whats accessing it.

Rkshack

Author:  tjc [ Sat Apr 19, 2008 10:18 am ]
Post subject: 

Eeek! DON'T DO THAT! /dev/sda is the whole raw disk!

You want to run it on the partition or in this case LVM volume which contains the file system (/dev/mapper/vg-myth).

How did you format the LVM when you created it? If you used 4k blocksize try:
Code:
e2fschk -b 32768 /dev/mapper/vg-myth

Author:  rkshack [ Sat Apr 19, 2008 11:20 am ]
Post subject: 

tjc wrote:
Eeek! DON'T DO THAT! /dev/sda is the whole raw disk!

You want to run it on the partition or in this case LVM volume which contains the file system (/dev/mapper/vg-myth).

How did you format the LVM when you created it? If you used 4k blocksize try:
Code:
e2fschk -b 32768 /dev/mapper/vg-myth


I used the -n so I don't think I would cause a problem. What determines -b number to use? How do I know if I used the 4k blocksize?

rkshack

Author:  RacerX [ Sat Apr 19, 2008 11:25 am ]
Post subject: 

Check out this page it explains a lot about superblock

http://www.bellevuelinux.org/superblock

good luck

Author:  tjc [ Sat Apr 19, 2008 12:26 pm ]
Post subject: 

rkshack wrote:
I used the -n so I don't think I would cause a problem.

It shouldn't, and it's not what I was talking about. The bad device name was what inspired the "yikes!" reaction.
rkshack wrote:
What determines -b number to use? How do I know if I used the 4k blocksize?

Look at your installation notes? Revisit the directions you followed? If all else fails you can probably just hunt for it trying the various recommended offsets. The magic number checking should minimize the chances of finding a bogus one that way, but it's worth doing the research first.

OBTW - If you haven't looked at the e2fsck manual pages yet it's highly recommended: "man e2fsck" or search for an on-line version with Google. There's lots of good information out there if you look.

Author:  rkshack [ Sat Apr 19, 2008 12:42 pm ]
Post subject: 

e2fsck worked. Thank you for all the help. Sorry for the ignorance.

rkshack

Author:  tjc [ Sat Apr 19, 2008 1:02 pm ]
Post subject: 

Excellent! This might be worth adding to the disaster recovery pages on the wiki. Start with a description of the symptoms, then the diagnostic and recovery steps. (recreating the LVM and running e2fsck with the -b option?)

Thanks!

Author:  rkshack [ Sat Apr 19, 2008 4:30 pm ]
Post subject: 

I spoke too soon. My computer now starts up fine and I can access /myth without difficulty. My problem now is that recordings are all missing. They are still in /myth/tv. Pretty directory is empty and when I open recorded shows from within mythtv it says there are no recordings.

Rkshack

Page 1 of 2 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/