LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-25-2006, 01:01 PM   #1
cygnus-x1
Member
 
Registered: Jul 2006
Location: Crisfield
Distribution: Slackware, CentOS, RedHat
Posts: 159

Rep: Reputation: 15
external mount of a logical volume


Hey guys. I am new to the LVM that Fedora automatically uses when it installs itself. I am trying to look at a hard disk that is not coming up. I booted off of a SlackWare install CD and I was able to mount the /dev/hda1 (boot partition) but I could not mount the /dev/hda2 (root) partition. When I did fdisk I saw that /dev/hda2 was setup as Linux LVM type. The error I saw on the screen when he was trying to boot was a message about ext3 so i assume that the underlying fs is ext3. So I tried mounting it like this:

mount -t ext3 /dev/hda2 /mnt/steve2

That did not work so I looked into the grub.conf file and found the LVM format

mount -t ext3 /dev/VolGroup00/LogVol00 /mnt/steve2 (I know grasping at straws)

Can anyone help me mount this puppy so I can look at it?
If I get it mounted what can I do to check it out? Will fsck work on an LVM? Any and all help appreciated.

thanks

Doug
 
Old 07-25-2006, 03:03 PM   #2
mjgsantos
LQ Newbie
 
Registered: Jun 2006
Location: São Paulo - Brazil
Posts: 8

Rep: Reputation: 0
Hi,
This is a very boring procedure, but may work:
When you use the logical volume manager, it creates a Volume Group that can have one or more hard disks assigned. Then, it creates a Physical Volume, that may be alocated on one or more disks, and then is created a Logical Volume, that is where the file system will be created a mounted from.
There is one problem: the Linux OS need to know the volume group configuration to be able to mount the filesystem from the /dev/VolGroup00/LogVol00. Try to execute the command vgscan, so it will look for any volume group in the current disks:
Code:
% vgscan
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- found active volume group "notes5prd"
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING: This program does not do a VGDA backup of your volume group
Then, try to execute the command pvdisplay passing the device where the LVM was created (i.e: pvdisplay /dev/hda2). You may run this command in each device displayed on fdisk -l command. This command will show the vg namem if there is any information on the device that you chose.
Finally, run the command vgimport followed by the device(s) that contains any vg information. This will enable the OS to recognize the LVM configuration. If this works, you will be able to execute the vgdisplay command and see the vg status. You will need to run vgchange -a y to enable the volume group, and then you be able to mount the filesystem from this crazy mount point.
AFAIK, fsck works the same way.
Please tell me later if this worked.

Regards.

Last edited by mjgsantos; 07-25-2006 at 03:08 PM.
 
Old 07-26-2006, 03:28 PM   #3
cygnus-x1
Member
 
Registered: Jul 2006
Location: Crisfield
Distribution: Slackware, CentOS, RedHat
Posts: 159

Original Poster
Rep: Reputation: 15
I was able to do a vgscan but I could not do a vgdisplay.
The output of fdisk -l had odd looking device names (not /dev/hda etc)
I still tried using those but was still unable to run it.

When I reboot the kernel loads and the it tries to load the root partition. When it does that I get a bad superblock error. Is this disk bad or can it be wiped and reused?

thanks
 
Old 07-26-2006, 03:51 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
I assume Fedora uses LVM2 (just a guess). Does Slackware have LVM support by default? Is it LVM2?

Assuming you have LVM2 support on your Slackware LiveCD, boot it and try running:
Code:
# pvscan
# vgchange -a y
# pvs
# vgs
# lvs
And post the output here if you need more help. Also, "fdisk -l" output as well.

I suspect the "vgchange -a y" command is your missing link. You need to flag the volume group as "active". Your Slackware LiveCD probably does not know it needs to do this. Your Fedora installation probably does it in one of it's startup scripts.
Quote:
mount -t ext3 /dev/VolGroup00/LogVol00 /mnt/steve2 (I know grasping at straws)
Nothing wrong with this if you've gotten the volume group and logical volume names correct.
 
Old 07-26-2006, 08:38 PM   #5
cygnus-x1
Member
 
Registered: Jul 2006
Location: Crisfield
Distribution: Slackware, CentOS, RedHat
Posts: 159

Original Poster
Rep: Reputation: 15
Actually the Slackware install CD did not have LVM support built into the kernel. So I used a copy of SMART Linux that we had laying around. That did have LVM support but I was still unable to mount anything. I will try your suggestions tomorrow.

But my question still stands ... When you see a messag like bad superblock when you boot does that usually mean a bad disk or a corrupt filesystem?

thanks Doug
 
Old 07-27-2006, 10:56 AM   #6
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
But my question still stands ... When you see a messag like bad superblock when you boot does that usually mean a bad disk or a corrupt filesystem?
This is Fedora giving you this error, not your Slackware LiveCD, right? Just so we're clear.

It could simply mean, e.g., that you're trying to mount an ext3 filesystem but telling mount that it's reiser. This scenerio would be terribly unlikely if it's Fedora's boot sequence that's giving this error (it's fstab would surely know your filesystem types). But not so unlikely if you're trying to manually mount the thing via Slackware and are guessing at a filesystem type.

Filesystem corruption could cause this error too. This corruption may or may not have been caused by a bad disk. You can't say just based on the bad superblock error message. What happened around your place immediately prior to this problem occurring? A power hit? Totally unexpected system crash? Once you get something mounted and can look at your syslog, does it mention anything about read/write/seek disk errors?

Most (?) disk manufacturers have a non-destructive diagnostic utility available on their websites. You can use this to check out your disk. Seagate has one named "SeaTools". You create a bootable floppy or CD with this tool on it and run the test.

BTW, you have alternate superblocks available on your filesystems. If the primary one got corrupted, you might be able to recover from an alternate. Check out the fsck manpage for how to access alternates.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logical Volume recovery plythgam Linux - Software 2 03-27-2006 06:44 PM
how to reduce logical volume LinuxLover Linux - Enterprise 2 10-29-2005 08:26 AM
Logical Volume Management 2 XaViaR Linux - General 5 08-20-2005 07:48 AM
logical volume manager plythgam Linux - Software 1 11-08-2004 10:47 AM
Logical Volume Groups concoran Linux - General 3 06-03-2001 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration