Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As the title says, why I have to do that (other than chrooting to my device) to change my GRUB CFG from a LiveUSB image?

Thank you!

EDIT:

Reference: Click Me! I had the same error (cannot find device for / and that link helped me to solve my problem)

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You don't if all you want to do is change your grub.cfg. You can just mount the / partition, chroot to it and make the changes you need.

You do need to mount the other directories if you want grub to autodetect any other installed operating systems since it needs access to those directories to be able to properly probe the system. By mounting them under your chroot environment, you mimic your installed system and trick grub into thinking it is running from that installed system.


EDIT: The directories you listed are needed because in order for GRUB to probe installed systems, it will need access to the devices (/dev) and to information about system memory, devices mounted, hardware configuration (/proc). I don't see why you need /run but that is a relatively new addition to Linux and I am not very familiar with it.

share|improve this answer
    
I needed to probe all the other OSes on my PC. But why are those NEEDED? –  Krishath Jul 20 '13 at 14:38
    
@Krishath see update. –  terdon Jul 20 '13 at 14:42
    
Thank you for your answer! Mounting it in my "original" box makes it available on my chroot environment then? Why I had to chroot to my system to make it work? –  Krishath Jul 20 '13 at 14:44
    
@Krishath Read up on chroot. It creates a virtual environment where after you chroot foo the system acts as though foo were /. That is why with chroot you can mount an installed system and behave as though you had booted into it. Otherwise, any changes you made would only affect the LiveCD and not your installed system. –  terdon Jul 20 '13 at 14:46
    
Thank you very much! –  Krishath Jul 20 '13 at 14:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.