1

I'm stuck for several days whith a issue when I try to create a bootable USB disk GPT partitonned. I would like this disk to be like a bootable "backup" disk for my live system. (In fact the system part might be different from the live one. At the moment, my live system is a Jessie one)

I bought a 4To maxtor USB drive.

For the time being I installed Stretch on that disk using /boot (sdc7) swap (sdc8) and LVM (sdc12) I created 2 EFI partitions as I read somewhere that it is better to have one for each OS.

The partition schema is :

Disk /dev/sdc: 7814037167 sectors, 3.6 TiB Logical sector size: 512
bytes Disk identifier (GUID): 4E367763-BD0F-459F-9F18-AADF699D40BF
Partition table holds up to 128 entries First usable sector is 34,
last usable sector is 7814037133 Partitions will be aligned on
8-sector boundaries Total free space is 6 sectors (3.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40            2087   1024.0 KiB  8300  BIOS boot partition
   2            2088          206887   100.0 MiB   EF00  EFI System
   3          206888          288807   40.0 MiB    8300  Dell utility
   4          288808        19163175   9.0 GiB     2700  Windows RE
   5        19163176       207906855   90.0 GiB    0700  Microsoft basic data
   6       207906856       208316455   200.0 MiB   EF00  EFI System grub2
   7       208316456       208623655   150.0 MiB   8300  boot
   8       208623656       219109415   5.0 GiB     8200  Linux swap
   9       219109416      2366593063   1024.0 GiB  8300  Linux filesystem
  10      2366593064      4514076711   1024.0 GiB  8300  Linux filesystem
  11      4514076712      6661560359   1024.0 GiB  8300  Linux filesystem
  12      6661560360      7814037133   549.5 GiB   8E00  Linux LVM

sda 12 is a PV:

  PV Name               /dev/sdc12
  VG Name               datavgbk
  PV Size               549,54 GiB / not usable 4,80 MiB
  Allocatable           yes 
  PE Size               4,00 MiB
  Total PE              140682
  Free PE               89482
  Allocated PE          51200
  PV UUID               n1UgX0-MGqy-2vvZ-BS9Z-KF3o-9ue7-g9YOSE

it contains 1 VG:

  VG Name               datavgbk
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                256
  Cur LV                3
  Open LV               0
  Max PV                256
  Cur PV                1
  Act PV                1
  VG Size               549,54 GiB
  PE Size               4,00 MiB
  Total PE              140682
  Alloc PE / Size       51200 / 200,00 GiB
  Free  PE / Size       89482 / 349,54 GiB
  VG UUID               tTYuQa-jKpL-lhih-3fi1-3hWI-Zlvm-Wk22GO

and 3 LVs:

  LV Path                /dev/datavgbk/homelvbkp
  LV Name                homelvbkp
  VG Name                datavgbk
  LV UUID                QCVg1c-vAMy-ss9C-hlLv-Xjd1-0qrm-MwPkY7
  LV Write Access        read/write
  LV Creation host, time phlsys, 2019-04-07 17:25:02 +0200
  LV Status              NOT available
  LV Size                60,00 GiB
  Current LE             15360
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  LV Path                /dev/datavgbk/optlvbkp
  LV Name                optlvbkp
  VG Name                datavgbk
  LV UUID                ZrqV3J-aVNv-0xZR-AAve-rDUC-Dnnf-0p8jFz
  LV Write Access        read/write
  LV Creation host, time phlsys, 2019-04-07 17:26:54 +0200
  LV Status              NOT available
  LV Size                40,00 GiB
  Current LE             10240
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  LV Path                /dev/datavgbk/syslvbkp
  LV Name                syslvbkp
  VG Name                datavgbk
  LV UUID                4Bhkub-YOmE-Lcz0-EBIG-eKsm-RD4X-u42j8y
  LV Write Access        read/write
  LV Creation host, time phlsys, 2019-04-07 17:37:11 +0200
  LV Status              NOT available
  LV Size                100,00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

To do this I prepared this new disk on my live system using gdisk and LVM2 (my live disks were disconnected), booted on Stretch CDROM and ran graphical install.

All was successfully completed but when reboot on this new disk, Grub rescue says "no operating system found". Grub-rescue ls shows (hd0), (hd0,gpt1) ... ,gpt12)

My sytem bios supports UEFI and secure-boot is disabled.

Note that my live system is actually setted to use EFI legacy and MBR partitionning.

There is no device.map file neither on my live server nor my new disk.

I can see that the /boot directory contains is:

# tree .

├── config-4.9.0-8-amd64
├── grub
│   ├── fonts
│   │   └── unicode.pf2
│   ├── grub.cfg
│   ├── grubenv
│   ├── i386-pc
│   │   ├── 915resolution.mod
│   │   ├── ...
│   │   └── zfs.mod
│   ├── locale
│   │   ├── ast.mo
│   │   ├── ...
│   │   └── zh_TW.mo
│   └── unicode.pf2
├── initrd.img-4.9.0-8-amd64
├── lost+found
├── System.map-4.9.0-8-amd64
└── vmlinuz-4.9.0-8-amd64

I did some checks this morning as I noticed my bios boot partition type was not properly setted (8300 instead of EF02).

I also checked what was written on the disk MBR and can see that grub wrote its own:

dd if=/dev/sdc of=/tmp/bsect bs=512 count=2
strings /tmp/bsect

ZRr=
`|f 
\|f1
GRUB 
Geom
Hard Disk
Read
 Error
EFI PART
cw6N

I also can see in grub.cfg that root is well setted to my system partiton into the lvm

set root='lvmid/tTYuQa-jKpL-lhih-3fi1-3hWI-Zlvm-Wk22GO/4Bhkub-YOmE-Lcz0-EBIG-eKsm-RD4X-u42j8y'

where

  VG UUID = tTYuQa-jKpL-lhih-3fi1-3hWI-Zlvm-Wk22GO
  LV UUID = 4Bhkub-YOmE-Lcz0-EBIG-eKsm-RD4X-u42j8y

which is OK

  • 1
    You seem to have multiple bootloaders: the BIOS boot partition suggests you have one legacy BIOS bootloader, and then you also have two EFI System partitions. Your system firmware might be capable of auto-detecting and displaying multiple boot options for a single removable disk, or it might just show one legacy and one UEFI boot option, or even not differentiate them at all. A single bootloader might work best with a removable disk. If you run efibootmgr -v, does it display a list of boot targets (= you're currently using native UEFI boot) or an error message (= legacy BIOS boot)? – telcoM Apr 8 at 8:26
  • Hi @TelcoM, there is no multiple bootloader. This disk is new and I partitionned it by myself and may be I did some mistakes. There are 2 EFI partitions because I read on the net (don't remember where) it is better to have one for each OS and if all goes well, I will also use later this disk to also boot a windows 7. – PhLinuX Apr 8 at 13:08
  • I created a bios boot partition because I also read that I should do this for grub to store some programs. "A 1 MB BIOS boot partition (of type ef02) that Grub will use to store its core image. A 100 MB EFI System Partition (of type ef00) formatted as FAT32 in which we will store the EFI boot image And a partition for our root file system (in our example formatted with ext4)" – PhLinuX Apr 8 at 13:12
  • By the way, efibootmgr -v doesn't display nothing with my live system which is actually booted at old fashion with MBR efibootmgr: EFI variables are not supported on this system. – PhLinuX Apr 8 at 13:23
  • A BIOS boot partition is needed if you want to use legacy-style GRUB with GPT partitioning. An EFI system partition is needed if you use a native UEFI bootloader (e.g. an UEFI version of GRUB). The only way both would be usable on the same system would be if you keep toggling the firmware boot preference from legacy to UEFI and back. For Windows, legacy-style boot and GPT partitioning is an invalid combination: Windows only supports either MBR+BIOS or GPT+UEFI on the system disk: you cannot mix and match. – telcoM Apr 8 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.