3

I have a disk from my Mint 19 laptop (480GB SSD) which I cannot remember the password for, so I thought, no problem attach via a USB 3.0 adapter to my desktop PC and mount the drive and back it up before wiping the disk and re-installing the laptop.

When I plug it in a 511MB volume automounts and has the Grub files on it etc. Initially the first time I plugged it in a second volume appeared and shows the root and swap dives of 442.68GB and 3.97GB respectively. I copied the home folder off and at the start got a permissions error and selected skip, I then got another permissions error and selected skip all assuming these were hidden files that I am not too bothered about backing up, I am more focused on the Documents and Pictures folders as much as anything else.

At the end I could see that all the folders off my home directory on the laptop had appeared but when I looked closer they were all zero byte files. I then tried copying a few key files and got a permissions error "Read Only File System". So it appeared that I could not access any files. I had a look at the drive in DiskPart and could see that it was an LVM drive so I decided to run through some procedures to mount the LVM drive. After unmounting it from the Files application.

Initially I did sudo lvs and got a warning:

WARNING: PV /dev/sdc5 in VG mint-vg is using an old PV header, modify the VG to update.

So I ran:

sudo vgck --updatemetadata mint-vg

This upgraded the VG and the warning went away doing sudo lvs.

I then ran these commands to try and activate and then mount the drive:

sudo pvscan
  PV /dev/sdc5   VG mint-vg         lvm2 [446.65 GiB / 0    free]
  Total: 1 [446.65 GiB] / in use: 1 [446.65 GiB] / in no VG: 0 [0   ]
siv@BigBlackIII:~$ sudo vgscan
  Found volume group "mint-vg" using metadata type lvm2
siv@BigBlackIII:~$ sudo vgchange -a y
  2 logical volume(s) in volume group "mint-vg" now active
siv@BigBlackIII:~$ sudo lvscan
  ACTIVE            '/dev/mint-vg/root' [442.68 GiB] inherit
  ACTIVE            '/dev/mint-vg/swap_1' [<3.97 GiB] inherit
siv@BigBlackIII:~$ sudo mount /dev/min=vg/root /mnt
mount: /mnt: special device /dev/min=vg/root does not exist.
siv@BigBlackIII:~$ sudo mount /dev/mint-vg/root /mnt
mount: /mnt: can't read superblock on /dev/mapper/mint--vg-root.
siv@BigBlackIII:~$ sudo dumpe2fs /dev/mint-vg/root | grep superblock
dumpe2fs 1.45.5 (07-Jan-2020)
dumpe2fs: Input/output error while trying to open /dev/mint-vg/root
Couldn't find valid filesystem superblock.

Out of interest I was able to get to the superblock using this command:

sudo mke2fs -n /dev/sdc5

mke2fs 1.45.5 (07-Jan-2020) /dev/sdc5 contains a LVM2_member filesystem Proceed anyway? (y/N) y

Creating filesystem with 117087488 4k blocks and 29278208 inodes Filesystem UUID: b4974c66-4d05-4fe3-9aff-bf86783a12a4

Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000

I then tried:

mount sb=32768 /dev/mint-vg/root /media/siv/TonyRoot 
mount: bad usage Try 'mount --help' for more information. 

So not sure what I am doing wrong? I found this method of creating the mount using the mount command in various posts butit is not accepted on Linux Mint 20 which is what I am running on my desktop machine.

Could anyone recommend what I should do to get this drive mounted so that I can back up my data?

Any help appreciated.

Siv

OK so not much help here in the end but for anyone who has the same issue I fixed my issue using this post:

quonn.wordpress.com

I was able to locate the files in /mnt/home/username where "username" is the actual user on my disk. I then copied all failes from there to my backup disk and then formatted the drive.

Siv

Siv
  • 41
  • Welcome on U&L! Is /dev/min=vg/root in your mount command a typo? – fra-san Oct 13 '20 at 21:57
  • Yes, I corrected it lower down it should have read /dev/mint-vg/root. – Siv Oct 13 '20 at 22:02
  • 1
    Please, edit your question and add new information to it, comments aren't really readable (and are not meant to stay). Also, modifying LVM and file system metadata (as vgck possibly did and mke2fs surely does) makes recovering your files harder and harder. I'd strongly suggest avoiding any further destructive operation (anything that writes on the drive). – fra-san Oct 14 '20 at 09:17
  • @fra-san I was not seeing much in the way of answers so am trying to resolve the issue myself as I need to get that data back and a day has passed and I would have thought someone would have known immediately what the fix would be in these hallowed Halls!? – Siv Oct 14 '20 at 20:22
  • I don't know, unfortunately. If you created a new file system over LVM metadata, chances are that the only way you have to get your files back is using some data recovery tool. You may search through the existing questions tagged [tag:data-recovery] on this site (and possibly on Super User) for advice, some of them are about lost file system or LVM superblocks. – fra-san Oct 14 '20 at 21:11
  • I already ran photorec and restored some key files, but I would still like to try and mount this drive. – Siv Oct 15 '20 at 10:02
  • OK I managed to mount it - see main question. – Siv Oct 16 '20 at 13:51

1 Answers1

12

I just had exactly this problem on a drive plugged into a USB caddy.  All the pvscan/vgscan/lvscan looked fine.  LVs were 'ACTIVE'. Non-LVM partition mountable.  But as soon as I try to mount an LVM LV like /dev/mapper/house-root, I get the above message about missing superblock (and if IO errors visible in dmesg). e.g.,

$ sudo dumpe2fs /dev/mapper/house-root 
dumpe2fs 1.46.4 (18-Aug-2021)
dumpe2fs: Input/output error while trying to open /dev/mapper/house-root
Couldn't find valid filesystem superblock.

and from dmesg:

[3802002.748434] Buffer I/O error on dev dm-4, logical block 26214384, async page read
[3802002.748536] Buffer I/O error on dev dm-4, logical block 16, async page read

This was very strange as it had all been working fine moments before in another machine. Specifying alternative superblocks didn't help.  The secret turned out to be that LVM was confused about the 'ACTIVE' state.  Deactivating and reactivating it suddenly made everything work perfectly.  So despite it saying:

$ sudo pvscan
  PV /dev/sdb2                     VG house           lvm2 [<931.02 GiB / <131.02 GiB free]
$ sudo vgscan
  Found volume group "house" using metadata type lvm2
$ sudo lvscan
  ACTIVE            '/dev/house/root' [100.00 GiB] inherit
  ACTIVE            '/dev/house/home' [700.00 GiB] inherit

I had to do

$ sudo vgchange -a n house
  0 logical volume(s) in volume group "house" now active
$ sudo vgchange -a y house 
  2 logical volume(s) in volume group "house" now active

to make the ext4 filesystems on the drive actually visible.

Hope that helps someone when it seems like your disk is all corrupt.

Wookey
  • 121