Posted on 2006-05-08
Last Modified: 2010-04-20
OS is FC3.
In my home user contained deleted data wich I want to restore.

After typing :  telinit -s

I type :           lvmdiskscan
/dev/hda       [149.05 GB]
/dev/hda1     [101.94 MB]
/dev/hda2     [148.95 GB]  LVM physical volume
1 disk
1 partition
0 LVM physical volume whole disks
1 LVM Physical volume

My home is on /dev/hda2

I type :        e2fsck -b 8193 /dev/hda2
                  fsck.ext3 -vc -b 8193 /dev/hda2

I have as result:       ...
                  Bad magic number in super-block while trying to open /dev/hda2

How can I resolve this problem? Is anybody have a solution for me? it is very important for me.

Question by:blanom
    LVL 19

    Expert Comment

    you have an entry for /dev/hda and /dev/hda2 which looks a little strange.

    I would have thought /dev/hda would have been the whole disk but the numbers don't add up (unless I'm misunderstanding something here!)

    You shouldn't fsck the lvm partition, what do your lvm partitions get mounted as? A look at /etc/fstab may help here, also use vgdisplay!

    Can you post back you fstab on this group?

    My output is as follows;
    # lvmdiskscan
      /dev/hde1 [      199.80 MB]
      /dev/hdg1 [      152.66 GB] LVM physical volume
      /dev/hde2 [        9.77 GB]
      /dev/hde3 [        1.00 GB]
      /dev/hde5 [       19.53 GB]
      /dev/hde6 [        4.88 GB]
      /dev/hdf1 [       13.98 GB]
      /dev/hdf2 [        1.44 GB]
      /dev/hdf3 [       22.74 GB]
      0 disks
      8 partitions
      0 LVM physical volume whole disks
      1 LVM physical volume

    My fdisk output looks like this;
    # fdisk -l

    Disk /dev/hde: 40.0 GB, 40020664320 bytes
    16 heads, 63 sectors/track, 77545 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/hde1   *           1         406      204592+  83  Linux
    /dev/hde2             407       20723    10239768   83  Linux
    /dev/hde3           20724       22804     1048824   82  Linux swap / Solaris
    /dev/hde4           22805       77545    27589464    f  W95 Ext'd (LBA)
    /dev/hde5           22805       63439    20480008+  83  Linux
    /dev/hde6           63440       73598     5120104+  83  Linux

    Disk /dev/hdf: 40.9 GB, 40982151168 bytes
    255 heads, 63 sectors/track, 4982 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/hdf1   *           1        1825    14659281   83  Linux
    /dev/hdf2            1826        2013     1510110   82  Linux swap / Solaris
    /dev/hdf3            2014        4982    23848492+  83  Linux

    Disk /dev/hdg: 163.9 GB, 163928604672 bytes
    255 heads, 63 sectors/track, 19929 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/hdg1   *           1       19929   160079661   8e  Linux LVM


    Author Comment

    OS FC3
    I let FC3 to do the partitions during  OS installation
    You said device entries are little strange. I don't know I am a newbie

    As follows my outputs

    # lvmdiskscan
    /dev/hda       [149.05 GB]
    /dev/hda1     [101.94 MB]
    /dev/hda2     [148.95 GB]  LVM physical volume
    1 disk
    1 partition
    0 LVM physical volume whole disks
    1 LVM Physical volume

    #fdisk -l
    Disk /dev/hda:160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 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                 19457       156183930         8e              Linux LVM

    #cat /etc/fstab
    #this file is edited by fstab-sync - see 'man fstab-sync' for details
    /dev/VolGroup00/LogVol00           /                             ext3                 defaults                   1     1
    LABEL=/boot                               /boot                       ext3                 defaults                   1     2
    none                                          /dev/pts                   devpts              gid=5, mode=650    0     0
    none                                          /dev/shm                 tmpfs               defaults                   0     0
    none                                          /proc                       proc                 defaults                   0     0
    none                                          /sys                         sysfs                defaults                   0     0
    /dev/VolGroup00/LogVol01          swap                        swap                defaults                  0     0
    LVL 19

    Expert Comment


    So lets go thru this bit by bit as I think I may have been a little confused....

    You deleted some data and you are trying to get it back. To get it back you tried using telinit and fsck and you say your /home partition is on /dev/hda2 which is quite right but it's part of a logical volume.

    I think there is a little confusion here, I've no idea why you used telinit but fsck is use to fix filesystems, not recover data. Check out the man pages for more information.

    On the other hand, the error you got from fsck was indeed correct, there is no filesystem on /dev/hda.

    Did you backup your data? I'm guessing not in which case you may have learned about the importance of backups the hard way, I think most of us have been there, done that!

    As hard as it may be to understand, the likelyhood of you getting your lost file(s) back is low.....extreemely low or in fact...nil! If you're using just a basic system which I believe you are then the file(s) may well have gone for good.

    If you removed the files by dragging them to the trash on the X desktop then you may be in luck (open the trash and see).

    Let me know how you get on.


    Author Comment

    Thanks Jools

    What I have done exactly. On machine A under my /home/user/ I have some folders (our current jobs), on machine B My backup.

    I used Nautilus to browse folders and make copie and paste.  My fault is I copied the backup and paste on the current job. I seen it too late when all folders are deleted.  I have seen in the trash but I have nothing.

    I want to repair it recovery block but my knowing is  too small. I try to recover it with  Stellar Phoenix Linux but it is too long. It is the reason that my reply is late.

    My backup is only 2 days late. I prefer restore the backup and forget hard recovery and last job.
    Now I try to configure  rsync to make local host backup. rsync local local is working. Connection is refused when I try running rsync local host.
    Maybe I need to configure firewall and open 873 port.

    Thanks about help.
    LVL 19

    Accepted Solution

    OK, forget about repairing the filesystem, there is nothing wrong with it.

    If you need to restore the files can you just use scp?

    Perhaps something like the following could be used to copy a file called /home/user/backup.file from your machineB to the local system (machineA). You would obviously substitute the relevant parts to make it work in your setup.
         Login to machine A!

         # scp root@machineB:/home/user/backup.file /home/user/backup.file

    If you want to use rsync you will need to make sure the services are working on both systems (that could be another question entirely), to get your file back quickly scp will do the job with less hassle.



    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now