Editing GRUB on Ext4 from under Windows

Good day! Recently, there was an urgent need to remotely reboot to another operating system on a working computer. If in the case of rebooting from linux to windows everything is simple - just correct the / etc / default / grub file and update the bootloader itself, then vice versa, booting from Windows will be a little more difficult, but you can.

So let's get started!

Given:
Windows XP
Ubuntu 11.04 installed on Ext4 file system
Actually, the GRUB boot loader itself, configured to boot Windows.

Preparing GRUB configuration files
To remotely restart the machine from Windows to Linux, without being able to select the operating system from the list at startup, we will make two versions of the /boot/grub/grub.cfg file, in each of which only one OS will be configured to start. To do this, open the file / etc / default / grub, find the grub_default line in it and set the value of the desired operating system - for example, I have the number 5 for Windows and 0 for Ubuntu (0 is the first line in the boot window, 1 is the second and so on .d.). We save the file, and then restart GRUB with the update-grub command. At this point, the /boot/grub/grub.cfg file is recreated on the system. We save the resulting file in any convenient place, and repeat editing the grub-default line, but for another OS. We update it rudely with the command and save the second copy of the file. The main thing is to decide

Ext2Fsd is a tool for working with Ext.
So, two versions of the bootloader settings are ready, but to throw them from Windows onto the Ext4 partition, a driver program such as Ext2Fsd is needed. You can download the latest version 0.51 from the official website http://www.ext2fsd.com/ . We reboot into Windows and install the downloaded program.

After installation, we run the program, assign any letter to the Linux partition (“Change Drive Letter” item), and then select “Ext2 Management” (F3 key) in the context menu, where we uncheck “Read-only”.



In general, the function of writing to partitions with the Ext4 file system was initially disabled, and therefore you need to use it with caution, at your own peril and risk, as developers warn about this on the program’s website.



Next, we use the usual XP explorer - find the grub.cfg file created earlier, which is responsible for booting Linux, and replace the file in the /boot/grub/grub.cfg directory with it.

After that, just in case, I turn off recording to a Linux disk (again I tick “Read only”), and calmly restart the computer. Now, upon rebooting, linux will automatically start. We wait a minute and connect with your favorite client - VNC, SSH, etc.

Everything, you can work in the right operating system!

Also popular now: