Thursday, December 31, 2009

Write access and Grub 2 in Linux (Ubuntu 9.10)

1 . Use chown

Ubuntu 9.04 and up can mount some partitions (ext3/4 and ntfs file systems) at startup. But users can not have write access to mounted partitions. To gain write privilege, issue the following commands as root:

sudo chown -R username partition_path

for example, the command

# chown -R pebloy /media/lnx-str-1

gives write privilege to user pebloy on the directory /media/lnx-str-1.

2. Grub 2 to modify the boot menu of ubuntu

Grub 2 project is newer than the traditional grub 0.97. It is more complicated but more secure and robust.

a. Customize and edit the menu entries at boot.

Each boot entry corresponds to an entry menuentry { } in the boot file located at /boot/grub/grub.cfg.

To customize them, here is how you do it:

* Run sudo update-grub to get the current available kernels.
* Copy the desired "menuentry" listings from /boot/grub/grub.cfg to /etc/grub.d/40_custom The entry begins with the line starting with "menuentry" and ends with a line containing "}".
* Add any other "menuentry" items you wish to see on the boot menu.
* Edit the titles of the "menuentry" line if desired (between the quotation symbols). Do not change the lines following the "menuentry" line. Each entry should start with a "menuentry" line and end with a "}" on the last line.
* Remove the executable bit from /etc/grub.d/10_linux, /etc/grub.d/20_memtest86+ and /etc/grub.d/30_os-prober
Removing the executable bit from any file in /etc/grub.d will exclude the file from being included in grub updates.

sudo chmod -x /etc/grub.d/10_linux /etc/grub.d/20_memtest86+ /etc/grub.d/30_os-prober

* Run "sudo update-grub"
* The updated /boot/grub/grub.cfg file should now contain only sections for "00_header", "05_debian_theme" and "40_custom".
* The grub.cfg file will not be updated with the addition of a new kernel. To add a new kernel, make "10_linux" executable, run "sudo update-grub" to refresh the available kernels, and repeat these instructions.

then update grub.cfg by

# update-grub

Then grub.cfg is modified accordingly. Please note that the boot file grub.cfg is not supposed to be edited directly in Grub2.

For more details on Grub 2, see

3. Change computer name

It could happen that we want a more interesting hostname. We do the following in Ubuntu

# nano -w /etc/hostname

Change the current host name to the one you like.



Post a Comment

Subscribe to Post Comments [Atom]

<< Home