You are not logged in.
My computer has two hard drives. I wanted to upgrade the non-boot one to a larger size. I connected a new larger SSD via a USB-enclosure (as I don't have any slots left for a third drive), created one ext4 partition (GPT - primary) and then mounted and rsynced my old drive to the new drive. This was all fine but when I swapped the old partition out and put the new one in my machine on the SATA slot I can't access the partition.
I can see the device on `/dev/sda` but I don't see the `/dev/sda1` partition.
I have seen similar issues on various forums suggesting that the USB enclosure might report the wrong block size or there's some sort of offset in terms of where the partitions begin:
- https://serverfault.com/questions/76427 … o-internal
- https://forum.cgsecurity.org/phpBB3/vie … hp?t=12329
- https://superuser.com/questions/679725/ … ector-disk
Most suggest to use `testdisk` to get things fixed but my main question is: how can I avoid this problem next time I do this? I have to use the USB enclosure but I want the partitions I create to be compatible with SATA slots. (I'm looking for a solution that's not `dd`. I haven't had a good experience with `dd` and prefer to avoid).
Offline
It's unfortunate that GPT still depends on the sector size but that's just how it is. You can use losetup --find --show --partscan --sector-size=512 (or =4096) to work around the issue (should give you /dev/loopXpY devices).
If that works you can check partition offsets and sizes (in bytes) and re-create (without loop device) accordingly.
Then put a warning label on your USB enclosure. Not every enclosure emulates the sector size... preferably it should be passed through as is so it would work the same internally and externally.
Offline
Thanks that gave me some pointers. I wonder if anyone can recommend a SATA to USB adapter that does NOT have this issue.
I have this one and this issue has caused me so much pain and confusion: https://amzn.eu/d/06RfV1wZ
Offline