How to increase/decrese /boot partition size?

General support questions
Post Reply
Art11
Posts: 26
Joined: 2011/09/03 21:31:35

How to increase/decrese /boot partition size?

Post by Art11 » 2011/09/06 00:38:11

Hello,
I guess it is obvious that i'm Linux newbie... I know nothing about it but like CentOS 6.
How to increase space on the /boot filesystem please? I tried updating the system and got this Disk requirement message saying that /boot filesystem is required addl 4 MB.
I'm running Linux in VMWare workstation.
Thank you very much.

h_fat
Posts: 48
Joined: 2007/04/13 17:23:48

How to increase/decrese /boot partition size?

Post by h_fat » 2011/09/06 00:57:42

Depending on how your drive is set up, it may be difficult to increase the size of a partition (you'd have to shrink others first). That's not a problem specific to Linux.

Do you know how big your boot partition is? If you provided us with the output of the command "fdisk -l", we could tell that and a lot more about your setup.

Maybe someone will drop by with an easy solution but if your install is a fresh one, a simple solution that will work for all cases is to reinstall with a reasonably-sized boot partition (like 250M).

Art11
Posts: 26
Joined: 2011/09/03 21:31:35

Re: How to increase/decrese /boot partition size?

Post by Art11 » 2011/09/06 14:52:16

HI,
Thank you very much for your reply. I will reinstall Linux but I still would like to know how to deal with partitions w/out reinstallation. Here's my partition info:

Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00038ffd

Device Boot Start End Blocks Id System
/dev/sda1 * 1 7 51200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 7 517 4096000 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3 517 774 2064384 82 Linux swap / Solaris
Partition 3 does not end on cylinder boundary.
/dev/sda4 774 6528 46216192 5 Extended
/dev/sda5 774 6528 46215168 83 Linux

Thank you very much.

h_fat
Posts: 48
Joined: 2007/04/13 17:23:48

Re: How to increase/decrese /boot partition size?

Post by h_fat » 2011/09/06 17:54:03

I recommend using LVM when you reinstall. LVM allows you to create, delete and resize paritions on the fly and has a few other convenient features. You usually choose to use LVM when you install the system by making only two partitions on your drive: one boot partition and a big LVM partition which will contain all the other partitions.

I've never done this but here's what I'd try in a case like yours:
-stop using the swap partition
-delete the swap partition
-create a new boot partition at the beginning of the space previously allocated to the swap partition
-reboot
-format the new boot partition and copy the contents of your old boot partition to your new one
-unmount and delete the old boot partiton
-create a new swap partition in what's left of the space previously allocated to your old one
-set up your system to mount the new boot partition at /boot automatically and remount it there
-set up the bootloader to boot from the new boot partition
-reboot
-format the new swap partition and tell your system to start using it
Maybe this wouldn't work for some reason. As you can see, it's not a simple process with standard tools. Maybe there is a utility which is able to do a better job with less hassle but such a utility could potentially destroy your data so you'd need a good backup.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to increase/decrese /boot partition size?

Post by TrevorH » 2011/09/06 18:35:09

[quote]
I'm running Linux in VMWare workstation.
[/quote]

There are other posts in the forums recently reporting that VMware's 'easy' install (or whatever it's called) makes /boot miles too small at 50MB. The recommendation is to reinstall and to not use their easy install.

Art11
Posts: 26
Joined: 2011/09/03 21:31:35

Re: How to increase/decrese /boot partition size?

Post by Art11 » 2011/09/07 14:25:24

Hi,
I'm trying to reinstall centos 6 and adjust the partitions. But whatever i do it tells me - Cannot allocate requested partitions: not enough free space on the disk.

Here's the partition info:

LVM Volume Groups
VolGroup 50696
lv_root 48680
lv_swap 2016

Hard Drives
sda
sda1 500 /boot ext4
sda2 50699 VolGroup physical volume (LVM)


I'm trying to edit and increase /boot partition. How can I do this please?
I will check other posts but I'd appreciated any possible help...
Thank you very much.

Art11
Posts: 26
Joined: 2011/09/03 21:31:35

Re: How to increase/decrese /boot partition size?

Post by Art11 » 2011/09/07 16:40:15

A few more questions please. Do I really need to have a /boot partition? Is it OK to have only / and swap partitions?
If i must have /boot part. then what would be the optimal size? Is there any performance etc... impact on the system if i make /boot part bigger, lk 1-2 GB for example?
Thank you very much.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to increase/decrese /boot partition size?

Post by TrevorH » 2011/09/07 17:00:07

You don't absolutely need a /boot partition but many like to have it - indeed I think even Windows 7 has recently adopted something similar :)

For CentOS 5 the default size was 100MB and I have used 200MB on my CentOS 6 system.

From previously posted information, your current one was 50MB not 500MB and 50 is just not big enough. The default settings for yum will install up to 3 parallel copies of the kernel package and each one uses ~25MB.

Post Reply