disk space expansion

Nils Kassube kassube at gmx.net
Wed Feb 20 15:32:18 UTC 2013


Joep L. Blom wrote:
> I have a little problem and actually a little ashamed to ask as I
> can't remember how to solve it.
> The situation:
> I have in my main workstation a sata disk of 1 Tb where approx. 450
> GiB is unallocated. The division is:
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sda1   *        2048      194559       96256   83  Linux
> /dev/sda2          196606   996286463   498044929    5  Extended
> /dev/sda5          196608   195506175    97654784   83  Linux
> /dev/sda6       195508224   781443071   292967424   83  Linux
> /dev/sda7       781445120   976754687    97654784   83  Linux
> /dev/sda8       976756736   996286463     9764864   82  Linux swap
> The problem:
> I have only 1 primary partition of 100Mb (/dev/sda1) where /boot is
> mounted. Now as currently 100 MB for a boot sector is rather small I
> need to expand it. As you can see ,however, there is no room for
> continuous expansion as /dev/sda2 starts already 2048 sectors
> further. There must be a way to do it but I don't know. I hope
> somebody here can help me out.

I would suggest to create a new partition of sufficient size. It could 
be a primary or logical partition - that is not important for Linux. 
Create a filesystem on the new partition, mount it to some mountpoint 
and copy the contents from your /boot folder to the new partition. Then 
unmount both /boot and the new partition. Change your /etc/fstab to use 
the new partition instead of your sda1 for /boot. Run the command

sudo mount -a

and check that your new partition is mount as /boot. If that works, run 
the command

sudo update-grub

But before you do all that, you should think about your disk layout. 
IMHO the extended partition is far too small because with your current 
layout you could only add two primary partitions to use the 500GB left. 
If that is all you need, OK. Otherwise I would suggest to expand the 
extended partition to the end of the disk first. I don't think you could 
do that from the running system but you would have to boot from a 
livecd.


Nils




More information about the ubuntu-users mailing list