1

I have this MBR partition layout on two disks, internal and external:

-sda1 /boot
-sda2 /
-sda3 swap
-sda4 extended
    sda5 encrypted
    sda6 encrypted

The external disk is the same except it is obviously 'sdb.'

I needed to restore something from backup, but couldn't do it with the system running, so I booted from a bootable usb stick. I connected the external hard disk and copied what I wanted from two partitions: sdb2 and sdb5. I used pcmanfm to mount and umount the two partitions. Everything worked as expected.

I rebooted from the internal disk and then I remembered I wanted to copy something else. The additional file didn't require the system to go offline so I didn't use the usb stick. I connected the external disk again and... sdb5 and sdb6 popped up in pcmanfm as usual, but sdb1 and sdb2 didn't.

I tried to mount sdb2 manually on command line and mount didntt recognize it, claiming that I must specify the file system type. I did it as 'mount -t ext4' and it still won't work.

I thought maybe something else was broken on my system so I booted from the usb stick again and confirmed the problem. I booted into the regular system (internal disk) again, and the problem persists.

I tried opening sdb5 and it decrypts, but won't mount for the same reason: unindentified file system. sdb6 still opens.

The two disks look exactly the same on 'fdisk -l' but not on 'lsblk -f'. All partitions except sdb6 have no file system identification on the external disk.

# lsblk -f
NAME                FSTYPE      LABEL UUID   MOUNTPOINT
sda                                        
├─sda1              ext2        boot  [uuid] 
├─sda2              ext4        root  [uuid] /
├─sda3                                                
│ └─swap            swap              [uuid] [SWAP]
├─sda4                                                 
├─sda5              crypto_LUKS       [uuid] 
│ └─cxx             xfs         cr1   [uuid] /crypt1
└─sda6              crypto_LUKS       [uuid] 
  └─czz             xfs         cr2   [uuid] /crypt2
sdb                                                    
├─sdb1                                                 
├─sdb2                                                 
├─sdb3                                                 
├─sdb4                                                 
├─sdb5              crypto_LUKS       [uuid] 
│ └─luks-[uuid]                                          
└─sdb6              crypto_LUKS       [uuid] 
  └─luks-[uuid]     xfs         cr2b  [uuid] /media/root/cr2b

I can't see or understand how that happened. I have other copy of the data, but now I am very suspicious of the external disk. Can I still trust it? Is there any way I can fix that partition table so I don't have to copy everything again? I thought about opening it and re-saving it on cfdisk or fdisk, but since one of the encrypted partitions also has lost its FS label, I am not quite sure of how to do it.

3
  • Did you copy from the external disk, directly over the partitions, instead of mounting them first? Commented Feb 18, 2017 at 21:21
  • Was one disk binary cloned to the other at some moment in the past, so their partitions shared UUIDs? I cannot tell if it could cause your exact problem, but such a situation has unexpectedly bitten me once and taught to be careful with it. Commented Feb 18, 2017 at 22:37
  • I just copied a couple of directories with rsync. Nothing else. Commented Feb 19, 2017 at 3:46

1 Answer 1

0

A difference between fdisk and lsblk is that fdisk reads from the disk, while lsblk list the kernel's view of the devices from sysfs. Not that this solves your problem, but it's a good thing to keep in mind while trying to figure out partition problems. Running dmesg | grep sd you should get an idea of whatever the kernel detected while booting, like disks, partitions, etc. If sda and sdb are identical, you should have similar entries.

3
  • However, note that I said: "I thought maybe something else was broken on my system so I booted from the usb stick again and confirmed the problem. I booted into the regular system (internal disk) again, and the problem persists." So I get the problem in two different systems. The usb stick is quite old, about three, maybe four years. Commented Feb 19, 2017 at 22:38
  • Did you try smartctl -a /dev/sdb? Does it report any errors like unreadable or pending sectors, etc? Commented Feb 20, 2017 at 19:44
  • I hadn't thought about that. I tried and got this output: # smartctl -a /dev/sdb Read Device Identity failed: Unknown error A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options. I thought it could be a problem with the USB case, so I used another, and the original problem persisted, but then smartctl gave me output. Too big for this space, please read it here: pastebin.com/zysdsLpQ Looks OK to me, but I could be wrong. Even with the other case, I still can't access those partitions. Commented Feb 21, 2017 at 9:59

You must log in to answer this question.