You are not logged in.

#1 2015-04-11 11:05:52

Slashee the Cow
Member
Registered: 2015-04-11
Posts: 16

[SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

So I installed Arch and it all seemed to go reasonably well (well, had a little trouble installing GRUB to begin with, but I think that's just because I needed a BIOS boot partition at the start of the drive). I installed it onto a 4TB I have, which due to its size has a GPT partition table even though my mobo (Gigabyte GA-P67A-UD4-B3, don't think it matters though) uses a regular old BIOS. Initially it was two partitions, the Microsoft reserved partition then a big NTFS data partition. I shrunk the NTFS partition and then made (in this order on the disk, starting at third) an ext4 partition for /boot, a swap partition, and a big btrfs partition (in which I created subvolumes for /, /etc, /home and /var). GRUB wouldn't install (I forgot the exact error) but what I could find suggested it was because there needed to be room for it at the start of the disk, so I deleted the Microsoft reserved partition (Windows is installed on an SSD, and its bootloader is on another hard drive entirely, so I didn't think I needed it) and created an empty partition with the right code using gdisk, then I could install GRUB to the 4TB HDD.

Unfortunately, when I try to boot into GRUB it immediately comes up with error: unknown filesystem and dumps me at the GRUB rescue prompt. Using ls, I can see my HDDs and their partitions, but whenever I try to use (for example) ls (hd0,gpt3)/ - which I think should probably be the ext4 boot partition, but it does this for everything - it just says error: unknown filesystem again.

This seems pretty close to (if not exactly the same as) my problem, so I tried what he suggested, but when I tried to run the command he says worked, (grub-install --recheck --disk-module=native /dev/sda) - and don't worry, I didn't do that blindly, I know /dev/sda is my 4TB HDD - I just get the error grub-install: --disk-module: (PROGRAM ERROR) Option should have been recognized!?. So I'm all out of ideas and I've been trying for a few hours. Please help me, before I go insane... more insane. I can boot the USB drive I used to install Arch and chroot into my installation, but I haven't found a way to actually boot the installation yet.

SOLVED: Apparently the partition I was using for /boot was too far back on the drive (past the first 2TB). When I shuffled partitions around so that the /boot partition was near the start of the drive (it starts at sector 2048 now!) that seemed to fix it.

Last edited by Slashee the Cow (2015-04-12 15:36:51)

Offline

#2 2015-04-11 12:58:39

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

You're sure the /boot partition has a valid ext2/3/4 filesystem on it?

Can you post the output of these commands (after you're booted, mounted, and chrooted)?

lsblk
mount
echo "p" | gdisk /dev/sda

Offline

#3 2015-04-11 13:31:24

Slashee the Cow
Member
Registered: 2015-04-11
Posts: 16

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

Pretty sure. I ran mkfs.ext4 on it, and I can see the files for GRUB are there.

lsblk

NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0   3.7T  0 disk 
├─sda1            8:1    0   128M  0 part 
├─sda2            8:2    0   2.7T  0 part 
├─sda3            8:3    0 953.5M  0 part /boot
├─sda4            8:4    0     8G  0 part [SWAP]
└─sda5            8:5    0 967.6G  0 part /
sdb               8:16   0   1.8T  0 disk 
└─sdb1            8:17   0   1.8T  0 part 
sdc               8:32   0 232.9G  0 disk 
└─sdc1            8:33   0 232.9G  0 part 
sdd               8:48   0 931.5G  0 disk 
└─sdd1            8:49   0 931.5G  0 part 
sde               8:64   0 465.8G  0 disk 
├─sde1            8:65   0  91.8G  0 part 
├─sde2            8:66   0 312.5G  0 part 
├─sde3            8:67   0     1K  0 part 
└─sde5            8:69   0  53.7G  0 part 
sdf               8:80   1  30.2G  0 disk 
└─sdf1            8:81   1  30.2G  0 part 
sdg               8:96   0  29.8G  0 disk 
└─sdg1            8:97   0  29.8G  0 part 
sr0              11:0    1     3G  0 rom  
loop0             7:0    0 258.9M  1 loop 
loop1             7:1    0    32G  1 loop 
└─arch_airootfs 254:0    0    32G  0 dm   /etc/resolv.conf
loop2             7:2    0   256M  0 loop 
└─arch_airootfs 254:0    0    32G  0 dm   /etc/resolv.conf

mount

/dev/sda5 on / type btrfs (rw,relatime,space_cache)
/dev/sda3 on /boot type ext4 (rw,relatime,data=ordered)
/dev/sda5 on /home type btrfs (rw,relatime,space_cache)
/dev/sda5 on /var type btrfs (rw,relatime,space_cache)
/dev/sda5 on /etc type btrfs (rw,relatime,space_cache)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (ro,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=4069592k,nr_inodes=1017398,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
tmp on /tmp type tmpfs (rw,nosuid,nodev)
/dev/mapper/arch_airootfs on /etc/resolv.conf type ext4 (rw,relatime)

echo "p" | gdisk /dev/sda (I didn't realise an Arch install was so minimal that I'd even have to install this!)

GPT fdisk (gdisk) version 1.0.0

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): Disk /dev/sda: 7814037168 sectors, 3.6 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 64163631-B676-4FFD-8AD0-89E8AA7A86F9
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 7814037134
Partitions will be aligned on 2048-sector boundaries
Total free space is 4659 sectors (2.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          264191   128.0 MiB   EF02  BIOS boot partition
   2          264192      5766035455   2.7 TiB     0700  Basic data partition
   3      5766035456      5767988281   953.5 MiB   8300  Linux /boot
   4      5767989248      5784766463   8.0 GiB     8200  Linux Swap
   5      5784766464      7814035455   967.6 GiB   8300  Linux btrfs

Command (? for help): 

Offline

#4 2015-04-11 13:47:54

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

It could be that the ext2 module isn't being loaded for some odd reason, or that grub-install auto-detected the boot and root partitions incorrectly. Try something like this in the GRUB rescue shell

insmod ext2
set prefix=(hd0,gpt3)/grub
set root=(hd0,gpt2)
insmod normal
normal

GRUB should be able to boot from ext4 ordinarily, but it might be worth testing it under ext2.

mkfs.ext2 /dev/sda3
mkinitcpio -p linux
grub-mkconfig -o /boot/grub/grub.cfg

Offline

#5 2015-04-11 14:25:46

Slashee the Cow
Member
Registered: 2015-04-11
Posts: 16

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

No luck. Rescue shell behaves the same after using insmod ext2 (which, at least, doesn't throw an error, unlike insmod normal) and I still can't use ls to see the contents of any partition I try. Recreating the boot partition as ext2 didn't seem to change anything either.

Offline

#6 2015-04-11 14:38:08

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

I'm starting to run out of ideas. Can you try using /boot inside the root partition?

rm -r /boot/*
umount /boot
mkinitcpio -p linux
grub-mkconfig -o /boot/grub/grub.cfg
grub-install --recheck --disk-module=native /dev/sda

If that doesn't work, can you post your grub.cfg?

Offline

#7 2015-04-11 15:11:08

Slashee the Cow
Member
Registered: 2015-04-11
Posts: 16

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

Tried moving /boot inside the root partition (although technically, it'll be in a btrfs subvolume (the default subvolume) of the main btrfs partition, since I'm only using subvolumes, the top level volume isn't mounted anywhere). Not sure if it matters (it might only matter if I can actually get Linux to boot) but I also generated a new fstab without the boot partition in it.

Also, while your instructions said to use --disk-module=native on grub-install, that gives me an error (grub-install: --disk-module: (PROGRAM ERROR) Option should have been recognized!?) which I mentioned in my original post (so I ran grub-install without it).

Still... no luck. (Thanks for trying though!)

Here's my grub.cfg (with /boot just being in the root volume, not its own partition):

#
# 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_gpt 
insmod btrfs
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  b21e6211-5e7a-4769-9f53-b9b5d554a242
else
  search --no-floppy --fs-uuid --set=root b21e6211-5e7a-4769-9f53-b9b5d554a242
fi
    font="/root/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-b21e6211-5e7a-4769-9f53-b9b5d554a242' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt 
	insmod btrfs
	set root='hd0,gpt5'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  b21e6211-5e7a-4769-9f53-b9b5d554a242
	else
	  search --no-floppy --fs-uuid --set=root b21e6211-5e7a-4769-9f53-b9b5d554a242
	fi
	echo	'Loading Linux linux ...'
	linux	/root/boot/vmlinuz-linux root=UUID=b21e6211-5e7a-4769-9f53-b9b5d554a242 rw rootflags=subvol=root  quiet
	echo	'Loading initial ramdisk ...'
	initrd	 /root/boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-b21e6211-5e7a-4769-9f53-b9b5d554a242' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-b21e6211-5e7a-4769-9f53-b9b5d554a242' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt 
		insmod btrfs
		set root='hd0,gpt5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  b21e6211-5e7a-4769-9f53-b9b5d554a242
		else
		  search --no-floppy --fs-uuid --set=root b21e6211-5e7a-4769-9f53-b9b5d554a242
		fi
		echo	'Loading Linux linux ...'
		linux	/root/boot/vmlinuz-linux root=UUID=b21e6211-5e7a-4769-9f53-b9b5d554a242 rw rootflags=subvol=root  quiet
		echo	'Loading initial ramdisk ...'
		initrd	 /root/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-b21e6211-5e7a-4769-9f53-b9b5d554a242' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt 
		insmod btrfs
		set root='hd0,gpt5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  b21e6211-5e7a-4769-9f53-b9b5d554a242
		else
		  search --no-floppy --fs-uuid --set=root b21e6211-5e7a-4769-9f53-b9b5d554a242
		fi
		echo	'Loading Linux linux ...'
		linux	/root/boot/vmlinuz-linux root=UUID=b21e6211-5e7a-4769-9f53-b9b5d554a242 rw rootflags=subvol=root  quiet
		echo	'Loading initial ramdisk ...'
		initrd	 /root/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 ###
menuentry 'Windows Vista (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-4E94BAB294BA9C41' {
	insmod part_gpt 
	insmod ntfs
	set root='hd1,gpt1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  4E94BAB294BA9C41
	else
	  search --no-floppy --fs-uuid --set=root 4E94BAB294BA9C41
	fi
	chainloader +1
}
menuentry 'Windows Vista (loader) (on /dev/sde1)' --class windows --class os $menuentry_id_option 'osprober-chain-CEF01053F010445D' {
	insmod part_msdos 
	insmod ntfs
	set root='hd4,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd4,msdos1 --hint-efi=hd4,msdos1 --hint-baremetal=ahci4,msdos1  CEF01053F010445D
	else
	  search --no-floppy --fs-uuid --set=root CEF01053F010445D
	fi
	chainloader +1
}
menuentry 'Windows Vista (loader) (on /dev/sde5)' --class windows --class os $menuentry_id_option 'osprober-chain-4E94BAB294BA9C41' {
	insmod part_msdos 
	insmod ntfs
	set root='hd4,msdos5'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd4,msdos5 --hint-efi=hd4,msdos5 --hint-baremetal=ahci4,msdos5  4E94BAB294BA9C41
	else
	  search --no-floppy --fs-uuid --set=root 4E94BAB294BA9C41
	fi
	chainloader +1
}
### 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.
### 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 ###

### BEGIN /etc/grub.d/60_memtest86+ ###
### END /etc/grub.d/60_memtest86+ ###

Offline

#8 2015-04-11 20:03:05

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

Did you run grub-install from inside the chroot, or with `--boot-directory=/mnt/boot`?

Offline

#9 2015-04-12 00:12:27

Slashee the Cow
Member
Registered: 2015-04-11
Posts: 16

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

From inside the chroot. Think I should try it from outside, setting the boot directory like you said? (But if I do that, will it use the right config file? Or do I just have to chroot in and run grub-mkconfig afterwards?)

Offline

#10 2015-04-12 02:37:36

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

Installing from within the chroot is preferred, but in this case it might be worth trying outside the chroot

grub-install --boot-directory=/mnt/boot/grub /dev/sda
grub-mkconfig -o /mnt/boot/grub/grub.cfg

I've never done it this way, so I don't know what problems it might cause (with the fs prober, for example).

Alternatively, you can try the same recovery shell commands I mentioned above, but with

insmod btrfs

this time, since /boot is now inside a btrfs filesystem.

If nothing else works, is it an option to install grub to another disk, or repartition /dev/sda?

Offline

#11 2015-04-12 04:18:53

Slashee the Cow
Member
Registered: 2015-04-11
Posts: 16

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

Tried using insmod btrfs in the grub rescue shell last night. Didn't work, can't remember if the insmod command itself gave me an error or whether it still couldn't see any files or anything. Tried it again today, but that was after I converted /dev/sda3 back to ext4 and mounted it at /boot (since it being ext2 wasn't working, and not using it wasn't working, so I figure what's the harm) and I just got error: unknown filesystem.

Anyway: using grub-install from outside chroot seems to work (still can't use --disk-module), but grub-mkconfig just generates this:

#
# 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 ext2
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  ec4cf3cd-d72d-4988-a2ce-421f45d52824
else
  search --no-floppy --fs-uuid --set=root ec4cf3cd-d72d-4988-a2ce-421f45d52824
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 ###

### 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.
### 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 ###

### BEGIN /etc/grub.d/60_memtest86+ ###
if [ "${grub_platform}" == "pc" ]; then
    menuentry "Memory Tester (memtest86+)" --class memtest86 --class gnu --class tool {
        search --fs-uuid --no-floppy --set=root  ec4cf3cd-d72d-4988-a2ce-421f45d52824
        linux16 /boot/memtest86+/memtest.bin 
    }
fi
### END /etc/grub.d/60_memtest86+ ###

I'm not an expert on GRUB configuration files, but I figured that even if that didn't just boot me straight to the rescue shell, it wasn't going to boot anything... other than memtest86+ maybe. So I went back into chroot and run grub-mkconfig and it generated this:

#
# 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_gpt 
insmod btrfs
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  b21e6211-5e7a-4769-9f53-b9b5d554a242
else
  search --no-floppy --fs-uuid --set=root b21e6211-5e7a-4769-9f53-b9b5d554a242
fi
    font="/root/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-b21e6211-5e7a-4769-9f53-b9b5d554a242' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt 
	insmod ext2
	set root='hd0,gpt3'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  184916fd-57a7-48cf-858e-93a5d339ade2
	else
	  search --no-floppy --fs-uuid --set=root 184916fd-57a7-48cf-858e-93a5d339ade2
	fi
	echo	'Loading Linux linux ...'
	linux	/vmlinuz-linux root=UUID=b21e6211-5e7a-4769-9f53-b9b5d554a242 rw rootflags=subvol=root  quiet
	echo	'Loading initial ramdisk ...'
	initrd	 /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-b21e6211-5e7a-4769-9f53-b9b5d554a242' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-b21e6211-5e7a-4769-9f53-b9b5d554a242' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt 
		insmod ext2
		set root='hd0,gpt3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  184916fd-57a7-48cf-858e-93a5d339ade2
		else
		  search --no-floppy --fs-uuid --set=root 184916fd-57a7-48cf-858e-93a5d339ade2
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=b21e6211-5e7a-4769-9f53-b9b5d554a242 rw rootflags=subvol=root  quiet
		echo	'Loading initial ramdisk ...'
		initrd	 /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-b21e6211-5e7a-4769-9f53-b9b5d554a242' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt 
		insmod ext2
		set root='hd0,gpt3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  184916fd-57a7-48cf-858e-93a5d339ade2
		else
		  search --no-floppy --fs-uuid --set=root 184916fd-57a7-48cf-858e-93a5d339ade2
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=b21e6211-5e7a-4769-9f53-b9b5d554a242 rw rootflags=subvol=root  quiet
		echo	'Loading initial ramdisk ...'
		initrd	 /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 ###
menuentry 'Windows Vista (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-4E94BAB294BA9C41' {
	insmod part_gpt 
	insmod ntfs
	set root='hd1,gpt1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  4E94BAB294BA9C41
	else
	  search --no-floppy --fs-uuid --set=root 4E94BAB294BA9C41
	fi
	chainloader +1
}
menuentry 'Windows Vista (loader) (on /dev/sde1)' --class windows --class os $menuentry_id_option 'osprober-chain-CEF01053F010445D' {
	insmod part_msdos 
	insmod ntfs
	set root='hd4,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd4,msdos1 --hint-efi=hd4,msdos1 --hint-baremetal=ahci4,msdos1  CEF01053F010445D
	else
	  search --no-floppy --fs-uuid --set=root CEF01053F010445D
	fi
	chainloader +1
}
menuentry 'Windows Vista (loader) (on /dev/sde5)' --class windows --class os $menuentry_id_option 'osprober-chain-4E94BAB294BA9C41' {
	insmod part_msdos 
	insmod ntfs
	set root='hd4,msdos5'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd4,msdos5 --hint-efi=hd4,msdos5 --hint-baremetal=ahci4,msdos5  4E94BAB294BA9C41
	else
	  search --no-floppy --fs-uuid --set=root 4E94BAB294BA9C41
	fi
	chainloader +1
}
### 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.
### 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 ###

### BEGIN /etc/grub.d/60_memtest86+ ###
### END /etc/grub.d/60_memtest86+ ###

Still didn't work though.

I don't know grub config, but is the UUID specified in

linux	/vmlinuz-linux root=UUID=b21e6211-5e7a-4769-9f53-b9b5d554a242 rw rootflags=subvol=root  quiet

supposed to be the UUID for /boot or /? Because the UUID there is for the btrfs partition being mounted at / (which I guess would explain why it has the correct subvol listed, which I'm not sure if it's necessary, given that should be the default subvolume). So... that's probably alright (just something that stood out to me).

As for installing grub on another disk: I suppose I could try, though I'd rather keep it on one drive if I can (sometimes it gets complicated enough having Windows and my Windows bootloader on different drives... I should probably try moving the Windows bootloader to the SSD where Windows is installed. Would it matter which drive? The options are:

  • sda: 4TB, GPT table, the one I'm having problems with now

  • sdb: 2TB, MBR table, nothing in boot sector AFAIK

  • sdc: 240GB SSD, GPT table, would rather not use it since Windows is installed on there, even if its bootloader isn't

  • sdd: 1TB, MBR table, nothing in boot sector AFAIK

  • sde: 500GB, MBR table, has the Windows bootloader so I'd rather not mess that up (although given it's the smallest and I have no free SATA ports, it'll be next to go when I need more space, so I might want to move the bootloader)

(sdf and sdg which appear in lsblk earlier are just USB flash drives, and I'd rather not have to rely on having to use one of them to boot Linux).

As for repartitioning /dev/sda: as long as I can do it non-destructively, sure. Well I mean non-destructively for the NTFS partition, which is mostly full of Steam games (and I might have enough room on other drives and portable drives to keep the rest safe), but on my crappy Australian internet connection (aren't they all) it'd probably take me a couple of weeks to redownload them. I don't mind if I have to get rid of the Linux partitions, I already tried going through the install again once before to try to get it to work, another time isn't going to matter. So I guess I could try using gparted to delete the Linux partitions, move the NTFS partition to the end of the disk, and recreate the Linux partitions in front of it (although moving that much data might take a while, so I'd probably want to do it overnight). For reference, right now it's:

  1. 128MB of unformatted space (where the Microsoft reserved partition was, but now it's flagged as a BIOS boot partition, even though it's far bigger than it needs to be for that, I didn't feel like moving the other partitions back just to claim less than 128MB)

  2. ~2.7TB NTFS data partition (important)

  3. ~1GB ext4 /boot partition

  4. 8GB swap partition

  5. ~1TB btrfs partition with subvolumes mounted at /, /home, /etc and /var

Offline

#12 2015-04-12 13:13:40

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

Slashee the Cow wrote:

I don't know grub config, but is the UUID specified in

linux    /vmlinuz-linux root=UUID=b21e6211-5e7a-4769-9f53-b9b5d554a242 rw rootflags=subvol=root  quiet

supposed to be the UUID for /boot or /? Because the UUID there is for the btrfs partition being mounted at / (which I guess would explain why it has the correct subvol listed, which I'm not sure if it's necessary, given that should be the default subvolume). So... that's probably alright (just something that stood out to me).

On this line, that UUID should be the one for / because it is being passed as the value to the kernel parameter named "root". This tells the kernel which filesystem to mount when early userspace finishes.

search --no-floppy --fs-uuid --set=root ec4cf3cd-d72d-4988-a2ce-421f45d52824
search --no-floppy --fs-uuid --set=root b21e6211-5e7a-4769-9f53-b9b5d554a242

On these lines, it should be the filesystem where /boot is located. These are GRUB commands (in contrast to kernel parameters), and the fact that GRUB calls it "root" is confusing, but distinct from what the kernel calls "root". As for which one is correct, you can run blkid(8) and compare the UUIDs or post the output here. The fact that it is detecting different filesystems for /boot could be problematic, but without knowing your UUIDs, I can't say which one is right.

I proposed the idea of installing GRUB on another device just in case GRUB is getting confused about which partition it should be reading. Since the core GRUB code is being executed (and producing the unknown filesystem error), there shouldn't be any reason you couldn't correct the grub.cfg file manually, but installing to another disk might be easier. The only requirements are that the BIOS will boot from (read the MBR code of) the device, and that it has a "BIOS boot partition" aka. "Post-MBR gap" for GRUB stage-2 to be installed in.

Repartitioning should be treated as a last resort, because even tools that support non-destructive resizing/moving like gparted can in reality be destructive by nature, and you should not attempt repartitioning without a backup. I suggested it only because your partition layout on /dev/sda is a little messy, but once again you should be able to correct grub.cfg manually instead.

The only thing that stands out to me is that your /boot partition is not within the first 2TB of the drive, and I seem to vaguely remember reading somewhere that GRUB has trouble with this. Is it possible for you to delete your "BIOS boot partition" and replace it with a 128MiB type 8300 /boot partition, then create a 1007KiB type EF02 "BIOS boot partition" at the beginning of the disk? Note that you have to create the BIOS boot partition last so that gdisk will not try to 2048-sector align it (it should typically start at sector 34, and end at 2047, resulting in 1007KiB). This will give you a /boot partition within the first 2TB.

Offline

#13 2015-04-12 13:46:08

Slashee the Cow
Member
Registered: 2015-04-11
Posts: 16

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

I ran lsblk -f earlier (and in what obviously seemed like a good idea at the time, saved the results), which seems to also show the UUIDs:

NAME            FSTYPE   LABEL              UUID                                 MOUNTPOINT
sda                                                                              
├─sda1                                                                           
├─sda2          ntfs     Barracuda          9E20D08B20D06BB1                     
├─sda3          ext4     Linux /boot        184916fd-57a7-48cf-858e-93a5d339ade2 /mnt/boot
├─sda4          swap     Linux swap         c7b1f7e1-8a63-43ff-892e-74013a5d6c12 [SWAP]
└─sda5          btrfs    Linux btrfs        b21e6211-5e7a-4769-9f53-b9b5d554a242 /mnt/
sdb                                                                              
└─sdb1          ntfs                        4E94BAB294BA9C41                     
sdc                                                                              
└─sdc1          ntfs     GREEN              0EFA33CCFA33AEB9                     
sdd                                                                              
└─sdd1          ntfs                        DE10FB3310FB10EF                     
sde                                                                              
├─sde1          ntfs                        CEF01053F010445D                     
├─sde2          ntfs                        714F530C051C8FCF                     
├─sde3                                                                           
└─sde5          ntfs                        4E94BAB294BA9C41                     
sdf                                                                              
└─sdf1          vfat     MULTLIBOOT         7202-4877                            /run/archiso/bootmnt
sdg                                                                              
└─sdg1          vfat     ITSAUSB            1168-0955                            /mntusb
sr0             udf      GRMCPRXFRER_EN_DVD 2009-07-14-02-29-38-00               
loop0           squashfs                                                         /run/archiso/sfs/airootfs
loop1           ext4                        ec4cf3cd-d72d-4988-a2ce-421f45d52824 
└─arch_airootfs ext4                        ec4cf3cd-d72d-4988-a2ce-421f45d52824 /
loop2           ext4                        ec4cf3cd-d72d-4988-a2ce-421f45d52824 
└─arch_airootfs ext4                        ec4cf3cd-d72d-4988-a2ce-421f45d52824 /

So I guess I need to open my grub.cfg, find lines that don't refer to the /boot partition (in the grub script, not the boot entries, duh), change them and see if that works. If that doesn't work, I'll try repartitioning like you said (I know that like you said, repartitioning is dangerous, but should be alright if I'm not actually changing my data partitions, I guess).

Also: to see if I did anything wrong, I created a new virtual machine in VirtualBox and tried to set it up basically the same way (except that I didn't have a honking great NTFS partition at the front of the drive). The bootloader ran successfully, so it's obviously a problem with my setup. (Also, I couldn't get the virtual instance of Arch to boot properly - the bootloader worked though - but the rest is a story for another day).

Offline

#14 2015-04-12 15:34:32

Slashee the Cow
Member
Registered: 2015-04-11
Posts: 16

Re: [SOLVED] Grub boots to rescue mode err: unknown filesystem every drive

Thanks! Nothing I could do to grub.cfg seemed to fix it, but changing the partitions like you suggested worked. I can get past the bootloader. Now I just need to figure out how to stop the errors that are preventing it actually booting, but I figured that was a different enough problem for a different thread.

Offline

Board footer

Powered by FluxBB