You are not logged in.

#1 2014-10-15 17:27:08

manypopes
Member
Registered: 2013-06-25
Posts: 33

Tried to copy my SSD to a HDD, doesn't show up in boot menu

I copied my SSD to a hard drive using dd bs=8M if=/dev/sdb of=/dev/sda. I have md5summed each partition from a LiveUSB and each pair of partitions is identical, however only the first disk (sdb) shows up in my BIOS boot menu. Why is this?

The disk is a Windows 7 / Arch Dual Boot using UEFI and Gummiboot. I intend to move Windows to a hard drive and I decided copying the whole disk then removing Linux from one, Windows from the other, would be the most hassle-free method.

Offline

#2 2014-10-15 17:41:21

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Tried to copy my SSD to a HDD, doesn't show up in boot menu

There can be problem with this method because filesystems, partitions, disk have UUID (unique number identifier) and I think that UEFI might use them. If you dd your hard disk the UUID's are no longer unique, which is bogus. But i am not an expert on this topic, maybe someone is more informed than me.

Offline

#3 2014-10-15 20:42:30

manypopes
Member
Registered: 2013-06-25
Posts: 33

Re: Tried to copy my SSD to a HDD, doesn't show up in boot menu

I see, yes each pair of partitions have identical UUIDs. I tried to change the UUID of sda1 using tune2fs -U however I'm getting "tune2fs: Bad magic number in super-block while trying to open /dev/sda1; Couldn't find valid filesystem superblock." as an error, I think it has something to do with the EFI partition being vfat.

Last edited by manypopes (2014-10-15 20:46:09)

Offline

#4 2014-10-15 20:53:46

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: Tried to copy my SSD to a HDD, doesn't show up in boot menu

Post the output of:

# gdisk -l /dev/sda
# gdisk -l /dev/sdb
lsblk -f

Offline

#5 2014-10-15 22:24:16

manypopes
Member
Registered: 2013-06-25
Posts: 33

Re: Tried to copy my SSD to a HDD, doesn't show up in boot menu

sda

GPT fdisk (gdisk) version 0.8.10

Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Disk /dev/sda: 488397168 sectors, 232.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): F35851F9-8CB2-456E-AA05-A114874DC31F
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 351651854
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI system partition
   2          206848          468991   128.0 MiB   0C01  Microsoft reserved ...
   3          468992       178726911   85.0 GiB    0700  Basic data partition
   4       178726912       220669951   20.0 GiB    8300  
   5       220669952       351651839   62.5 GiB    8300  

sdb

GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 351651888 sectors, 167.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): F35851F9-8CB2-456E-AA05-A114874DC31F
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 351651854
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI system partition
   2          206848          468991   128.0 MiB   0C01  Microsoft reserved ...
   3          468992       178726911   85.0 GiB    0700  Basic data partition
   4       178726912       220669951   20.0 GiB    8300  
   5       220669952       351651839   62.5 GiB    8300  

lsblk -f

NAME   FSTYPE  LABEL       UUID                                 MOUNTPOINT
sda                                                             
├─sda1 vfat                AC76-691A                            /boot
├─sda2                                                          
├─sda3 ntfs                B6E47F30E47EF24B                     
├─sda4 ext4                bb00f218-2b7e-4c23-8688-13dc1ad1985f /
└─sda5 ext4                2dbebcad-96ec-4575-883e-196827ee3592 
sdb                                                             
├─sdb1 vfat                AC76-691A                            
├─sdb2                                                          
├─sdb3 ntfs                B6E47F30E47EF24B                     
├─sdb4 ext4                bb00f218-2b7e-4c23-8688-13dc1ad1985f 
└─sdb5 ext4                2dbebcad-96ec-4575-883e-196827ee3592 /home

As you can see, I'm using partitions from both drives which is quite interesting, even the boot partition is a HDD mount instead of the original, this must mean that my BIOS uses UUIDs too?

I found something online showing how to edit UUIDs with a hex editor, I will give it a try tomorrow and hopefully can put an end to this madness!

Offline

#6 2014-10-16 06:58:11

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Tried to copy my SSD to a HDD, doesn't show up in boot menu

In GPT partitions as well as file system (and maybe the disk itself) have UUID. For your tune2fs error, tune2fs is for ext/2-3-4, not for vfat. Try blkid, and maybe gdisk for the disk UUID. I have no idea how to change the UUID of a vfat partition, for the label you could use mlabel but I do not see a tool for the UUID.

Offline

#7 2014-10-16 17:38:03

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Tried to copy my SSD to a HDD, doesn't show up in boot menu

Another problem is that gdisk says the GUID parition table on /dev/sda is damaged.
Here is how i would fix this:
Create a new empty partition table with sgdisk --zap-all /dev/sda .
Recreate the partitions and filesystems. This will also solve the UUID problem, as new UUIDs are generated.
Copy over the files.
Edit fstab and bootloader configuration to change the UUIDs.
Make a new entry in the UEFI that points to the Refind bootloader on the harddrive.

Last edited by teateawhy (2014-10-16 17:39:31)

Offline

#8 2014-10-16 20:22:48

manypopes
Member
Registered: 2013-06-25
Posts: 33

Re: Tried to copy my SSD to a HDD, doesn't show up in boot menu

Editing UUIDs with a hex editor was quite a friendly process, but there are still PARTUUIDs and maybe even other things that are conflicting which I can't change so easily.

Thanks for all the help guys, this has been very interesting but I've decided I'd rather just put up with doing a Windows install.

Offline

Board footer

Powered by FluxBB