Here's my problem. I'd like to reinstall Ubuntu. My laptop is an old HP Compaq nx7400. The optical drive went wrong, it can't read discs. I would use a USB port instead but the laptop won't boot from it. (It won't boot even if I set USB the first in the boot order in BIOS settings. Also on start up after pressing F9 to choose boot device USB won't appear in the list, only optical disk, netbook disk and network if I enable it.)

I wanted to resize the boot partiton to make space for the installation but I couldn't do that because it seems that the whole HDD is the boot partiton so it can't be unmounted using Gparted.

2 Answers
2

You shouldn't have to repartition the disk just to reinstall Ubuntu. It seems like you just have one partition for Ubuntu, and one Swap partition in an extended partition, which is a standard partitioning scheme for an Ubuntu installation.

You could boot the Ubuntu iso from the Grub menu. When you boot from the iso file, you will be able to press a key upon boot to get to the Live boot menu. Add the toram kernel option.

You will be able to choose whether you want to save programs or Home folder data or just erase everything and reinstall.

And importantly, make reliable backup before executing the procedure! Though nothing should go wrong if you ensure that you know what you're doing.

Unfortunately OP has no working optical drive and can't boot from USB. In this situation I don't think there is a way, that doesn't require to copy $HOME to an external drive.
–
David FoersterOct 15 '13 at 12:45

Thank you David! Could you elaborate on the steps?
–
AttilaOct 15 '13 at 12:52

1

Follow the linked instructions for booting the iso image off the hard drive. Add the "toram" option to the kernel arguments and it will load the whole system into ram so the hd can be unmounted.
–
psusiOct 15 '13 at 13:51

1

Suggest backing up $HOME to an external drive first, though. After you boot with your current OS, can you plug in a USB drive and see it mount? If so, then copy the contents of $HOME and everything below it, for safety's sake.
–
K7AAYOct 15 '13 at 16:07

Open a terminal and run ls /boot If boot is full of old kernels you can go remove happy on them, I recommend keeping the original, the latest and the one before latest. the lowest number is normally the shipping kernel, the highest number will be the latest.

To grow boot you first need to shrink another partition so you have free space. I would suggest using the gparted tool on the live cd to do this. First decrease the size of/ or /home depending on your setup. Then increase the size of boot.