Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Sometimes I wanted to do smart partitions, by doing separate /boot partition, but I only give little space. Now I am having problems with lack of space on that partition.

How to remove /boot partition and join it with /root partition?

share|improve this question
2  
Have you thought to clean out older kernels from /boot before you try merging it with the / filesystem? –  Arcege Mar 12 '11 at 23:46
    
yeah, but it's some "public" pc, so I don't want to do this each few months... (ok I know I could, but still...) –  gsedej Mar 13 '11 at 0:06
    
See my answer below -- you could also resize the partition, instead of changing your partitioning scheme (which is a good one) –  Jesse Taylor Mar 13 '11 at 1:39

2 Answers 2

up vote 6 down vote accepted

You could use cp -a /boot /boot-tmp to copy the contents to a temporary directory on the root filesystem, unmount the boot partition using umount /boot, and put the files back in place with rmdir /boot && mv /boot-tmp /boot.

Once you verify that everything is fine you can remove /boot from /etc/fstab. Finally, you should double-check the GRUB configuration and run update-grub.

share|improve this answer
3  
Probably want to make sure /etc/fstab is correct once you do this. –  belacq Mar 13 '11 at 2:10
    
Ok, thanks for answer. I will try it! –  gsedej Mar 13 '11 at 12:33
    
I'd like to reiterate though that increasing the size of the boot partition is probably a better choice ... I don't understand why you wouldn't just want to do that ... –  Jesse Taylor Mar 14 '11 at 1:49
    
@jrtayloriv: Would you care to elaborate why a separate boot partition is preferable? -- I read in some ancient guide, 100 MB for a boot partition would be ok. Now apt-get upgrade regularly fails because of insufficient disk space. I don't want to move partitions. Do you know a solution that would automatically purge ancient kernels? –  krlmlr Oct 30 '12 at 20:47
    
I have tried this, but my system somehow appears to load the configuration from the (now not mounted anymore) boot partition. (I have changed /etc/default/grub, and run update-grub, but the changes were not reflected in /boot/grub/grub.cfg.) Any hints? –  krlmlr Oct 31 '12 at 10:53

You could also just keep the /boot partitition and expand it with gparted. (Of course, as always, backup first and keep a liveCD handy in case something goes wrong)

If you've never resized partitions before, there are plenty of tutorials on the web that will tell you how to do it. Here's a good tutorial to start with: http://www.ibm.com/developerworks/linux/library/l-resizing-partitions-1/index.html

share|improve this answer
    
Thanks for answer, but I rather just join in "/" partition. I would need to resize other partitions also.... –  gsedej Mar 13 '11 at 12:33
    
If that's the case, you can "merge" partitions using gparted as well. Move the files from /boot partition to / partition. Then set bootloader to boot from the new /boot directory of the root partition. If everything works, and it boots up properly, then delete the boot partition and resize the other partitions to fill the space. Again -- make backups and keep a livecd ready (and I'll reiterate that resizing is probably a much better and easier solution than merging ...) –  Jesse Taylor Mar 14 '11 at 1:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.