← Back to team overview

lubuntu-desktop team mailing list archive

Re: Modifying files in Lubuntu

 

On Wed, 21 Apr 2010 15:15:16 +0100
Andrew Woodhead <andrew.woodhead666@xxxxxxxxxxxxxx> wrote:

> You do NOT edit the grub.cfg ile. That file is generated using config files
> and scripts. You can edit the file but next time:
> sudo update-grub
> is ran the changes will be completely lost.

Yes, I know. Understood.

> LXDE is a GTK based DE so 'gksudo leafpad' is what you  will need (you can
> install gedit if you like but leafpad is a lot leaner and default in LXDE.

Yes, I am new to LXDE, (I use Kubuntu mainly) and I should try to find out more about its commands first. Will google and learn more. Thanks for your feedback though.


> If you want your changes to grub.cfg to stick you must either:
> 1. *Never* upgrade the kernel  OR
> 2. Edit Grub2 the correct way so that grub updates get applied and your
> changes stay
> 
> The grub.cfg file is marked as read only (even to root) and the file says
> "Do not edit this file" for a reason. I suggest you read:
> https://help.*ubuntu*.com/community/*Grub2*

Andrew, besides setting a (previous) grub of hard drive to sda (mbr) and updating it for to include Lubuntu, I've also set grub to the usb thumb drive so that it is portable AND bootable from any computer (like what I've done for all my previous thumb drives, LILO/grub-legacy then though). However, the parameters are always wrong and needs to be corrected. (not peculiar to Lubuntu, happens to all); for example, booting from usb drives will always be (hd0,1) not what was specified (like (hd2,1) or (hd3,1)). and root=/dev/sda needs to be changed to root=/dev/sdc1 for example. Sometimes it will boot, (but not always) due to the specified UUID but I like to make sure it ALWAYS boot wherever the thumb drive is put. So I will modify the grub.cfg by the following method....... 

At /etc/grub.d, make a new entry, say 08_mefirst as a custom entry and make it executable.
I put in the entry 

menuentry 'Lubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set c25a3c07-99ba-456a-b8f1-54aa427c2d87
	linux	/vmlinuz root=UUID=c25a3c07-99ba-456a-b8f1-54aa427c2d87 ro   quiet splash
	initrd	/initrd.img
}

Note the (hd0,1) and that /vmlinuz is not the specified kernel number (so that it will always be the latest kernel).
I'll leave the 10_linux as is.
Then I'll do the update-grub or grub mk-config -o /boot/grub/grub.cfg.

Andrew, if you see anything wrong with this, will appreciate your feed back.
Thanks again.

Regards _ Goh Lip

ps: my hard drive grub (grub2) that is set to sda (mbr) is from a separate grub partition, OS- independent and similarly heavily modified and not affected by any kernel upgrade of any OS either. (nuke-proof)



-- 




References