You are not logged in.

#1 2012-11-18 15:01:29

Cromulent
Member
From: United Kingdom
Registered: 2011-08-28
Posts: 52

Broke Grub2 install - now can't mount EFI system partition in r/w

So I decided to disable IPv6 completely as I my ISP does not support it and I have no use for it on my local network. Reading the wiki said to add "ipv6.disable=1" to the kernel parameters. So I edited /etc/default/grub and added the parameter to the GRUB_CMDLINE_LINUX_DEFAULT="" section. I then regenerated the grub.cfg file with the grub-mkconfig tool. When I rebooted Grub2 dropped me into the Grub shell and wouldn't let me boot at all.

So I restarted using the Arch Linux install media and mounted all my drives but no matter how I tried (and I used various options such as mount -t vfat /dev/sda1 /mnt/boot/efi -o rw) I couln't get the EFI system partition to mount in read / write mode. It constantly told me I did not have write permissions to any of the files on it. Does anyone know how I can fix this so I can get my system booting again? I'm at a loss. I could fix it if I had write access to the partition but it seems like I don't.

Offline

#2 2012-11-18 15:32:24

weirddan455
Member
Registered: 2012-04-15
Posts: 192

Re: Broke Grub2 install - now can't mount EFI system partition in r/w

Try unmounting all your other partitions first to eliminate as many variables as possible.  Then only mount your EFI partition.  It doesn't matter where it gets mounted either.

cd /mnt
mkdir efisys
mount /dev/sda1 /mnt/efisys

Again I just made up the name "efisys".  You can call it whatever you like.  Also substitute /dev/sda1 for where your partition actually is.

Another thing you may want to look into is using the EFISTUB instead of GRUB.  It's built into the kernel directly and is IMO much easier and reliable than GRUB.  It's also recommended in the wiki.  You can use a boot manager like rEFInd or gummiboot if you're multibooting as well.  Again, this is up to you but it may save you some headaches in the future.

Offline

#3 2012-11-18 16:50:14

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Broke Grub2 install - now can't mount EFI system partition in r/w

Have you fscked the partition?  Maybe inconsistencies are keeping from being mounted r/w.  Sometimes this is done to protect further damage to the filesystem.  Use dosfsck.

I would recommend gummiboot.  Since UEFI can load more than 446bytes on boot, this makes boot loaders kind of redundant in functionality.  I think you are probably using grub2 for the boot manager functionality.  That is the menu of grub (and the ability to change the kernel command line before booting).  This functionality can be achieved with both gummiboot and rEFInd, as weirddan455 mentioned above.  This is conbined with the kernels ability to boot itself (EFI Stub).

I use gummiboot, as it is a super simple text olny interface.  But if you use grub because it can be made pretty, you should check out rEFInd.  It is much prettier than grub, and I recently found out that it too has a simple text only mode.

If nothing else, using a boot manager over a full boot loader with uefi will certainly be faster, as there is not nearly as much crap to load.  This is especially true with how bloate grub2 is. 

Anyway, I guess you should fix the r/o issue first.  I think if all else fails, copy the contents to another partition/drive, and then reformat it and cpoy the stuff back.

Offline

#4 2012-11-18 19:14:17

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Broke Grub2 install - now can't mount EFI system partition in r/w

WonderWoofy wrote:

Have you fscked the partition?  Maybe inconsistencies are keeping from being mounted r/w.  Sometimes this is done to protect further damage to the filesystem.  Use dosfsck.

This was also one of my initial thoughts to the problem. The other is that FAT doesn't support Linux-style ownership and permissions, so those depend on mount-time options. If you mount the filesystem with default options, it will normally have ownership by root and give read/write access to root alone. Thus, if you tried to write to the filesystem as any other user, it might easily fail; or if you mounted with more restrictive options (as might be present in your /etc/fstab file for some reason), you might not be able to write to the filesystem even as root. You can learn what the current permissions are by doing a long listing, as in:

$ ls -l /boot/efi
total 1
drwxr-xr-x 5 root root 512 Nov  8 19:57 EFI
-rw-r--r-- 1 root root   0 Nov 18 14:02 foo

This example shows ownership by root with 0644 permissions on files (such as foo in this example) and 0755 permissions on directories (EFI in this example).

You can change permissions by using the umask, dmask, and fmask options to mount, which set the permissions to be removed from all files (including directories), directories, and normal (non-directory) files, respectively. The uid and gid options set ownership and group ownership. For instance, if you want to give everybody in the group with a GID of 1001 write access to the filesystem, and keep everybody else from even reading the files on it, you could use something like this:

mount -o dmask=0007,fmask=0117,gid=1001 /dev/sda1 /boot/efi

There are of course numerous variants on this. Using a single mount command like this will adjust permissions until you reboot the computer or unmount the filesystem. To make the change permanent, you'd need to move the options into your /etc/fstab file.

Offline

#5 2012-11-19 00:50:11

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: Broke Grub2 install - now can't mount EFI system partition in r/w

Maybe I'm being dumb, but why do you need to mount the efi partition at all? The error is in /etc/... and presumably this is on your root partition. When you regenerated grub.cfg, this will have ended up under /boot. So if you have a separate /boot, you also need to mount that. (If not, you just need to mount your root partition.)

Nothing on your efi partition should have been altered by your initial changes.

Last edited by cfr (2012-11-19 00:50:34)


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

Board footer

Powered by FluxBB