0

To keep the story short, i am taking the easy way out and now trying to mount a partition to recover a few text documents. I tried to 'sudo mount -t ext4 /dev/sda4 /mnt' but received this error

sudo mount -t ext4 /dev/sda4 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sda4,
       missing codepage or helper program, or other error

Right now im running off a live usb trying to mount what i believe is a lvm volume of /dev/sda4 ? also known as /dev/fedora/home ?

a bad superblock seems to keep comming up when i tried to mount other times/fsck , and the gparted check finds nothing.

I'm new to linux too so you may have to speak english :).

Update

This is the output of attempting to pvscan, vgscan,pvs, and sfdisk -l /dev/sda

lvm> pvscan
  PV /dev/sda5   VG fedora   lvm2 [76.14 GiB / 76.14 GiB free]
  Total: 1 [76.14 GiB] / in use: 1 [76.14 GiB] / in no VG: 0 [0   ]
lvm> lvdisplay
lvm> vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "fedora" using metadata type lvm2
lvm> pvs
  PV         VG     Fmt  Attr PSize  PFree
  /dev/sda5  fedora lvm2 a--  76.14g 76.14g

sudo /sbin/sfdisk -l /dev/sda

Disk /dev/sda: 30401 cylinders, 255 heads, 63 sectors/track
sfdisk: Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units: cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1          0       -       0          0    0  Empty
/dev/sda2          0       -       0          0    0  Empty
/dev/sda3   *  20397+  20461-     64-    512000   83  Linux
/dev/sda4      20461+  30401-   9941-  79845376    5  Extended
/dev/sda5      20461+  30401-   9941-  79844352   8e  Linux LVM

Nothing was found in the /dev/mapper except control, live-base, live-osimg-min, live-rw. And a lvscan will output nothing.

Update #2

So i went and cat /etc/lvm/backup/fedora with this output

# Generated by LVM2 version 2.02.111(2) (2014-09-01): Wed Feb 11 11:45:07 2015

contents = "Text Format Volume Group"
version = 1

description = "Created *after* executing 'pvscan --cache --activate ay 8:5'"

creation_host = "localhost"     # Linux localhost 3.17.4-301.fc21.x86_64 #1 SMP Thu Nov 27 19:09:10 UTC 2014 x86_64
creation_time = 1423673107      # Wed Feb 11 11:45:07 2015

fedora {
        id = "5oQmMp-dekm-xr3i-KTRf-999c-HSgj-BArhBv"
        seqno = 10
        format = "lvm2"                 # informational
        status = ["RESIZEABLE", "READ", "WRITE"]
        flags = []
        extent_size = 8192              # 4 Megabytes
        max_lv = 0
        max_pv = 0
        metadata_copies = 0

        physical_volumes {

                pv0 {
                        id = "nhdO9N-249J-6m50-OFY0-Lzfe-iQht-5SuIku"
                        device = "/dev/sda5"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 159686656    # 76.1445 Gigabytes
                        pe_start = 2048
                        pe_count = 19493        # 76.1445 Gigabytes
                }
        }

}

Theres no logical volumes which im assuming is why lvscan will not find anything? Which i am not sure is a good or bad thing because looking at sample of someone elses holds lv_swap and lv_root and im after documents in my home directory which i am assuming fedora partitioner separates as i recall having to deal with something like /dev/fedora/home?

  • Please paste error messages into the question directly. Don't add a link to a screenshot (or whatever that is). – Faheem Mitha Feb 11 '15 at 10:03
1

If the filesystem you want is on an LVM, you should not mount the partition directly.

Instead, look for the logical volume name under /dev/mapper and mount that. If nothing is there, you may need to perform an LVM scan and activate the partition.

E.G.

# lvm
lvm> pvscan
lvm> lvdisplay
[list of LVMs found]
lvm> lvchange -a y [lv name]

The pvscan looks at all block devices on your system to find physical volume groups. This forces discovery on the LVM system.

The lvdisplay lists logical volumes that LVM knows about.

The lvchange with -a y activates a logical volume for use.

After running the lvchange to activate the volume, it should now show up under /dev/mapper, so you can

mount /dev/mapper/[lv name] /mnt

Of course, replace [lv name] above with the actual name of your logical volume.

  • pvscan gave me something but lvdisplay showed nothing, so did it give me a name in this screenshot? imgur.com/9Bi0aru – Gr4cchus Feb 11 '15 at 6:01
  • It appears to have found a physical volume on sda5. On my setups that is usually enough, but you can try vgscan followed by lvscan and see if that gets anything to show up in lvdisplay – John O'M. Feb 11 '15 at 13:25
  • i tried vgscan and it said "found volume group 'fedora' using metadata type lvm2". But when i check the mapper i dont see it in there when doing an ls. It just contains control, live-base, live-osimg-min, live-rw? An odd thing i noticed today too is on gparted it only says 1mb has been used? image here: imgur.com/vdE5brk – Gr4cchus Feb 11 '15 at 17:17
  • Updated most to OG post – Gr4cchus Feb 11 '15 at 17:37
  • 1
    Example imaging command, if you have another (larger) drive mounted at /mnt and the disk you are trying to recover is still sda: dd if=/dev/sda of=/mnt/sda.img To restore, go the other way: dd if=/mnt/sda.img of=/dev/sda. BE CAREFUL! There is no protection from going the wrong way. – John O'M. Feb 13 '15 at 5:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.