Editing /etc/grub.d/40_custom

Raphael

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.

Nephente
  1. Boot a Live System from CD/DVD/USB
  2. 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.

  3. Open the file /mnt/etc/grub.d/40_custom with your favorite editor, e.g

    sudo nano /mnt/etc/grub.d/40_custom
    
  4. Make any changes you feel necessary. Best to make a backup beforehand.

  5. 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)

  6. Reboot.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事