Are there any available methods so that I can edit my /etc/grub.d/40_custom from a LiveCD or such? I really need to edit that file. Thank you.
Assuming the root partition of the Ubuntu installation on the hdd is sda1
, mount it to /mnt
sudo mount /dev/sda1 /mnt
If the root filesystem is not on on sda1
use e.g sudo fdisk -l
to find the correct identifier.
Open the file /mnt/etc/grub.d/40_custom
with your favorite editor, e.g
sudo nano /mnt/etc/grub.d/40_custom
Make any changes you feel necessary. Best to make a backup beforehand.
Now you need to update Grub.
a. Mount the kernel filesystems to their appropriate places
sudo mount --rbind /dev /mnt/dev
sudo mount --rbind /sys /mnt/sys
sudo mount -t proc proc /mnt/proc
b. Do you have a separate boot partition? If yes, mount it to /mnt/boot
c. Change root to /mnt
sudo chroot /mnt
d. Issue update-grub
. This will generate a new grub.cfg
and write it to /boot/grub/
. (Btw, this is equivalent to grub-mkconfig -o /boot/grub/grub.cfg
)
Reboot.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加