Cannot boot unless external drive is plugged in

Hi all,
new member here. I am using Manjaro since > 2 years now and like it very much. I have an issue when booting I need to have the external drive plugged in. The external HDD is only meant for daily backups. The internal drive is encrypted with luks and the system is installed there. After booting up I have to decrypt and grub opens where I can select Manjaro, Advanced Settings or Uefi Settings. Afterwards if the external drive is plugged in Manjaro starts up and I can use the system as usual. If not it gets stuck with

/dev/mapper/luks-399 …

where I additionally see some numbers for files and blocks and “clean”.

After checking the external drive itself I see that there is boot and efi folder. This wasn’t the case before and I have no clue how or what exactly happened. My question is how to move the boot to the internal drive because if I do a cd on /boot I land in my external drive.
You will see from the parted output that the external is called Buffalo model: HD-PZU3

Output of parted -l

Model: BUFFALO HD-PZU3 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 
Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1000GB  1000GB  primary  ext4
Model: WDC PC SN720 SDAQNTW-512G-1001 (nvme)
Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:  Number  Start   End    Size    File system  Name  Flags
 1      2098kB  317MB  315MB   fat32              boot, esp
 2      317MB   494GB  494GB
 3      494GB   512GB  18,2GB

Output of inxi -Fza

System:    Kernel: 5.4.108-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
       parameters: BOOT_IMAGE=/boot/vmlinuz-5.4-x86_64 root=UUID=32c415d3-6800-4439-8fdc-de6ed962892a rw quiet 
       cryptdevice=UUID=399cc5be-ce83-4180-91f5-f5b13e8ee64b:luks-399cc5be-ce83-4180-91f5-f5b13e8ee64b 
       root=/dev/mapper/luks-399cc5be-ce83-4180-91f5-f5b13e8ee64b 
       resume=/dev/mapper/luks-399cc5be-ce83-4180-91f5-f5b13e8ee64b 
       Desktop: awesome 4.3 vt: 7 dm: LightDM 1.30.0 Distro: Manjaro Linux base: Arch Linux 
Machine:   Type: Laptop System: LENOVO product: 20L7CTO1WW v: ThinkPad T480s serial: <filter> Chassis: type: 10 
       serial: <filter> 
       Mobo: LENOVO model: 20L7CTO1WW v: SDK0J40697 WIN serial: <filter> UEFI: LENOVO v: N22ET49W (1.26 ) date: 09/13/2018 
Battery:   ID-1: BAT0 charge: 49.6 Wh (99.6%) condition: 49.8/57.0 Wh (87.4%) volts: 12.5 min: 11.5 model: SMP 01AV480 
       type: Li-poly serial: <filter> status: Unknown cycles: 132 
CPU:   Info: Quad Core model: Intel Core i7-8550U bits: 64 type: MT MCP arch: Kaby Lake note: check family: 6 
       model-id: 8E (142) stepping: A (10) microcode: E0 cache: L2: 8 MiB 
       flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 32012 
       Speed: 1553 MHz min/max: 400/4000 MHz Core speeds (MHz): 1: 1553 2: 1158 3: 1457 4: 1407 5: 1551 6: 1186 7: 1238 
       8: 1499 
       Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
       Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
       Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
       Type: meltdown mitigation: PTI 
       Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
       Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
       Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling 
       Type: srbds mitigation: Microcode 
       Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel UHD Graphics 620 vendor: Lenovo driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:5917 
       class-ID: 0300 
       Device-2: Chicony Integrated Camera (1280x720@30) type: USB driver: uvcvideo bus-ID: 1-8:4 chip-ID: 04f2:b604 
       class-ID: 0e02 serial: <filter> 
       Display: x11 server: X.org 1.20.10 driver: loaded: intel unloaded: modesetting alternate: fbdev,vesa 
       resolution: <missing: xdpyinfo> 
       OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.0.1 direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Lenovo driver: snd_hda_intel v: kernel alternate: snd_soc_skl 
       bus-ID: 00:1f.3 chip-ID: 8086:9d71 class-ID: 0403 
       Sound Server-1: ALSA v: k5.4.108-1-MANJARO running: yes 
       Sound Server-2: JACK v: 0.125.0 running: no 
       Sound Server-3: PulseAudio v: 14.2 running: yes 
       Sound Server-4: PipeWire v: 0.3.24 running: no 
Network:   Device-1: Intel Ethernet I219-V vendor: Lenovo driver: e1000e v: 3.2.6-k port: efa0 bus-ID: 00:1f.6 
       chip-ID: 8086:15d8 class-ID: 0200 
       IF: enp0s31f6 state: down mac: <filter> 
       Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel port: efa0 bus-ID: 3d:00.0 chip-ID: 8086:24fd 
       class-ID: 0280 
       IF: wlp61s0 state: up mac: <filter> 
       Device-3: Lenovo USB-C Hub type: USB driver: r8152 bus-ID: 4-1.1:3 chip-ID: 17ef:7214 class-ID: 0000 
       serial: <filter> 
       IF: enp60s0u1u1 state: down mac: <filter> 
       IF-ID-1: docker0 state: down mac: <filter> 
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 bus-ID: 1-7:3 chip-ID: 8087:0a2b 
       class-ID: e001 
       Report: This feature requires one of these tools: hciconfig/bt-adapter 
Drives:    Local Storage: total: 1.38 TiB used: 1.13 TiB (82.0%) 
       SMART Message: Required tool smartctl not installed. Check --recommends 
       ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital model: PC SN720 SDAQNTW-512G-1001 size: 476.94 GiB 
       block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 rotation: SSD serial: <filter> rev: 10114101 
       scheme: GPT 
       ID-2: /dev/sda maj-min: 8:0 type: USB vendor: Buffalo model: HD-PZU3 size: 931.48 GiB block-size: physical: 512 B 
       logical: 512 B serial: <filter> rev: 0001 scheme: MBR 
Partition: ID-1: / raw-size: 459.66 GiB size: 451.44 GiB (98.21%) used: 261.63 GiB (58.0%) fs: ext4 dev: /dev/dm-0 
       maj-min: 254:0 mapped: luks-399cc5be-ce83-4180-91f5-f5b13e8ee64b 
       ID-2: /boot raw-size: 931.48 GiB size: 916.74 GiB (98.42%) used: 892.45 GiB (97.4%) fs: ext4 dev: /dev/sda1 
       maj-min: 8:1 
       ID-3: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 408 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 
       maj-min: 259:1 
Swap:      Kernel: swappiness: 60 (default) cache-pressure: 100 (default) 
       ID-1: swap-1 type: partition size: 16.98 GiB used: 415 MiB (2.4%) priority: -2 dev: /dev/dm-1 maj-min: 254:1 
       mapped: luks-b815b978-0a32-4e75-abd0-66409c788ce9 
Sensors:   System Temperatures: cpu: 52.0 C mobo: N/A 
       Fan Speeds (RPM): cpu: 0 
Info:      Processes: 230 Uptime: 1h 01m wakeups: 1 Memory: 15.41 GiB used: 3.73 GiB (24.2%) Init: systemd v: 247 
       tool: systemctl Compilers: gcc: 10.2.0 clang: 11.1.0 Packages: pacman: 1573 lib: 433 Shell: Zsh v: 5.8 
       running-in: tilix inxi: 3.3.03 

If you need more infos or something is unclear let me know. Thank you for the help.

Hello @Argus1 :wink:

I would assume that you have added your external drive to /etc/fstab. And therefore it sucks the boot process. It tries to mount it, but failed. Remove quiet from the kernel parameter on grub and you will see more.

1 Like

Hi @megavolt ,
I unplugged the drive, removed “quiet” when the laptop starts from grub menu and got following:

Timed out waiting for device /dev/disk/by-uuid/b34938a1- ... 
Dependency failed on /boot
Dependency failed on /boot/efi
Dependency failed for Local File System 

cat /etc/fstab shows:

UUID=1984-F56E	/boot/efi	vfat	defaults,noatime	0	2
UUID=32c415d3-6800-4439-8fdc-de6ed962892a	/	ext4	defaults,noatime	0	1
/dev/mapper/luks-b815b978-0a32-4e75-abd0-66409c788ce9	swap	swap	defaults,noatime	0	2
UUID=b34938a1-2b20-47f4-b980-2ebb1a317f60	/boot	ext4	defaults	0	0

The last entry would be the drive?

Also from inside the system I cannot do sudo update-grub. Not sure if it is related:

/usr/bin/grub-editenv: error: cannot open `//boot/grub/grubenv.new': No such file or directory.
/usr/bin/grub-mkconfig: line 262: /boot/grub/grub.cfg.new: No such file or directory

Your external drive /dev/sda1 is mounted here on /boot. Move the files to your nvme and mount it somewhere else. /media/backup is a good place. Create the directories first :wink:

Btw… how on earth did you come to that idea to mount an external drive on /boot ? This way the external drive holds all boot files… xD

Hi,
I moved boot and efi from the external to $HOME, unmounted + unplugged the ext. drive and copied boot efi back to root. Rebooted but the issue persisted. Do I need to change a boot flag?

Don’t ask me how this happened, I always mount to /run/media/ but I suspect this while doing some backup restoration process with timeshift I did sometime ago :pensive:

What exactly persist?

I guess you have to reinstall grub completely. Or just remove this /boot/grub/grub.cfg.new and recreate the config: sudo update-grub

Hope you remove this from fstab:

1 Like

That’s not the right place, /boot has to be moved into / directory on your nvme drive. This should be done from a live ISO boot.
/boot/efi was already OK, not a good idea to move that one, too.

I agree with @megavolt, best completely reinstall grub.

The question is how this happened? Have you maybe used a wrong syntax in restoring grub recently?

I don’t see any grub.cfg.new and sudo update-grub gives me

/usr/bin/grub-editenv: error: cannot open `//boot/grub/grubenv.new': No such file or directory.
/usr/bin/grub-mkconfig: line 262: /boot/grub/grub.cfg.new: No such file or directory

I meant the issue that I have to plug in the external drive to boot into the system.

The line in fstab is removed.

Are the permissions correct?

ls -la /boot/grub/

It should look like this one:

ls -la /boot/grub/                                                                                                 
insgesamt 20
drwxr-xr-x 1 root root    84 12. Apr 16:55 .
drwxr-xr-x 1 root root   444  9. Apr 13:59 ..
drwxr-xr-x 1 root root    22 30. Jan 03:38 fonts
-rw-r--r-- 1 root root 16044 12. Apr 16:55 grub.cfg
-rw-r--r-- 1 root root  1024 30. Jan 03:38 grubenv
drwxr-xr-x 1 root root   536 30. Jan 03:38 locale
drwxr-xr-x 1 root root    18 30. Jan 03:38 themes
drwxr-xr-x 1 root root  6284 30. Jan 03:38 x86_64-efi

/boot and efi are in / on nvme.

I copied it to home and back to / I misunderstood megavolt.

The reinstallation of grub should be done from live iso as well?

Yes. best follow this guide:

https://wiki.manjaro.org/index.php?title=GRUB/Restore_the_GRUB_Bootloader

No I don’t see the grub.cfg or grubenv.

Then I will attempt the grub restore, most likely on the weekend and come back to you to report how it went :sweat_smile:

Fast report coming in.
I rebooted without the external drive and booted into the system. The solution was to remove the line from /etc/fstab as @megavolt had suggested. Afterwards I could sudo update-grub and the grub files reappeared.

ls -la /boot/grub/: 
drwxr-xr-x 2 root root  4096  9. Dez 2018  fonts
-rw------- 1 root root 10941 14. Apr 19:24 grub.cfg
-rw-r--r-- 1 root root  1024  5. Sep 2019  grubenv
drwxr-xr-x 3 root root  4096  9. Dez 2018  themes
drwxr-xr-x 2 root root 12288  9. Dez 2018  x86_64-efi

I still see an empty efi folder on the external drive which I can remove I suppose?

Thanks a lot @megavolt, @Wollie !

1 Like

Really I wonder myself. I didn’t play around with the grub config for a long time.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.