LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 01-05-2007, 09:04 PM   #1
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Rep: Reputation: 15
New install on new hard drive messed up old install of old hard drive.


I bought a new SATA 500GB drive. Had a 120GB IDE w/ FC5. Decided to install FC6 on the new drive and use the IDE as a backup.
I ran the FC6 boot install disk. Told it to leave hda alone and install on sda. It started installing. After an hour of no status bar movement and the mouse had gone dead I rebooted the machine and redid the install. Install options same as above, installed correctly. Updated FC6, configured, got it cozy. Then tried to mount hda so I could pull all my files off.
Can't mount it.
Quote:
# mount /dev/hda2 /mnt/hda
mount: you must specify the filesystem type
# fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 14593 117113850 8e Linux LVM

Disk /dev/sda: 500.1 GB, 500106780160 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM
I'm not sure what fs type LVM is, so I move on to try and boot into FC5 on the hda and burn the data to DVD. Slow, but at least I know how to do it.
I then reboot the machine booting the hda. I get a kernel panic. It's trying to load fc5 so I know something must still be there. Says something about can't find the Volgroup00.

I start freaking. All my data on the drive is precious.
I sifted thru the forums, found a post that suggested testdrive and foremost. Run testdrive, not sure of what any of it's output means. Ran foremost and it's finding some of the files. Not all of them, because the foremost.conf is the default. So I know my data is there.

I can boot into the new FC6 on the sda fine.

But how do I get it to mount?
 
Old 01-06-2007, 01:03 AM   #2
shorty943
Member
 
Registered: Dec 2006
Location: Tailem Bend. South Australia
Distribution: Mandriva 2006
Posts: 124

Rep: Reputation: 15
# mount /dev/hda2 /mnt/hda
mount: you must specify the filesystem type
# fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 14593 117113850 8e Linux LVM



Try this.
#mount /dev/hda2 /mnt/hda 83 rw auto.

this should mount the drive as type 83(Linux native) in read/write mode automatically, if you append the lines to /etc/fstab (file sys table)

#mount /dev/hda2 /mnt/hda 83 rw

this should at least mount the drive, so you can work on it. type "man mount" at a terminal to get a list of all options for the mount command

LVM is Logical Volume Management, don't use it myself, so can't be of more help there, sorry.

Hope this helps.

Shorty943.
 
Old 01-06-2007, 08:03 PM   #3
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Original Poster
Rep: Reputation: 15
I appreciate the reply. But that doens't seem to work.
I did:
#mount /dev/hda2 /mnt/hda 83 rw auto
and it just gave me the help info for mount. I also ran man mount and didn't see anything about mounting a fs by number.

Any other ideas?
 
Old 01-06-2007, 08:30 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Since you didn't change /dev/hda except for the MBR, you may be able to create a boot entry to boot the system on the IDE drive instead. Since you use grub, try using the grub shell; press [ESC] instead of a boot menu item to see your options. Using the auto-completion feature of the grub shell, you may be able to find the old /boot partition, and load in the old menu.lst file.

There are around a dozen programs dealing with LVM volumes:
Code:
FILES
       /etc/lvm/lvm.conf
       $HOME/.lvm_history

SEE ALSO
       clvmd(8), lvchange(8), lvcreate(8), lvdisplay(8), lvextend(8), lvmchange(8), lvmdiskscan(8),  lvreduce(8),  lvremove(8),  lvre‐
       name(8),  lvresize(8),  lvs(8),  lvscan(8),  pvchange(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvs(8), pvscan(8),
       vgcfgbackup(8), vgchange(8), vgck(8), vgconvert(8), vgcreate(8), vgdisplay(8),  vgextend(8),  vgimport(8),  vgmerge(8),  vgmkn‐
       odes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8), readline(3), lvm.conf(5)
Moving the volume members from your old system to your new one may be an option. The easiest thing to do is probably to copy old menu.lst and /etc/fstab file so you can either add a boot option for the old system, or be able do mount your old systems LVM filesystem under /mnt on your new system.

Also check if your Fedora Core's GUI partitioner program can recognize the old volume. You may be able to to use it to create a mount point and add entries in /etc/fstab for it.
 
Old 01-06-2007, 08:59 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,030

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Whoa, whoa, whoa. I don't think any of the replies here are from people that know what LVM is and how to use it. Sorry, no insults intended by that statement, it's just that the advice so far is all wrong!

You do not mount an LVM partition directly. You mount the logical volumes that are contained within LVM.

Do the following and we can probably help you out:
Code:
Boot to your new Fedora install on your new drive
Grab a terminal window
su to root (or sudo if you prefer)
Copy/paste the output of the following commands:
  pvscan
  vgchange -a y
  vgs
  lvs
  ls /dev/mapper
  cat /etc/fstab
Post all the output you obtained above to this thread
Then we can tell you the mount command(s) you will need
Your data on /dev/hda should be just fine. You're just not accessing it correctly.

[edit]Added the vgchange command that I originally forgot to type in[/edit]

Last edited by haertig; 01-06-2007 at 09:01 PM.
 
Old 01-06-2007, 09:19 PM   #6
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,030

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
p.s. - I'm thinking that your old FC5 install created an LVM volume group named "VolumeGroup00" and so did your new FC6 install. To be honest, I'm surprized that you were able to boot into your new FC6. LVM could very easily have gotten confused if indeed you have two volume groups with the same name, and Fedora puts the root filesystem on LVM by default. But it appears that you lucked out, and it picked the correct volume group to boot FC6 with. We may have to rename a volume group to access the data if it turns out you have two with the same name. I would expect LVM to get itself confused otherwise, but maybe it'll figure it all out without additional help. Renaming a volume group is not difficult, but in your situation with Fedora having the root filesystem on LVM, you might need to boot with a LiveCD to do it. If you don't already have Knoppix 5 burned to a CD, I'd recommend doing that. Knoppix 4 does not have LVM2 support (only LVM1), so you'll want version 5.
 
Old 01-06-2007, 09:45 PM   #7
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Original Poster
Rep: Reputation: 15
Here's the output from those commands you listed.

[root@absolutemonkey ~]# pvscan
PV /dev/sda2 VG VolGroup00 lvm2 [465.66 GB / 32.00 MB free]
Total: 1 [465.66 GB] / in use: 1 [465.66 GB] / in no VG: 0 [0 ]
[root@absolutemonkey ~]# vgchange -a y
2 logical volume(s) in volume group "VolGroup00" now active
[root@absolutemonkey ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 2 0 wz--n- 465.66G 32.00M
[root@absolutemonkey ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy%
LogVol00 VolGroup00 -wi-ao 463.69G
LogVol01 VolGroup00 -wi-ao 1.94G
[root@absolutemonkey ~]# ls /dev/mapper
control VolGroup00-LogVol00 VolGroup00-LogVol01
[root@absolutemonkey ~]# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0



I am so happy that there seems to be hope. I've been stressing about this extrememly. I had a suspicion that the LVM had done what you mentioned, but I don't know enough about it to be sure or where to even begin to figure it out. That's why I figured if I just booted to the IDE drive (the old drive and old install) I could get my data off.
So how exactly do I rename them?
Also, I am in the process of cleaning another IDE drive (same size as the other) and was going to dd them so I could work on a copy instead. Is this a nessacary precaution?

Again, many thanks for your help.
 
Old 01-06-2007, 10:32 PM   #8
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Original Poster
Rep: Reputation: 15
Ok, so I've got a copy of knoppix 5.1.1
Awaiting your advice.
 
Old 01-07-2007, 02:23 AM   #9
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,030

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Sorry, I was out for a bit (the wife played a hockey game and then we went out ot eat with the team).

In the output you posted, the first part - the pvscan, I am NOT seeing /dev/hda2 as I'd expect. This may be because you have duplicate volume group names. That's a guess, I can't say for sure.

What I want to see is your pvscan return TWO physical volume listings, one on /dev/sda2 and one on /dev/hda2. The /dev/hda2 is missing at the moment. I'm not exactly sure why, so we'll just have to try some different diagnostic things and see if it will show up.

I would try booting with your Knoppix CD rather than your FC6 harddisk installation. From there, open a terminal window, su to root, and run the pvscan. Do you see physical volumes listed on both /dev/hda2 and /dev/sda2? If not, we could have some conflicting name thing. I'm beginning to wonder if this is the case or not. I would think that pvscan would list them both, even with conflicting volume group names, and issues wouldn't come up until you tried to access one. But I'm still guessing and we need to get some solid evidence first.

If you did NOT see two physical volumes listed, I would shutdown the computer (full powerdown), and disconnect your new 500Gb drive. Then boot Knoppix again, run pvscan, and see if NOW it sees that physical volume on /dev/hda2. Until we can figure out how to see that thing, we won't get very far. If you DO see it now, try the vgs and lvs commands and write down the volume group name (it's probably "VolumeGroup00") and the logical volume names (they are probably "LogVol00" and "LogVol01").

If you still don't see pvscan returning anything for /dev/hda2, run "fdisk -l" and make sure THAT command sees /dev/hda. If not, shutdown and check all your cables to the disk (both the IDE cable abd the power connector). You didn't switch any master/slave jumpers on hda when you instralled sda, did you?

Try this stuff, post the results, and I'll think on your predicament a little further. I'll probably hit the bed pretty soon, so I'll check back here tomorrow morning.

If you want to get a leg up on where I might be going with the volume renaming (if indeed this will be required), check out the "LVM HowTo". It contains some pretty decent documentation on all this LVM stuff. Find the HowTo at:

http://tldp.org/HOWTO/LVM-HOWTO/

If you data is really important to you, my first recomendation is DON'T PANIC! If you start writing stuff to your old disk /dev/hda, you could make a mess. Don't procede without some kind of plan. Blind stabs in the dark are useless, and potentially harmful.
 
Old 01-07-2007, 05:25 PM   #10
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Original Poster
Rep: Reputation: 15
Here's the output from knoppix. I ended up putting in a hdb to backup hda to. But I'll take hdb and sda out and boot into knoppix.

root@Knoppix:/ramdisk/home/knoppix# pvscan
Found duplicate PV QOHzZoiZAasg55ySVxfaw3MB0oF6UOZs: using /dev/hdb2 not /dev/hda2
PV /dev/sda2 VG VolGroup00 lvm2 [465.66 GB / 32.00 MB free]
PV /dev/hdb2 lvm2 [111.69 GB]
Total: 2 [577.34 GB] / in use: 1 [465.66 GB] / in no VG: 1 [111.69 GB]

root@Knoppix:/ramdisk/home/knoppix# fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 14593 117113850 8e Linux LVM

Disk /dev/hdb: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 14816 118905097+ 83 Linux
/dev/hdb3 14817 14946 1044225 82 Linux swap / Solaris

Disk /dev/sda: 500.1 GB, 500106780160 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM
 
Old 01-07-2007, 06:23 PM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
This could be a simpler solution to all these.

You have two disks hda and sda (from the initial setup any way) and the systems are both Fedora. That mean both run Grub and pressing "c" key at the booting screen drops you into a Grub prompt.

In a Grub prompt you can boot the first system by
Code:
root (hd0,0)
configfile /grub/grub.conf
and the second system by
Code:
root (hd1,0)
configfile /grub/grub.conf
You can look at the how Grub boot the two system by displaying the grub.conf by grub command
Code:
cat (hd0,0)/grub/grub.conf
cat (hd1,0)/grub/grub.conf
If you have any trouble of booting it just follow the instruction in the relevant /grub/grub.conf to boot the system manually. To boot a system manually you need to add a "boot" statement which serves as a grren light for Grub to fire up the Linux. "boot" is only unncessary if you use "configfile" command.

If you can boot it would you still have a need to mount the LVM?

I have assumed two different LVM can exit together in a box and the kernel can find either one. Don't use LVM myself.

Last edited by saikee; 01-07-2007 at 06:35 PM.
 
Old 01-07-2007, 06:24 PM   #12
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,030

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
It appears that Knoppix is seeing everything. pvscan reports PV's on sda as well as a duplicated PV on hda and hdb. This is good. Since you evidently cloned hda to hdb, that explains the duplicate PV warning coming from the pvscan command.

You don't need to disconnect sda. You should disconnect hda, and leave the cloned hdb in place. We will pull your old data off of the hdb clone, and copy it over to sda.
Now boot Knoppix, and run pvscan followed by vgchange -a y. Then run vgs and lvs and ls /dev/mapper. Post their outputs here.

I'm heading out to a dinner with the relatives now (yes, eating out AGAIN!), so it will be later tonight before I can check back here.

p.s. - Now that Knoppix is seeing your PV ("physical volume") on hda (and also on the hdb clone), you're moving into the home stretch. I have high hopes that your data is just fine. You are smart to clone hda to hdb for safety. I don't think we'll be doing any destroying of your original data on hda, but it never hurts to be prepared for the worst scenerio and have a backup handy!

Last edited by haertig; 01-07-2007 at 06:26 PM.
 
Old 01-07-2007, 08:26 PM   #13
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Original Poster
Rep: Reputation: 15
Disconnected the sda and the hdb. Here's the output w/ just the hda connected.
root@Knoppix:/ramdisk/home/knoppix# pvscan
PV /dev/hda2 lvm2 [111.69 GB]
Total: 1 [111.69 GB] / in use: 0 [0 ] / in no VG: 1 [111.69 GB]

I just read your response. I'll shutdown and reconnect the sda, hdb and disconnect the hda. And I'll post the outputs.
 
Old 01-07-2007, 09:01 PM   #14
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Original Poster
Rep: Reputation: 15
Ok here's the output with sda and hdb connected.

root@Knoppix:/ramdisk/home/knoppix# pvscan
PV /dev/sda2 VG VolGroup00 lvm2 [465.66 GB / 32.00 MB free]
PV /dev/hdb2 lvm2 [111.69 GB]
Total: 2 [577.34 GB] / in use: 1 [465.66 GB] / in no VG: 1 [111.69 GB]
root@Knoppix:/ramdisk/home/knoppix# vgchange -a y
2 logical volume(s) in volume group "VolGroup00" now active
root@Knoppix:/ramdisk/home/knoppix# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 2 0 wz--n- 465.66G 32.00M
root@Knoppix:/ramdisk/home/knoppix# lvs
LV VG Attr LSize Origin Snap% Move Log Copy%
LogVol00 VolGroup00 -wi-a- 463.69G
LogVol01 VolGroup00 -wi-a- 1.94G
root@Knoppix:/ramdisk/home/knoppix# ls /dev/mapper
VolGroup00-LogVol00 VolGroup00-LogVol01 control


Thanks a mil, I really really appreciate this.
 
Old 01-07-2007, 10:41 PM   #15
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,030

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
pvscan is seeing the physical volume (PV) on hda2, but pvscan's output is not listing any volume groups (VG's).

So I think you should now run vgscan to see if it can find any VG's. I thought the vgs command would take care of this searching task, but I'm not seeing that. So I was probably incorrect in my assumption. Sorry about that.

Why don't you run pvscan, vgscan, and then lvscan from Knoppix and report back.

Sorry for all this "do over". I should have asked you to run the "full" commands (pvscan, vgscan, and lvscan) from the beginning. The "short" commands (pvs, vgs, lvs) usually tell me all I need to know about my system, but them I have a working LVM system and unfortunately you do not (at the moment). Again, sorry about that. I use the shorter commands 99% of the time and out of habit, I recommended those to you.

I about freaked when I saw your pvscan reporting the PV but with no VG's in it. That wouldn't necessarily be a good thing (we're talking possible meta-data recovery being needed). But I think (hope!) the real problem is simply that you need to run vgscan. Let's try that, and I'll try not to panic myself waiting for you to repost! ;-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Hard drive has been messed up by partitioning Battle Bott Linux - Newbie 3 12-14-2006 10:47 PM
Install lilo and install cd on 2nd hard drive seanfc Linux - Hardware 0 07-04-2006 04:28 AM
hard drive install? FuriousGibbon Fedora 1 08-18-2005 09:46 PM
Hard Drive Messed Up!! ricky333 Linux - Hardware 5 08-12-2005 11:31 PM
Red Hat 7 install on hard drive using ULTRA100 drive fbwr75215 Linux - Software 4 04-15-2001 10:26 PM


All times are GMT -5. The time now is 03:44 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration