Recently I bought new sshd to replace my old one on my notebook, but I have problem. I installed Ubuntu 15.10 on new one and put the old on usb case I have, but the disk on USB doesnt have partition (I screamed for 5 minutes because I can't lose data).

So I moved back my old disk inside the disk bay and put the new on usb case, and all my data was here intact but the disk on usb shows no partition.

Both of disks when in usb case show the model and factory correctly but not the partitions. The case is OK, tested with old HDD that doesn't have GPT/EFI partition.

How can I mount the external disk so I can transfer my files?

Ouput of commands:

 $ sudo blkid /dev/sdb 
 /dev/sdb: PTTYPE="PMBR"

 $ sudo parted /dev/sdb print 
 Error: /dev/sdb: unrecognised disk label
 Model: ST1000LM 014-1EJ164 (scsi)                                     
 Disk /dev/sdb: 1000GB Sector size (logical/physical): 4096B/4096B
 Partition Table: unknown Disk Flags:

$ sudo gdisk /dev/sdb 
GPT fdisk (gdisk) version 1.0.0

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: not present
  • a hd case seems useless on linux , that happened with me too ; a better solution IF you have an old desktop , you can open iit , unplug its hd and cd/dvd player , and you'll have 2 ports empty , put your both HDs and boot from the old one , and then do your stuff – Jonah Feb 5 '16 at 13:44
  • @younes , already tried that but my ubuntu even boot, maybe because my desktop is little old and still on BIOS rom based. – Diaulas Castro Feb 9 '16 at 16:27
  • What USB enclosure are you using? – Layne Bernardo Nov 8 '18 at 12:07

Try googling recover lost partitions. One product is http://findandmount.com/. It says it can find filesystems even if the master boot record has lost partitions. I also remember using a product on http://www.ultimatebootcd.com/ to do the same thing. I just can't remember which product.

  • Theres no lost partition, they only won't show when the hd is plugged by external usb case – Diaulas Castro Feb 9 '16 at 16:20

try this command

sudo apt-get install exfat-fuse exfat-utils

Pay attention to this part:

Sector size (logical/physical): 4096B/4096B

This disk is capable of using 4KiB blocks. I'm guessing the USB case and the internal SATA controller in the notebook are using different strategies to deal with this: one translates them into traditional 512-byte blocks, and the other can use the new block size natively.

I am guessing that when the disk is in the notebook's disk bay, you'll get this output instead:

Sector size (logical/physical): 512B/4096B

With a GPT partitioning scheme, this becomes a problem: the GPT specification says the partition table should start at block #1. Block #0 is reserved for "protective MBR" that just allows older systems to identify the disk as in use, even if they only understand MBR-style partitioning.

But if you partition the disk using emulated 512-byte blocks and then switch to native mode (e.g. by moving the disk from an internal controller to a 4 KiB-aware USB), a 512-byte block #1 becomes the second eighth of 4 KiB-block #0.

Respectively, if you initially use native 4 KiB blocks when partitioning the disk, and then switch to emulated 512-byte blocks, the GPT partition table now starts at block #8.

Unfortunately, the only way to fix your situation without repartitioning would be to find an older external USB HDD adapter that specifically cannot use 4 KiB blocks, so it would trigger the disk's built-in 512-byte sector emulation just like the laptop's internal SATA controller does.

With Linux kernel version 4.14 or newer (or with an older one that has this patch backported), it is possible to switch the logical block size. If you also have a version of losetup that has this patch, you would be able to have your disk in your existing USB adapter, and then say:

losetup -P -b 512 /dev/loop0 /dev/sdb

to allow you to access /dev/sdb through /dev/loop0 using a different logical block size. The partitions would appear as /dev/loop0pN with N being the partition number, or if that scheme is not yet supported by your distribution, you could omit the -P option and use the kpartx tool from the device-mapper-multipath package:

kpartx -a /dev/loop0

... to automatically create mappings for each partition on your loop device, named like /dev/mapper/loop0pN.

You could then mount those partition devices as usual, just with a different device name.

After unmounting the partition devices, the procedure to undo this set-up is:

kpartx -d /dev/loop0    # only if the use of kpartx was needed
losetup -d /dev/loop0 

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.