Page 1 of 1

[SOLVED] Deleted contents of /boot

PostPosted: Apr 23rd, '12, 02:25
by lewisforlife
I am building a LFS system using Mageia as my host system. I thought that I was chrooted into /mnt/lfs but I was not, and as root I ran "rm -rf /boot". I am in my system right now, I will not reboot until I fix this issue. What is the best way to restore the contents of /boot so that I have no problems on my next boot up?

I feel really dumb right now, so please don't try to rub it in :-).

Re: Deleted contents of /boot

PostPosted: Apr 23rd, '12, 02:31
by lewisforlife
I guess I can re-install grub, and then use urpmi to install a kernel. Which kernel package should I install?

Re: Deleted contents of /boot

PostPosted: Apr 23rd, '12, 02:53
by lewisforlife
I reinstalled grub, and then I reinstalled:

urpmi kernel-desktop586-latest
urpmi kernel-desktop586-devel-latest

now when I do a ls -la /boot I get this:

Code: Select all
[root@localhost home]# ls -la /boot
total 4376
drwxr-xr-x  3 root root    4096 Apr 22 16:47 ./
drwxr-xr-x 23 root root    4096 Apr 22 16:23 ../
-rw-r--r--  1 root root  128981 Jan 25 05:23 config-2.6.38.8-desktop586-10.mga
drwxr-xr-x  2 root root    4096 Apr 22 16:36 grub/
lrwxrwxrwx  1 root root      37 Apr 22 16:47 initrd-desktop586.img -> initrd-2.6.38.8-desktop586-10.mga.img
-rw-r--r--  1 root root  205073 Jan 25 05:23 symvers-2.6.38.8-desktop586-10.mga.gz
-rw-r--r--  1 root root 1639468 Jan 25 05:23 System.map-2.6.38.8-desktop586-10.mga
-rw-r--r--  1 root root 2484304 Jan 25 05:23 vmlinuz-2.6.38.8-desktop586-10.mga
lrwxrwxrwx  1 root root      34 Apr 22 16:47 vmlinuz-desktop586 -> vmlinuz-2.6.38.8-desktop586-10.mga
[root@localhost home]#


The initrd stuff is blinking red, which I think means the link is broken. Do I need to run mkinitrd? I am not sure of what I will use for the command if so. Please help.

Thanks.

Re: Deleted contents of /boot

PostPosted: Apr 23rd, '12, 02:56
by lewisforlife
Here is what I did:

[root@localhost home]# mkinitrd /boot/initrd-desktop586.img 2.6.38.8-desktop586-10.mga

I hope that is right, I am going to try a reboot, I hope it works!

Re: Deleted contents of /boot

PostPosted: Apr 23rd, '12, 03:10
by lewisforlife
None of this worked, I just booted up with the live cd. Please help me resolve this.

Re: Deleted contents of /boot

PostPosted: Apr 23rd, '12, 03:33
by lewisforlife
I reinstalled without formatting my partitions, this fixed everything.

Thanks.

Re: [SOLVED] Deleted contents of /boot

PostPosted: Apr 27th, '12, 21:01
by doktor5000
Next time you probably want to run
Code: Select all
bootloader-config --action rebuild-initrds
instead of just plain mkinitrd.
Also you might have used drakboot to fix this from within the running system. Just posting FYI, but otherwise LFS is a great opportunity to learn, as you have proved :)