[ubuntu-uk] how to change hdd/partition numbering
Tom Bamford
tom at entrepreneuria.co.uk
Wed Jan 23 16:08:14 GMT 2008
Vitorio Okio wrote:
> I've deleted with GParted unwanted Dell Utility partition sited the first
> on my HDD. This partition was set as /dev/sda1, so all others followed
> correspondignly: /dev/sda2, /dev/sda3, etc.
>
> Now after deleting and booting back in Ubuntu my now first partition is
> still marked as /dev/sda2. And all others follow.
>
> How can I change this? I would like my first partition being set /dev/
> sda1, etc.?
>
> Thank you
Hi,
You can renumber your partitions but you'll need a live CD to do it
with. Assuming you have either backed up your entire system or you don't
care if you nuke it by accident or by means of a power cut - boot off
the live cd, then run (in a terminal window)
sudo fdisk /dev/sda
Press x to go into the fdisk advanced menu, then press f to fix the
partition order. You'll need to update your grub configuration, so mount
your /boot (or /) partition in a temporary location and locate your
system's /boot/grub/menu.lst file. Update any partition references in
the notation "hd(0,1)" - the second number may have to be knocked down
one to reflect the new order.
I would also check to see if any of your partition UUIDs have changed as
a result of renumbering them. Open your grub menu file in one window and
a terminal in the other. Run this command in the terminal
ls -l /dev/disk/by-uuid
to list your partition UUIDs and manuall inspect your grub file to make
sure they match up. Make any corrections where necessary, making sure
the line "root=UUID=1234567890" parameter is correct on any line
beginning with the word "kernel". Once done, save the menu file, unmount
your partitions and reboot your system. Hopefully it will boot, if not
then note down any errors and reboot into the live CD.
Hope this helps,
Tom
More information about the ubuntu-uk
mailing list