LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Boot partition is full (https://www.linuxquestions.org/questions/linux-general-1/boot-partition-is-full-724601/)

ngiamol 05-08-2009 02:32 AM

Boot partition is full
 
Good morning everyone (at least here is morning :) )

My linux box has Mandriva pwp 2009. During some other strange messages while boot, i saw that i have no space left on /boot partition.

When i installed the distro, i used a different partition whish had 25mb of space.

Today after i read some posts, ive found that this space is very low (someone suggested 256 mb). What you advice me to do? to increase the space of the partition? to leave it as is? (except the warning during boot, i dont have any other problem) or delete some files? Any advice please?


Thanks in Advance
Nick.

ajlewis2 05-08-2009 05:50 AM

25Mb used to be plenty for /boot, but I see that with only 2 kernels in mine, I'm using 37Mb. I can't see a need for 256Mb, but 25Mb is pretty small. On my system there are fairly frequent updates of the kernel and the old kernel is left. Leaving the old kernel is a good idea, because sometimes a new kernel doesn't work right and I need to boot with the old one.

It is not a good idea to remove any files from /boot unless you know what you are removing. I usually remove old kernels with the package manager keeping only the latest two kernels.

It would be good to run 'df -h' and see how much of /boot is currently being used. Also do 'ls' in /boot to see how many kernels there are there. I'm running Ubuntu and not Mandriva; so I'm not sure how the kernel upgrades go on your system.

ngiamol 05-09-2009 04:08 AM

Here we are

Filesystem Size Used Avail Use% Mounted on
/dev/sda5 15G 2,8G 11G 21% /
/dev/sda1 23M 22M 0 100% /boot
/dev/sda8 1,8T 21G 1,8T 2% /home
/dev/sda7 49G 828M 45G 2% /var

and the list

[root@samba boot]# ls
boot.backup.sda kernel.h-2.6.27.10-desktop-1mnb
config@ kernel.h-2.6.27.19-desktop-1mnb
config-2.6.27.10-desktop-1mnb kernel.h-2.6.27-desktop-0.rc8.2mnb
config-2.6.27.19-desktop-1mnb lost+found/
config-2.6.27-desktop-0.rc8.2mnb System.map@
gfxmenu System.map-2.6.27.10-desktop-1mnb
grub/ System.map-2.6.27.19-desktop-1mnb
initrd-2.6.27.10-desktop-1mnb.img System.map-2.6.27-desktop-0.rc8.2mnb
initrd-2.6.27.19-desktop-1mnb.img vmlinuz@
initrd-2.6.27-desktop-0.rc8.2mnb.img vmlinuz-2.6.27.10-desktop-1mnb
initrd-desktop.img@ vmlinuz-2.6.27.19-desktop-1mnb
initrd.img@ vmlinuz-2.6.27-desktop-0.rc8.2mnb
kernel.h@ vmlinuz-desktop@


Is there any safe way to expand the /boot partition?
Have in mind that, all partitions are created in same array (raid controller)


Thanks in advance
Nick.

ajlewis2 05-09-2009 08:11 AM

It looks like there are 3 kernels there. It would be possible to delete one of them and make room. However, this will continue to be a problem.

I don't think you can resize sda1, because there is probably no space between that and the extended partition in which those other partitions are located.

I think the best bet would be to move /boot to your root partition where you have 11Gb available. You would not create it as any size; so it will not run out. You could probably resize sda8 and make a new partition for /boot, but that seems silly to me. Is your root partition either ext2 or ext3? I think some filesystem types are not good for /boot, but I know those are.

The parts to doing this would be to first make sure you know how to install grub in the mbr. With the old grub, it is simply as root 'grub-install /dev/sda' Try that first to make sure you can do it and it works. Otherwise, you will need to find out how to do that on your system, because you will be changing the location of where the kernel is and I think it will require new info in the mbr.

Then you will:

1. Create /newboot and copy all that is in /boot to that directory. Be sure to use 'cp -a' to get all the links and any hidden files.
2. Unmount /boot
3. Remove the /boot directory(which should be empty now) and rename /newboot to /boot
4. Comment out the entry in /etc/fstab where sda1 gets mounted as /boot
5. Run 'grub-install /dev/sda' or whatever is needed to do that job.
6. Reboot

Let us know if this sounds good and if you need any more information. If it doesn't work, you will be able to use commandline grub to get into the system.

Also realize that I know nothing about raid, but I don't see how this would interfere with that. You may want to wait awhile to see if anyone has other idea or cautions.

ngiamol 05-09-2009 08:45 AM

The worst enemy for a newbie like me is the wrong information.

In my case, i thought that /boot partition used to store temporary files ONLY during boot proccess.

Anyway, is it possible to install another one boot loader which will be located within root dir? (/boot2 or something similar) and move the needed files there? ( i can spare an old 10Gb disk and copy/move the needed files there).

In case that i do nothing, is it possible to have any problem in future?
The first priority for me is to have a stable system.

Thanks in Advance
Nick

ajlewis2 05-09-2009 03:53 PM

Quote:

Originally Posted by ngiamol (Post 3535433)
Anyway, is it possible to install another one boot loader which will be located within root dir? (/boot2 or something similar) and move the needed files there?

That is what I suggested, I think. You will copy all the files from /boot into a new directory within the root directory which I suggested calling /newboot.

After the copy, you would unmount the the /boot partition which would leave all the files safely stored on that partition, but no longer showing up in /boot which would now be the empty mount point on your root partition. (I know that mounted partitions is a little hard to understand at first.)

Then, after the /boot partition is unmounted and you have the empty /boot directory, you would delete the empty directory and rename /newboot to /boot. Now all your files are there.

Then you comment out the line in /etc/fstab that automatically mounts that sda1 partition as /boot; so that it does mount. You have to run grub-install in order to put the new information on where the kernel is located. That copy is not in the same place as it used to be. In fact, now that I think of it, you should probably run 'update-grub' first, before 'grub-install' because the menu.lst file may need to be updated to indicate that the kernel is on the root partition and not the old sda1.


Quote:

In case that i do nothing, is it possible to have any problem in future?
The first priority for me is to have a stable system.
Having said all that stuff above, I feel that this is not newbie type stuff to do and you might make a mistake and the system might not boot after doing this process. I would do it, but I know that I can take a rescue disk and repair the damage. All this stuff is new to you and I think it might be wise to just remove the old kernel.

I don't know what your package manager is. Have you ever installed software with something that lists what is installed on your system? That would be your package manager. That would be the best way to remove the old kernel which would make room for your next one.

I see these in your /boot

vmlinuz-2.6.27.10-desktop-1mnb
vmlinuz-2.6.27.19-desktop-1mnb
vmlinuz-2.6.27-desktop-0.rc8.2mnb

2.6.27.10 is definitely older than 2.6.27.19. I don't know what the last one is.

Do 'uname -r' and that will tell you which kernel is being used right now. It is probably .19. That means you could open your package manager and uninstall .10, because you are not using it. That will free up some room. If you are sure that you do not use that last one, you could remove it, too, but be sure that it is older than .19 and that you are not using it.

If you check what kernel is running and use the package manager to uninstall it, you will not hurt your system. That would be my recommendation.

ngiamol 05-10-2009 05:02 AM

I forgot to mention that i have installed webmin in my system.

Webmin have a module called "GRUB boot loader", and it has the option "install grub"
but i really don't know if it moves the files too.

That might do the work?

Btw the uname -r command gives me that : 2.6.27.19-desktop-1mnb

Thanks in Advance
Nick

ajlewis2 05-10-2009 05:47 AM

Webmin's grub section does not have anything to move those files.

Since you are using that .19 kernel, I'd suggest you open your package manager and look for those other two kernels and uninstall them.

Later after you have learned more about Linux, you can more confidently move /boot to the root partition, reconfigure and reinstall grub to the mbr, and fix fstab so the old /boot doesn't load. By then you will know how to use a rescue disk or to run grub by commandline to load a broken system.

If you remove those two kernels with the package manager, it should get rid of the files that go with each one and make your /boot much less full. Then when you have the next kernel update, you can keep the old one and delete it when you are sure the new one is running well.

If you want to try moving /boot etc. I can give you step by step. And we can do checks along the way.

ngiamol 05-10-2009 06:26 AM

What ill do.

Ill open my file manager and removing the old kernels. But, i wouldlike a step by step "guide" to try it on a test machine.
The worst thing i can do is to try it on a "working" machine and blow it up. :)


err i mean package manager :) :)

And the results after the procedure.

[root@samba /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 15G 2,7G 11G 20% /
/dev/sda1 23M 8,6M 14M 40% /boot
/dev/sda8 1,8T 21G 1,8T 2% /home
/dev/sda7 49G 823M 45G 2% /var


Thanks Much
Nick

ajlewis2 05-10-2009 08:55 AM

LOL. I saw file manager and panicked! Good going! Now you have room for another kernel and goodies that go with it. Have fun on your Linux adventures.


All times are GMT -5. The time now is 10:34 PM.