0

I used dd to copy boot and root partition to lvm on an external hard disk. My lsblk looks like below now.

$ lsblk
NAME               MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                  8:0    0  3.7T  0 disk
├─sda1               8:1    0    2T  0 part /var/share/samba
└─sda2               8:2    0  1.7T  0 part
  ├─disk2-lv--root 254:0    0   40G  0 lvm  /
  ├─disk2-lv--nfs  254:1    0   60G  0 lvm  /nfs-share
  └─disk2-lv--boot 254:2    0  512M  0 lvm  /boot
mmcblk0            179:0    0 29.7G  0 disk
├─mmcblk0p1        179:1    0  256M  0 part
└─mmcblk0p2        179:2    0 29.5G  0 part

Whenever I took out the sd card and try to boot: It displays "GPT no boot device". I'm sure it uses root fs from external drive but boot drive doesn't engage during boot up. Seems I misconfigured my system.

I have below entry in my /boot/config.txt

initramfs initramfs.gz

and my /boot/cmdline.txt file reads

console=serial0,115200 console=tty1 root=/dev/mapper/disk2-lv--root rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait noswap=1
4
  • What dd command did you use? I don't see any of the partition level information like the partition labels? – Simon Banks Mar 30 at 16:03
  • @SimonBanks I used sudo dd if=/dev/mmcblk0p1 of=/dev/disk2/lv-boot bs=1M – aug70co Mar 30 at 21:17
  • 1
    The SD card is MBR formatted. GPT is a much newer system. The easiest way to do this is to format the drive MBR, create the two partitions, format the partitions appropriately (1st = vfat, 2nd = ext4), and then copy the contents in file wise. If you really insist on using dd, you have to copy the entire card as one big lump (mmcblk0, no pN) to the hard disk overwriting any formatting on it, not a pre-existing partition on the hard drive. – goldilocks Mar 30 at 21:35
  • @goldilocks thank you for your answer, if you put the above remark as an answer, I'll accept it. – aug70co Mar 31 at 15:15
0

You can not boot a Pi from a GPT partitioned disk.

(Well strictly this is theoretically possible, but would require a custom image with GPT support.)

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.