PDA

View Full Version : [SOLVED] Got two ubuntu installations, want to remove first one.



DragonlordP
September 24th, 2010, 02:22 PM
I used to have 64 bit ubuntu, but wanted to try 32 bit to see if I can make a driver work. So, I installed it in a new partition. I'm now happy with my 32 bit installation and I want to remove the 64 bit partition to make room. My partitions atm are:
sda1 (ext4, 64 bit)
sda2
sda6 (ext4, 32 bit)
sda7 (swap, 2.3 gb)
sda5 (swap, 4.3 gb)
How do I do this without messing anything up?

ajgreeny
September 24th, 2010, 03:16 PM
You can either install and run gparted in your current 32 bit system, or just boot to the live CD and run gparted from that. On starting the gparted you will see all your partitions and can then delete sda1 and also sda5 or sda7, as you don't need two swaps.

Do you know which swap is for the 32 bit system? This is the one to leave if you do, but if not, don't worry, we can deal with that after you have removed the 64 bit OS.

You will see from gparted that sda2 is an extended partition in which are a number of logical partitions, sda5, sda6 and sda7. Judging by the numbering I suspect that sda5 is the 64 bit swap and sda7 is the 32 bit swap, so if you delete one of those, sda5 would be the first choice.

After deleting the two partitions you will have unallocated space. You should be able to move the remaining swap to the end of the drive, but may need to turn it off first by right clicking on it and choosing "swapoff", then use the resize/move button to move it fully to the right. You can then enlarge the 32 bit OS partition to fill the old swap space by grabbing the right hand end and dragging it to meet the remaining swap partition. The old sda1 partition is best left separate and formatted as ext4 to use as a data storage area; much easier and quicker than enlarging the 32 bit OS partition, which will take a long time and is simply time wasted, in my opinion. The new storage partition can be mounted at boot time with read/write permissions for users, with a simple edit of /etc/fstab. Come back again after dealing with the partitions if you want to do that.

Just a last thought; in view of the turmoil of this operation, it might be worth backing up all your home files, including all hidden files and folders, and starting again with a separate /home partition. This is your choice entirely, but it makes life much easier at future upgrades or re-installs of distros.
http://www.psychocats.net/ubuntu/installseparatehome

DragonlordP
September 24th, 2010, 03:37 PM
Great! I was hoping it would be that easy, but I didn't know if you can delete sda1 with no problems (since it's the "first" partition) and also if there would be any problem with grub (don't know if it's only in sda1 or something). So, if it's simply a matter of deleting/resizing with gparted I doubt I'll have any problems, thanks!

ajgreeny
September 24th, 2010, 04:05 PM
As you installed the 32 bit sda6 second and after the 64 bit system, it is probable that grub is now "provided" by sda6, unless you did something in the installation to keep the original grub from sda1.

Just to make sure, before you remove the 64 bit system, boot to the 32 bit OS and run
sudo grub-install /dev/sda and then
sudo update-grub

DragonlordP
September 25th, 2010, 11:17 AM
Ok, I managed to screw it up. I did the grub-install stuff, then booted from a 9.10 live cd. I don't like having my disks in partitions, so I deleted sda5 (swap), moved sda7 (swap) to the right and changed its size a bit. Then I deleted sda1 and extended sda6 to the left and the right, so that it takes all the remaining space. Reboot and:

error, unknown file system
Grub rescue>

I didn't know what to do then, so I entered ls and it returned
(HD0), (HD0,MSDOS6), (HD0,MSDOS5), (FD0)
(IIRC, that is).
So, what to do? Perhaps I should rename sda2 to sda1? I thought of doing that, but I was afraid I shouldn't.

DragonlordP
September 25th, 2010, 11:49 AM
Ok, while I was waiting for a reply, I tried "manage flags" on sda2 and flagged it as boot, but it made no difference so I changed it back (it now has no flags at all). I also realised I don't know how to change its name from sda2 to sda1, or even if that's possible.

DragonlordP
September 25th, 2010, 03:38 PM
This is my grub.cfg btw

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
set locale_dir=($root)/boot/grub/locale
set lang=el
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=39e442f0-486e-4642-a53b-3b842684552e ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=39e442f0-486e-4642-a53b-3b842684552e ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
linux /boot/vmlinuz-2.6.32-24-generic root=UUID=39e442f0-486e-4642-a53b-3b842684552e ro quiet splash
initrd /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
echo 'Loading Linux 2.6.32-24-generic ...'
linux /boot/vmlinuz-2.6.32-24-generic root=UUID=39e442f0-486e-4642-a53b-3b842684552e ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.31-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
linux /boot/vmlinuz-2.6.31-22-generic root=UUID=39e442f0-486e-4642-a53b-3b842684552e ro quiet splash
initrd /boot/initrd.img-2.6.31-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.31-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
echo 'Loading Linux 2.6.31-22-generic ...'
linux /boot/vmlinuz-2.6.31-22-generic root=UUID=39e442f0-486e-4642-a53b-3b842684552e ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.31-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 39e442f0-486e-4642-a53b-3b842684552e
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Ubuntu, with Linux 2.6.35-22-generic (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro acpi=force irqpoll quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry "Ubuntu, with Linux 2.6.35-22-generic (recovery mode) (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro single acpi=force irqpoll
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry "Ubuntu, with Linux 2.6.35-20-generic (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-20-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro acpi=force irqpoll quiet splash
initrd /boot/initrd.img-2.6.35-20-generic
}
menuentry "Ubuntu, with Linux 2.6.35-20-generic (recovery mode) (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-20-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro single acpi=force irqpoll
initrd /boot/initrd.img-2.6.35-20-generic
}
menuentry "Ubuntu, with Linux 2.6.35-19-generic (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-19-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro acpi=force irqpoll quiet splash
initrd /boot/initrd.img-2.6.35-19-generic
}
menuentry "Ubuntu, with Linux 2.6.35-19-generic (recovery mode) (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-19-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro single acpi=force irqpoll
initrd /boot/initrd.img-2.6.35-19-generic
}
menuentry "Ubuntu, with Linux 2.6.35-18-generic (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-18-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro acpi=force irqpoll quiet splash
initrd /boot/initrd.img-2.6.35-18-generic
}
menuentry "Ubuntu, with Linux 2.6.35-18-generic (recovery mode) (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-18-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro single acpi=force irqpoll
initrd /boot/initrd.img-2.6.35-18-generic
}
menuentry "Ubuntu, with Linux 2.6.35-17-generic (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-17-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro acpi=force irqpoll quiet splash
initrd /boot/initrd.img-2.6.35-17-generic
}
menuentry "Ubuntu, with Linux 2.6.35-17-generic (recovery mode) (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-17-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro single acpi=force irqpoll
initrd /boot/initrd.img-2.6.35-17-generic
}
menuentry "Ubuntu, with Linux 2.6.35-16-generic (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-16-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro acpi=force irqpoll quiet splash
initrd /boot/initrd.img-2.6.35-16-generic
}
menuentry "Ubuntu, with Linux 2.6.35-16-generic (recovery mode) (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.35-16-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro single acpi=force irqpoll
initrd /boot/initrd.img-2.6.35-16-generic
}
menuentry "Ubuntu, with Linux 2.6.31-21-generic (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.31-21-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro acpi=force irqpoll quiet splash
initrd /boot/initrd.img-2.6.31-21-generic
}
menuentry "Ubuntu, with Linux 2.6.31-21-generic (recovery mode) (on /dev/sda1)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set df77de10-0592-47a2-ae30-d39ce1def416
linux /boot/vmlinuz-2.6.31-21-generic root=UUID=df77de10-0592-47a2-ae30-d39ce1def416 ro single acpi=force irqpoll
initrd /boot/initrd.img-2.6.31-21-generic
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

DragonlordP
September 25th, 2010, 05:49 PM
Alright, fixed following the info on http://ubuntuforums.org/showthread.php?t=1195275 (part 15)
No info damaged, no problem :)

DragonlordP
September 26th, 2010, 06:43 AM
Duh, it does work fine, but I have to do it all over again whenever I boot, it still points to the swap partition (hd0,msdos6) and I have to set it to (hd0,msdos5) etc etc. How to permanently save this settings so that I don't get "Grub rescue" in each boot? Thanks.

DragonlordP
September 26th, 2010, 07:11 AM
Well, I thought I'd reinstall grub. So I went to synaptic, completely removed grub-pc and grub-common, along with their settings, and reinstalled them. I was asked for "the linux command", to which I entered "linux /vmlinuz root=/dev/sda5 ro" (taken from the grub rescue thread above). Then it asked me in which partitions I wanted grub to be installed, the options were sda2 and sda5 (no swap) and I chose only sda5. Still same story though, Grub rescue at boot.

DragonlordP
October 4th, 2010, 03:42 PM
Anyone? Please?

oldfred
October 6th, 2010, 06:11 PM
If you can manually boot then you just need to reinstall grub to the MBR not partitions.

reinstall from working (not liveCD) system - first find Ubuntu drive:
sudo fdisk -l
if it's "/dev/sda" then just run:
sudo grub-install /dev/sda
If that returns any errors run:
sudo grub-install --recheck /dev/sda
Then:
sudo update-grub
to get grub to remember where to reinstall on updates:
sudo dpkg-reconfigure grub-pc
spacebar to choose/unchoose drive, enter to accept, do not choose partitions

Otherwise you have to use a liveCD.
How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 9.10)
http://ubuntuforums.org/showthread.php?t=1014708
https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD

DragonlordP
October 7th, 2010, 02:01 PM
Cheers, worked like a charm :-)