Friday, January 15, 2010

Reorder partition numbering and recover the grub2

Before we reorder the partition numbering it is a good idea to have a USB startup disk ready which can be created in ubuntu or other windows softwares. Reordering partition number can cause the failure of the booting files of grub2.

* reorder partition numbering

If you move partitions, change their sizes and create new ones, the numbering might get mixed up (e.g. with gparted). The partitions might look like these:
/dev/sda1 ntfs /media/win
/dev/sda2 ext4 /
/dev/sda3 ext3 /boot
/dev/sda4 extended
/dev/sda8 linux-swap
/dev/sda6 fat32 /media/programs
/dev/sda7 fat32 /media/testdisk
/dev/sda5 fat32 /media/stuff

If you want to reorder the partition numbering for whatever reason, fdisk will help. Execute fdisk /dev/sda (as you can see, I want to reorder the numbering of my first SCSI disk) after becoming root.

# fdisk /dev/sda

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs

Command (m for help):

If m is entered at the prompt, the possible commands will be listed. Type x to activate the extra functionality (experts only). Press m again to see new expert options. Enter f (fix partition order) and w to write the changes to the disk and exit.

*Recovering of Grub 2*

As we mentioned before, the reordering of the partitions will cause failure of grub2 and the systems installed in other than the number reordered partitions can not boot anymore. In this end, we boot up the system by the USB memory key:

1.Find the partition of the target system, say, sda2

sudo fdisk -l

2. Mount the target partition.
sudo mount /dev/sda2 /mnt
sudo grub-install -–root-directory=/mnt/ /dev/sda

3. Install Grub2
sudo update-grub

Another way to do that is as follows:
$sudo fdisk -l

This will show your partition table. Here is my table to understand it better :

/dev/sda1 29 8369 66999082+ 83 Linux
/dev/sda2 * 8370 13995 45190845 7 HPFS/NTFS
/dev/sda3 13996 14593 4803435 5 Extended
/dev/sda5 13996 14593 4803403+ 82 Linux swap / Solaris

Now i will mount Linux (sda1 here)

$sudo mount /dev/sda1 /mnt
$sudo mount --bind /dev /mnt/dev
$sudo mount --bind /proc /mnt/proc

The following command is optional (it copies resolv.conf)
$sudo cp /etc/resolv.conf /mnt/etc/resolv.conf

Now chroot into the enviroment we made :
sudo chroot /mnt

Now, you will run commands as root.

You may want to edit /etc/default/grub file to fit your system (timeout options etc)

#nano -w /etc/default/grub

Play with the options if you want.(But do not forget to give grub-update command if you saved it )

Now install/recover Grub2 via :

#grub-install /dev/sda
command.However you may get errors with that code like me.If so please use this command :
#grub-install --recheck /dev/sda

Now you can exit the chroot, umount the system and reboot your box :
$sudo umount /mnt/dev
$sudo umount /mnt/proc
$sudo umount /mnt
$sudo reboot


Monday, January 11, 2010

Remove The User List From Ubuntu 9.10 GDM Login Screen

Disable User List

In order to disable the user list you’ll need to open a terminal and run the following command:

sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list true

Enable User List

If you’d like to re-enable the user list you can revert the above command using:
sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list false


Saturday, January 09, 2010

Problem solved: Ubuntu boots up with only terminal

It could happen to Ubuntu that it boots up with a command line terminal only and the gnome desktop can not load correctly, typically after some update of the system and the culprit might be the failure of the initialization of some hardwares.

To this end, we need a wired network connection since the wireless network can not load before the desktop boot-up. The following command solves the trouble.
# apt-get install gnome-core


Tuesday, January 05, 2010

Country music lists


Sunday, January 03, 2010

Online pop song lists