You are not logged in.

#1 2017-02-16 04:20:46

HappyClown
Member
Registered: 2015-08-15
Posts: 161

[SOLVED] Installing to removable disk, various booting issues

I've decided to create a rescue installation onto a removable disk, which has gone pretty well. I've installed everything perfectly, it's just that I'm having issues properly configuring the bootloader (grub). First off, I tried booting as normal, and it failed. I then tried adding a custom entry, and wrote in my own parameters, attempting to use labels over UUID. It was a silly idea to have the label of the disk "recovery", as there was already a recovery partition on the HDD. I then switched back to using a UUID to identify the root partition. I did get pretty far with this, though I always end up booting into a recovery console because the kernel can't seem to find the device? (http://imgur.com/a/UZCCQ) I get the error, something like "Can't find device UUID=(the uuid)". I've then tried one more, to boot using the default entry, which loads the kernel and everything just fine, but then it shows a bunch of text in an unreadable form (http://imgur.com/a/xoHeq), and I get stuck in a recovery console that I can't read. I'm not entirely sure what to do at this point. There's nothing in the wiki and I'm not entirely sure how the grub entries are supposed to be written and how they work.

BONUS Kernel panic: http://imgur.com/a/CBeO6

/boot/grub/grub.cfg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod btrfs
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  14d957e1-6d4d-4b59-8d29-76989cc550ca
else
  search --no-floppy --fs-uuid --set=root 14d957e1-6d4d-4b59-8d29-76989cc550ca
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-14d957e1-6d4d-4b59-8d29-76989cc550ca' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod btrfs
	set root='hd2,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  14d957e1-6d4d-4b59-8d29-76989cc550ca
	else
	  search --no-floppy --fs-uuid --set=root 14d957e1-6d4d-4b59-8d29-76989cc550ca
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=14d957e1-6d4d-4b59-8d29-76989cc550ca rw  quiet
	echo	'Loading initial ramdisk ...'
	initrd  /boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-14d957e1-6d4d-4b59-8d29-76989cc550ca' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-14d957e1-6d4d-4b59-8d29-76989cc550ca' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod btrfs
		set root='hd2,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  14d957e1-6d4d-4b59-8d29-76989cc550ca
		else
		  search --no-floppy --fs-uuid --set=root 14d957e1-6d4d-4b59-8d29-76989cc550ca
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=14d957e1-6d4d-4b59-8d29-76989cc550ca rw  quiet
		echo	'Loading initial ramdisk ...'
		initrd  /boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-14d957e1-6d4d-4b59-8d29-76989cc550ca' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod btrfs
		set root='hd2,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  14d957e1-6d4d-4b59-8d29-76989cc550ca
		else
		  search --no-floppy --fs-uuid --set=root 14d957e1-6d4d-4b59-8d29-76989cc550ca
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=14d957e1-6d4d-4b59-8d29-76989cc550ca rw  quiet
		echo	'Loading initial ramdisk ...'
		initrd  /boot/initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "System shutdown" {
	echo "System shutting down..."
	halt
}

menuentry "System restart" {
	echo "System rebooting..."
	reboot
}

menuentry "Alternative boot" {
	search --set=root --label SashaRecovery
	linux /boot/vmlinuz-linux root=UUID=14d957e1-6d4d-4b59-8d29-76989cc550ca rw quiet
	initrd /boot/initramfs-linux.img
}


### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

/etc/default/grub

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter 
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" 
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper 
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

#GRUB_SAVEDEFAULT="true"

etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "System shutdown" {
	echo "System shutting down..."
	halt
}

menuentry "System restart" {
	echo "System rebooting..."
	reboot
}

menuentry "Alternative boot" {
	search --set=root --label SashaRecovery
	linux /boot/vmlinuz-linux root=UUID=14d957e1-6d4d-4b59-8d29-76989cc550ca rw quiet
	initrd /boot/initramfs-linux.img
}

Last edited by HappyClown (2017-02-16 21:02:28)

Offline

#2 2017-02-16 05:20:42

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] Installing to removable disk, various booting issues

It's good that you have posted the actual configuration files but it is not clear exactly what you have done to install the recovery system (e.g. did you install it from the main system or the live CD, how did you install it, did you install the MBR on the external drive, etc.)

For a recovery system, I recommend that the external disk be made completely independent of the main system. Mount the partitions of the external disk and install a full system using pacstrap either from your main system (after installing arch-install-scripts) or from the live CD. Follow the beginners' guide to install and configure grub on the recovery system, including the MBR and with its own configuration. Use UUIDs everywhere that supports them (grub, fstab, crypttab, etc.).

You should be able to boot the recovery system directly by changing the boot order in BIOS if need be.

Once that works, add an entry to chainload the external disk to your main system's grub configuration file, possibly with password protection (assuming grub supports it).

For more precise help, provide details of what you have done so far. The output of "lsblk -f" (with the external drive connected) will also be informative.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2017-02-16 05:28:50

HappyClown
Member
Registered: 2015-08-15
Posts: 161

Re: [SOLVED] Installing to removable disk, various booting issues

To clarify, I meant a rescue disk to be used mainly on Windows, not a recovery disk for Linux. I should've been more clear. I used an empty 2GiB microSD card, and put it in an SD adapter and put it in my arch computer (my main system). I then created a single partition and formatted it with a btrfs file system. I then used pacstrap to install the base and base-devel packages. I then chrooted into the device, configured the system and installed the grub package. After that, I installed grub to the disk, and created the configuration files. Afterwards, I'd exit and unmount the disk, and test it on my Windows laptop, and boot into it, giving the provided errors.

Offline

#4 2017-02-16 06:11:45

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] Installing to removable disk, various booting issues

Do you have grub installed on your Window's laptop? If yes, then chainloading the external disk should "just work" irrespective of the main OS on the laptop.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2017-02-16 06:21:15

HappyClown
Member
Registered: 2015-08-15
Posts: 161

Re: [SOLVED] Installing to removable disk, various booting issues

No, the Windows laptop doers not have grub on the HDD, but the SD has grub on it, which is what I'm booting into.

Offline

#6 2017-02-16 08:31:56

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] Installing to removable disk, various booting issues

I misunderstood the issue. I thought part of the problem was configuring the laptop to boot the recovery disk. I now understand that you are booting (chainloading) the disk directly (via BIOS or some other boot loader).

UUIDs are tied to the filesystem and should remain constant across systems as long as you don't reformat them. If grub on the recovery disk fails to find a disk or partition then you may have missed a UUID or entered it incorrectly. Double-check grub, fstab, crypttab, etc.

The kernel panic may be due to booting the default image if it was built on a different system. Either try booting the fallback image, or rebuild the kernel images on the laptop from the live CD (the better option). Obviously make sure that the system on the recovery disk is binary-compatible with the laptop itself.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#7 2017-02-16 21:01:56

HappyClown
Member
Registered: 2015-08-15
Posts: 161

Re: [SOLVED] Installing to removable disk, various booting issues

I reformatted and reinstalled everything using UUID over labels, and using the fallback initramfs instead of the default one, and it works perfectly. Thanks.

Offline

Board footer

Powered by FluxBB