Trying to recover my Plex Media Server metadata

Russell Bateman
October 2018
last update:

Steps I engaged using a SATA toaster. The dongle I had bought for $10 is apparently not able to spin up my drive, because the drive requires much more power than is available through USB 3. I was supposed to know this by the drive's size (USB 3 can power 2.5" drives, but not 3.5" drives).

  1. Mounted drive in a USB 3.0 toaster capable of spinning it up.

  2. Looked at what was offered by Nemo:
    • 17 GB Block Device
    • 303 GB Volume

  3. Using Menu → Preferences → Disks, I saw this instead:
    • 303 GB Block Device, /dev/tol-eressea-vg/root
      Contents Unknown
      Size 303GB(302,946,189,312 bytes)
    • 17 GB Block Device, /dev/tol-eressea-vg/swap_1
      UUID 87631cc8-248e-424b-a9dd-d93ee2ec74ca
      Contents Swap (version 1) — Not Active
      Size 17GB(16,848,519,168 bytes)

  4. Convinced what I'm looking for must rather be on this volume, rather than any swap volume, I double-clicked to open 303 GB Volume and got this error:
    Unable to mount 303 GB Volume
    Error mounting /dev/dm-0 at /media/russ/359c69e9-fe56-4403-94e0-0ef569518263: \
        can't read superblock on /dev/mapper/tol--eressea--vg-root
                                 +---------+
                                 |   OK    |
                                 +---------+
    
  5. I Googled for
    error mounting /dev/dm-0 at /media can't read superblock on /dev/mapper --vg-root
    
  6. I got: can't read superblock on /dev/mapper/veracrypt1.

  7. I attempted:
    russ@nargothrond:/$ ll -d /dev/dm-*
    brw-rw---- 1 root disk 253, 0 Oct  4 07:43 dm-0
    brw-rw---- 1 root disk 253, 1 Oct  4 07:37 dm-1
    russ@nargothrond:/$ ll /dev/tol-eressea-vg/
    total 0
    drwxr-xr-x  2 root root   80 Oct  4 07:37 ./
    drwxr-xr-x 24 root root 4880 Oct  4 07:37 ../
    lrwxrwxrwx  1 root root    7 Oct  4 08:45 root -> ../dm-0
    lrwxrwxrwx  1 root root    7 Oct  4 07:37 swap_1 -> ../dm-1
    russ@nargothrond:~/Downloads$ mkdir seagate-320
    russ@nargothrond:~/Downloads$ cd seagate-320
    russ@nargothrond:~/Downloads/seagate-320$ sudo bash
    root@nargothrond:~/Downloads/seagate-320# which mke2fs
    /sbin/mke2fs
    root@nargothrond:~/Downloads/seagate-320# mke2fs -n /dev/dm-0
    mke2fs 1.44.1 (24-Mar-2018)
    Creating filesystem with 73961472 4k blocks and 18497536 inodes
    Filesystem UUID: ec6218ae-997b-4b20-8d3c-45435a482d53
    Superblock backups stored on blocks:
    	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    	4096000, 7962624, 11239424, 20480000, 23887872, 71663616
    
  8. I had no luck following the instruction, "now using the information it displays
    sudo e2fsck -b <one of the displayed options> <device>
    
    because there were no options.

  9. However, convinced I won't break anything, I began to resort to arbitrary, stupid flailing around:
    root@nargothrond:~/Downloads/seagate-320# e2fsck -b 32768 /dev/dm-0
    e2fsck 1.44.1 (24-Mar-2018)
    e2fsck: Input/output error while trying to open /dev/dm-0
    
    The superblock could not be read or does not describe a valid ext2/ext3/ext4
    filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
    filesystem (and not swap or ufs or something else), then the superblock
    is corrupt, and you might try running e2fsck with an alternate superblock:
        e2fsck -b 8193 
     or
        e2fsck -b 32768 
    
    root@nargothrond:~/Downloads/seagate-320# e2fsck -b 8193 /dev/dm-0
    e2fsck 1.44.1 (24-Mar-2018)
    e2fsck: Input/output error while trying to open /dev/dm-0
    
    The superblock could not be read or does not describe a valid ext2/ext3/ext4
    filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
    filesystem (and not swap or ufs or something else), then the superblock
    is corrupt, and you might try running e2fsck with an alternate superblock:
        e2fsck -b 8193 
     or
        e2fsck -b 32768 
    
    root@nargothrond:~/Downloads/seagate-320# e2fsck -b 163840 /dev/dm-0
    e2fsck 1.44.1 (24-Mar-2018)
    e2fsck: Input/output error while trying to open /dev/dm-0
    
    The superblock could not be read or does not describe a valid ext2/ext3/ext4
    filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
    filesystem (and not swap or ufs or something else), then the superblock
    is corrupt, and you might try running e2fsck with an alternate superblock:
        e2fsck -b 8193 
     or
        e2fsck -b 32768 
    
  10. Of course, the solution I want to arrive at ultimately happened for the respondant doing this, but, in my case since I hadn't been to identify or fix anything, it failed:
    root@nargothrond:~/Downloads/seagate-320# mount -t ext4 /dev/mapper/tol--eressea--vg-root
    mount: /dev/mapper/tol--eressea--vg-root: can't find in /etc/fstab.
    
  11. The responder claimed to hold his information from What are all the things one can try to recover an ext3 filesystem with a bad superblock?, which tells me that my first responder's "option" is in fact one of the block numbers. So, I go back to try that. Beginning with block number 7962624, I began getting an Invalid argument error instead of an Input/Output error:
    root@nargothrond:~/Downloads/seagate-320# e2fsck -b 7962624 /dev/dm-0
    e2fsck 1.44.1 (24-Mar-2018)
    e2fsck: Invalid argument while trying to open /dev/dm-0
    
    The superblock could not be read or does not describe a valid ext2/ext3/ext4
    filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
    filesystem (and not swap or ufs or something else), then the superblock
    is corrupt, and you might try running e2fsck with an alternate superblock:
        e2fsck -b 8193 
     or
        e2fsck -b 32768 
    
  12. Though the article gives me no warm fuzzies, and I'm pretty sure that my filesystem was ext3 or ext4—not reiserfs, I tried this anyway just for grins:
    root@nargothrond:~/Downloads/seagate-320# reiserfsck --rebuild-sb /dev/dm-0
    reiserfsck 3.6.27
    
    Will check superblock and rebuild it if needed
    Will put log info to 'stdout'
    
    Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
    
    The problem has occurred looks like a hardware problem. If you have
    bad blocks, we advise you to get a new hard drive, because once you
    get one bad block  that the disk  drive internals  cannot hide from
    your sight,the chances of getting more are generally said to become
    much higher  (precise statistics are unknown to us), and  this disk
    drive is probably not expensive enough  for you to you to risk your
    time and  data on it.  If you don't want to follow that follow that
    advice then  if you have just a few bad blocks,  try writing to the
    bad blocks  and see if the drive remaps  the bad blocks (that means
    it takes a block  it has  in reserve  and allocates  it for use for
    of that block number).  If it cannot remap the block,  use badblock
    option (-B) with  reiserfs utils to handle this block correctly.
    
    bread: Cannot read the block (2): (Input/output error).
    
    Aborted (core dumped)
    
  13. The second responder implied that I might want to try this on Ubuntu 14.04 rather than on 18.04.1 as I have done (because that's what I've got in hand). Hmmmm... that's a fair amount of bother.

  14. Another respondent, implies that, while running fsck, you don't want the disk mounted.

  15. I ordered a two-slot SATA toaster from Amazon to continue this. I've been borrowing one at work and I just don't have the time to keep at it there.