0

PURPOSE: Determine why the hdd will not mount after creating a duplicate hdd out of it.

Host hdd: 4tb.gold

Destination hdd: boo.boo

Originally mount the hdd = When I 1st connected the 2 hdd's to the computer before doing any other steps afterwards; the number 1 thing I did after starting the computer.


I used the following command to make the duplicate

"sudo dd if=/dev/sdx bs=16M of=/dev/mapper/boo.boo" 

whereby the destination hdd ("of...") was mounted before running that command.

I used the following command to originally mount the hdd b/f duplication, and then again when trying to mount the hdd after duplication:

"sudo mount /dev/mapper/boo.boo /mnt"

... The duplicating finished, but now the hdd shows up in lsblk, opens with cryptsetup, but will not mount.

Common error message: "bad superblock, wrong fs type, bad..."

UPDATE: "sudo fsck /dev/sdx" = fsck from util-linux 2.33.1

$ sudo fdisk -l /dev/mapper/boo.boo (destination hdd which was only hdd mounted)

GPT PMBR size mismatch (3907029167 != 3906996399) will be corrected by write.
Disk /dev/mapper/4tb.gold: 1.8 TiB, 2000382156800 bytes, 3906996400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device                     Boot Start        End    Sectors  Size Id Type
/dev/mapper/4tb.gold-part1          1 3906996399 3906996399  1.8T ee GPT

Partition 1 does not start on physical sector boundary.
7
  • "destination hdd was mounted before running that command" ... not a good idea - you may have corrupted the image due to this. Try again, but first unmount both source and destination filesystems. Additionally /dev/mapper/boo.boo is somewhat equivalent to a partition (i.e: /dev/sdx1), not a disk (i.e: /dev/sdx), so use /dev/sdx1 (or whatever is appropriate) as the source.
    – Attie
    Commented Oct 29, 2019 at 10:13
  • 1
    @KamilMaciorowski Updated question. "sdx" has 3 partitions, "dev/mapper" likely had 1.
    – topencrypt
    Commented Oct 29, 2019 at 10:13
  • When you write "originally mount the hdd", it's not clear if you mean sdx or boo.boo. Were/are you able to mount /dev/sdx? (and I don't mean sdx1 or so). If not, then it's normal you cannot just mount boo.boo now, regardless of what you could do with boo.boo before. Commented Oct 29, 2019 at 10:16
  • @AttieThe source hdd was not mounted, only the empty destination. If the source hdd was not mounted, would you still say that the source hdd may have a corrupt image? I know the destination hdd may be useless. I think I need to remove encryption from the destination hdd and redo the duplication with no encryption and no mounted device.
    – topencrypt
    Commented Oct 29, 2019 at 10:18
  • I've seen few questions of yours and frankly it seems you perform some voodoo. You're experimenting, asking and trying to learn. These are good. But frankly sometimes you're not able to explain your setup, you get partial answers or comments that doesn't necessarily match the case and add to the confusion. E.g.: now you're saying "Originally mount the hdd" just after you call 4tb.gold and boo.boo hdds. Which one is "the hdd"? And then there is sdx (the only thing I would call hdd here). So three hdds? How is cryptsetup involved? Commented Oct 29, 2019 at 10:28

2 Answers 2

1

"sdx" has 3 partitions, "dev/mapper" likely had 1

If the source had 3 partitions, after you cloned it, the mapper device also has 3 partitions now. (It doesn't really matter what the destination had – you overwrote everything while cloning.)

So you cannot mount it for the same reason you cannot actually mount sdx as a whole: a disk with a partition table doesn't have anything mountable. The partitions are mountable, not the disk itself.

Device-mapper devices will not automatically recognize a partition table inside them; you'll have to separately create new dm-linear mappings for each partition. This can be most easily done using the kpartx tool from multipath-tools:

kpartx -av /dev/mapper/diskname

mount /dev/mapper/disknamep1 /mnt

(I would recommend re-doing the cloning from scratch, and this time leaving the partition table unencrypted – instead create a separate crypt device for every partition.)

2
  • at grawity: I totally agree!
    – topencrypt
    Commented Oct 29, 2019 at 10:48
  • at grawity (or anyone): If the host hdd was NOT mounted, then the host hdd image /files should be as they originally were before running the dd command, yes? I know I have read in different questions (when talking about mounting a hdd, running the dd command, and using recovery software to access deleted files on 'a' hdd) about how "deleted files could get overwritten", etc, but I am assuming that if the host hdd was NOT mounted and the destination hdd was mounted, that the host hdd would not be affected in any negative way. Thanks.
    – topencrypt
    Commented Nov 1, 2019 at 9:07
1

Does /dev/sdX holds some partitions ?

What is the output of fdisk -l /dev/mapper/4tb.gold ?

If /dev/mapper/4tb.gold represents the whole disk (which was partitionned), then you have to mount one of theses partitions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .