FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Live in the midwest had recently have had problems with power cutting out, on the most recent power outage I attemtpted to restrat my home server, I'm a nobb, and got the following error
Hint: A UPS is a cheap way to protect against power problems.
Do you have a live CD or, perhaps, your install DVD? Can you boot into rescue mode?
If you can, what's happened is that your journal file was corrupted when your power was lost, and you need to convert your ext3 file system to an ext2 version, run fsck on the ext2 system, and then add the journel file back in to make it an ext3 file system.
What I'd suggest is this:
1) Boot linux rescue from your installation media
2) That should (try to) mount your root file system as /mnt/sysroot (You should see a message suggesting that you chroot if the mount was successful.) If it did mount it successfully, use the umount /dev/mapper/VolGroup00-LogVol00 command to unmount it. Note: The device name used here is the one Fedora uses by default. If you've change it, or if you're not using logical volumes, use the correct device name here and below.
3) Now, see if fsck /dev/mapper/VolGroup00-LogVol00 can fix the problem. If it succeeds, you're "home free."
4) If fsck barfs on the file system, use the command tune2fs -O ^has_journal /dev/mapper/VolGroup00-LogVol00 to remove the journal file.
5) Run fsck /dev/mapper/VolGroup00-LogVol00 again to fix any problems.
6) Run tune2fs -j /dev/mapper/VolGroup00-LogVol00 to recreate the journal file.
None of the suggested methods worked. Going to put in a new hardrive, re-install Fedora and hook up my existing drives. Hope this will salvage my files.
I'm not able to mount the drive in resuce mode, get a message no partions found to mount.
Going to try Samoth method, let you all know how it goes.
Yes I agree power supply would be cheaper then going through this.
First, you don't want the drive mounted. The recovery methods should be done on an unmounted drive.
Second, using the method suggested by Samoth on a "raw" drive will most likely kill and hope of recovering you data, if your data was stored in a logical volume, as it is if you used the Fedora defaults.
When you get the message you reported, you need to run testdisk on the raw drive to recover the partitions. (testdisk should work for logical volumes .) If testdisk is not available in "rescue" mode (and I don't think it ts) then you should download one of the "Live" rescue disks, or something like the Knoppix live dvd which include it.
None of the suggested methods worked. Going to put in a new hardrive, re-install Fedora and hook up my existing drives. Hope this will salvage my files.
First, I really hope that you did not actually try the method suggested by Samoth if you had used the Fedora installation defaults. The problem with his suggestion is that a "logical volume" is not any type of ext file system. (Even the partition type is different.) If you let e2fsck write to a logical volume partition, you're almost guaranteed to kill you data. So, you may be completely sunk. (Note: This is why you need to post as much information as possible when asking for help. With file system problems, this is especially important, since methods for one type of file system may be entirely inappropriate for another type. It is for that reason that I qualified my advice by stating that I was assuming that you'd used the default Fedora installation. I just wish that Samoth had mentioned that his advice only applied if you'd chosen to do your partitioning "by hand," and that you were not using any "logical volumes.")
Again, in what follows I'm assuming that you are using the Fedora default installation settings.
OK, once you've got Fedora installed on the new drive, use yum to install testdisk and foremost.
Then run testdisk on you old drive. If that works, check to see if the "repaired" disk is usable by seeing if you can get your BIOS to boot from it. (See the foremost comments below if the repair is not successful.)<edit> Because of the duplicate name problem discussed below, you may need to physically unplug your new drive to see if the old drive may have been "fixed" by testdisk. Warning: When disconnecting a HD, it is not usually sufficient to just unplug the power. You should remove both the power and the drive cable. That's because an unpowered drive with its cable connected can sometimes draw enough power through the cable to burn out the drive controller. Since the controller is often on your mother board, this can result in a computer with no hard drive, or a visit to your local computer store to buy a new computer.</edit>
If that works, you will have another problem: The new drive and the old drive will contain volume groups with identical names. To access both volume groups at the same time you'll need to rename one of them. I'd suggest renaming the volume group on the old drive, and using your new drive as your boot drive. (Note: You will not be able to boot from the drive after the volume group is renamed because the nash boot script stored in the initial RAM disk hard-codes the volume group name that it activates on boot. That can be changed, but it's not a simple process.)
So boot to your new drive and use the vgchange command to rename the volume group on your old drive. (When I was setting up a secondary Fedora on my USB drive, I called its volume group "Fedora," so that's what is in the code below.) Once you've renamed the volume group, access it like this (changing references to /dev/sda to whatever's appropriate for use, and the /usb stuff to whatever you want to call it.:
Code:
$ cat Scripts/MountUsb
#! /bin/bash
# Mount /dev/sda if it exists
if [ -b /dev/sda ]; then
if ! [ -d /usb ]; then
echo Creating /usb mount point.
sudo mkdir /usb
fi
sudo /sbin/vgchange -a y Fedora
sudo mount -t ext3 /dev/Fedora/LogVol00 /usb
sudo mount -t ext3 /dev/sda3 /usb/boot
else
echo Drive /dev/sda was not found.
fi
Now, if all that works, you should be able to find you old files and copy them into your new drive.
If it didn't work, you may still be able to find and recover something using the foremost tool. The man pages for foremost are fairly complete, so just do a man foremost for usage instructions.
Again, good luck.
Last edited by PTrenholme; 02-28-2007 at 02:18 PM.
Oops, I have never used Fedora so I had no idea that it uses LVM as a default.
Also, I guess I assumed improperly that OP would know that /dev/hda1 applied to non-lvmed filesystems.
A big Sorry!
Yes, I'm a little sensitive to the issue since I blythly ran fsck on a logial volume (a few years ago) and got a poor boat anchor as a result. (Actually, all I had to do was a low-level reformat, and then I had a "new" disk to play with.)
PTrenholme did has you suggested, booted up with the resuce disk and run the commands listed in your post. As I posted earlier when I boot up with rescue disk it will not mount my current drives.
I have not installed a newer drive, will try to work out this issue first, then install the latest version of Fedora.
Answer to your question as far as I know I loaded Fedora with the default device name. As for as using logical volumes I hate to admit to it but I don't know. I first started out with two drives, first drive was an old 30 meg hard drive with one 30 gig hardrive. When I saw I was running out of space I added an 15 gig drive. The drives all "appear" as one large drive.
When I run the first command, fsck /dev/mapper/VolGroup00-LogVol00, I get the following message.
Quote:
Warning couldn't open /etc/fstab: no such file or directory.
When I ran your second command I got the following:
Quote:
fsck.ext2: No such file or directory while trying to open /dev/mapper/VolGroup00-LogVol00
The supper block could not be read or does not describe a correct ext2 file system. If the device is valid and it really contains an ext2 file systerm (and not a 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>.
I did not run Samoths commands or suggestions after I read your post. I have been off line due to the weather, again.
Supposed next step is to determine what my "device" name is? As posted at the start of this thread, I'm a novice at linux, slave to m$.
It sure sounds like the mapper failed to find the drive.
What do you see when you (in linux rescue mode) do a dmsetup ls? Since you're using three drives mapped into one, those should be shown and their mappings. Unless the mapping is done by your BIOS. (I'm puzzled by you statement that
Quote:
I first started out with two drives, first drive was an old 30 meg hard drive with one 30 gig hardrive. When I saw I was running out of space I added an 15 gig drive. The drives all "appear" as one large drive.
since -- as far as I know, the only way to achieve that within Linux is by using the dmsetup command.)
Also, what is shown when you do a fdisk -l?
And, what (if any) output do you see when you run the lvm vgscan --ignorelockingfailure command?
----------
Did/can you get a copy of testdisk? (If not, download a rescue CD. For example, this is the first one listed when I "Googled" "rescue cd." It claims you can run it from a USB RAM stick, and I'm going to try it in a while myself. If it works, it will be handy to have around.)
Once you've got testdisk, try running it on you drive to see what it can do to fix things for you.
Disk /dev/hda 6448 mb
255 heads, 63 sectors/track, 784 cylinders
units=cylinders of 16015*512=8225280 bytes
Device Boot Start End Blocks ID System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 784 6193057 8e Linux LVM
Disk /dev/hdc: 30.0 Gb
255 heads, 63 sectors/track, 3649 cylinders
units=cylinders of 16015*512=8225280 bytes
Device Boot Start End Blocks ID System
/dev/hdc1 * 1 3649 29310561 8e Linux LVM
Disk /dev/hdc: 30.0 Gb
255 heads, 63 sectors/track, 1823 cylinders
units=cylinders of 16015*512=8225280 bytes
Device Boot Start End Blocks ID System
/dev/hdd1 2 1823 14635215 f W95 Ext (LBA)
/dev/hdd5 2 1823 14635183 7 HPFS/NTFS
Based on the output from the last entry I would assume my addition of a new drive was unsuccessfull?
I then ran lvm vgscan with both the --ignorelockingfailure command and without, I got the same results.
Quote:
Found volume group "VolGroup00" using metadata type lvm2
For a repair disk, I have copy of Ultimate Boot CD from http://www.ultimatebootcd.com/
From their websight it lists testdisk but under catogory of partition tools, this look correct to you?
Yes, you can call testdisk a partition tool since its primary purpose is to recover lost/deleted partitions. But it also can attempt (some) repairs on LV partitions.
Anyhow, the vgscandid find your LV. So, after booting into rescue mode, try this:
Code:
vgchange -ay --ignorelockingfailure VolGroup00 # Any errors, stop and let's see what they are
ls /dev/mapper/ # This should list control, VolGroup00-LogVol00 and VolGroup00-LogVol01
e2fsck /dev/mapper/VolGroup00-LogVol00
If that all works, you may have it fixed. If not, and the vgchang and ls did work, try the stuff I first suggested to remove the journal file and recreate it.
Also, did you copy the fdisk output by hand? What you listed shows /dev/hdc twice, but lists the /dev/hdd stuff after second one. (Not a problem, just a minor discrepancy.)
Anyhow, that listing shows three separate drives, hda, hdc, and hdd. Not, as you implied above, a single logical drive made up of hda, hdc, and hdd. (Your third drive, hdd, seems strangely partitioned - it seems to have been set up with an "extended" partition, and that one (hdd5) formatted as an NTFS drive. Is it possible that you've confused an "extended partition" -- which is needed to handle more than 4 "primary" partitions on a drive -- with an "additional" partition? Partitions describe the physical layout of data on the disk drive, whilst, for example, LVM deals with the "logical" organization of those physical parts into usable wholes. [Note: the FAT partition, shown as hdd1, is supposed to overlap the "extended" partition -- as it does in your listing. That's how partitions are extended.])
I don't see any new drive in that listing, and it should have been there if it was connected even if it wasn't yet partitioned.
Yes I copied the information by hand and I should have only listed hdc once. Went back and checked and it should be hda1, hda2, hdc, hdd1 and hdd5. The last two hdd1 & hdd5, this drive come out of a windows machine and no the disk was never 'joined" or formated to be part of my linux machine, my error. Once I get my system back up, will need to do that. This is my "new drive".
When I run vgchange and vgscan in rescue mood from the fedora rescue cd I get a message that the commands not found.
When I run ls /dev/mapper/ all it lists is control it does not list VolGroup00-LogVol00 and/or VolGroup00-LogVol01.
When I run e2fsck /dev/mapper/VolGroup00-LogVol00 returns message no such file or directory.
I ran testdisk but not sure what to do, how far to take it. I have determined that there are two paritions on the frist hard drive and the second parition, hda2, appears with an unknown file type. This is the cause of my problems, correct?
Is there anyway to go after just this parition(?) and bring it back up with the correct file system, ext3? If I reformat just this parition, accept loss of any data on this parition, will this allow my machine to boot up?
Last but not least I am out of my element in dealing with this, going through a rapid learning curve, how would I find a local linux users group?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.