Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian on external usb ssd drive not booting

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
roelofth
Posts: 8
Joined: 2021-08-18 07:04

Debian on external usb ssd drive not booting

#1 Post by roelofth »

Hi,

After some time I do have a question again.
Other things I have been able to figure out myself but
now I am trying to get debian to boot from an external
ssd drive with an uefi partition. Debian is installed on
/dev/sdd2
I need to do some work and can only take one laptop
on an upcoming trip. This laptop has windoze installed
on a 256 GB encrypted partition, uefi boot. So it is no
option to alter the partition size and my boss will not
allow that.

rth@debian:~$ lsblk | grep sdd
sdd 8:48 0 465.8G 0 disk
├─sdd1 8:49 0 190M 0 part
├─sdd2 8:50 0 461G 0 part /media/rth/Debian_linux
└─sdd3 8:51 0 4.6G 0 part

rth@debian:~$ sudo fdisk /dev/sdd
Command (m for help): p
Disk /dev/sdd: 465.77 GiB, 500112031744 bytes, 976781312 sectors
Disk model: My Passport 261B
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
Disklabel type: gpt
Disk identifier: 46FF6C93-5CBF-4DEE-AFC2-A09FF2D30138

Device Start End Sectors Size Type
/dev/sdd1 2048 391167 389120 190M EFI System
/dev/sdd2 391168 967188479 966797312 461G Linux filesystem
/dev/sdd3 967188480 976779263 9590784 4.6G Linux swap

rth@debian:~$ sudo parted -ls
Model: WD My Passport 261B (scsi)
Disk /dev/sdd: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 200MB 199MB fat32 EFI_boot boot, esp
2 200MB 495GB 495GB ext4 Debian
3 495GB 500GB 4910MB linux-swap(v1) Swap swap



I have tried to use chroot :
sudo mount /dev/sdd2 /mnt
sudo mount /dev/sdd1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdd
update-grub

At end of installing debian on the usb drive the installer will
install grub but unfortunally on the wrong uefi partition and
thus it would not boot, neither would windoze but I got that
fixed by disabling the debian efi file from bios setup.

How can I proceed to get the booting process from the usb
drive working ?

Roelof

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian on external usb ssd drive not booting

#2 Post by p.H »

roelofth wrote: 2021-08-18 07:41 grub-install /dev/sdd
grub-install ignores the device (irrelevant) when installing for EFI platform. It uses the EFI partition mounted on /boot/efi or the path specified by --efi-directory.
roelofth wrote: 2021-08-18 07:41 At end of installing debian on the usb drive the installer will
install grub but unfortunally on the wrong uefi partition
How do you know GRUB is on the wrong EFI partition ? A I wrote above, grub-install installs GRUB in the EFI partition mounted on /boot/efi, /dev/sdd1 according to your commands.

Anyway if you want to install GRUB on a removable drive, you should run

Code: Select all

grub-install --no-nvram --force-extra-removable
And select the drive in the firmware boot menu like you do when you boot a live system or installer.

roelofth
Posts: 8
Joined: 2021-08-18 07:04

Re: Debian on external usb ssd drive not booting

#3 Post by roelofth »

How do you know GRUB is on the wrong EFI partition ?

I know because when I disconnect the usb drive and boot the laptop it will show
the grub menu.

I will give this a try :
grub-install --no-nvram --force-extra-removable

Thank you,
Roelof

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian on external usb ssd drive not booting

#4 Post by p.H »

roelofth wrote: 2021-08-18 10:43 when I disconnect the usb drive and boot the laptop it will show the grub menu.
The GRUB menu ? This is highly suspicious. AFAIK Debian stores the GRUB menu file in /boot/grub, not in the EFI partition.
If you can boot Debian I suggest you install the boot-info-script package, run bootinfoscript and post the report.

roelofth
Posts: 8
Joined: 2021-08-18 07:04

Re: Debian on external usb ssd drive not booting

#5 Post by roelofth »

Hi,

The extra options you showed me did the trick :
grub-install --no-nvram --force-extra-removable /dev/sdd

The laptop now boots from the external usb drive.

Thank you,
Roelof

Post Reply