Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Linux (http://www.go4expert.com/articles/linux/)
-   -   How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial (http://www.go4expert.com/articles/delete-custom-linux-kernel-linux-ubuntu-t24436/)

lionaneesh 8Jan2011 10:23

How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial
 
While starting kernel programming.... The first thing that happens to a user is:-

He compiled a custom kernel now it doesn't works It have a tons of reasons , like because of init.d image , because of vmlinux image etc..etc...

Now some how you figured the problem and now you want to compile a new kernel "But you don't have enogh space on your hard drive....WoW!! What to do now??"

The answer is You'll have to delete your previous recompiled kernel...

How to do it :-



It is obvious that the files related to the kernel is in the /boot directory ….
Here you will find quite a bit files in my case :-
Code:

aneesh@aneesh-laptop:/boot$ ls -al -h

total 48M

drwxr-xr-x  3 root root 4.0K 2011-01-07 16:03 .

drwxr-xr-x 22 root root 4.0K 2011-01-08 09:23 ..

-rw-r--r--  1 root root 637K 2010-09-16 23:44 abi-2.6.32-24-generic

-rw-r--r--  1 root root 637K 2010-10-17 05:16 abi-2.6.32-25-generic

-rw-r--r--  1 root root 637K 2010-12-02 06:18 abi-2.6.32-27-generic

-rw-r--r--  1 root root 114K 2010-10-31 11:05 .config

-rw-r--r--  1 root root 114K 2010-09-16 23:44 config-2.6.32-24-generic

-rw-r--r--  1 root root 114K 2010-10-17 05:16 config-2.6.32-25-generic

-rw-r--r--  1 root root 114K 2011-01-07 15:29 config-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 114K 2010-12-02 06:18 config-2.6.32-27-generic

drwxr-xr-x  3 root root 4.0K 2011-01-07 16:06 grub

-rw-r--r--  1 root root 7.6M 2010-09-28 00:52 initrd.img-2.6.32-24-generic

-rw-r--r--  1 root root 7.6M 2010-10-25 16:52 initrd.img-2.6.32-25-generic

-rw-r--r--  1 root root 8.0M 2011-01-07 15:12 initrd.img-2.6.32-27-generic

-rw-r--r--  1 root root 157K 2010-03-23 15:07 memtest86+.bin

-rw-r--r--  1 root root 1.7M 2010-09-16 23:44 System.map-2.6.32-24-generic

-rw-r--r--  1 root root 1.7M 2010-10-17 05:16 System.map-2.6.32-25-generic

-rw-r--r--  1 root root 1.6M 2011-01-07 15:57 System.map-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 1.7M 2010-12-02 06:18 System.map-2.6.32-27-generic

-rw-r--r--  1 root root 1.2K 2010-09-16 23:46 vmcoreinfo-2.6.32-24-generic

-rw-r--r--  1 root root 1.2K 2010-10-17 05:17 vmcoreinfo-2.6.32-25-generic

-rw-r--r--  1 root root 1.2K 2010-12-02 06:20 vmcoreinfo-2.6.32-27-generic

-rw-r--r--  1 root root 3.9M 2010-09-16 23:44 vmlinuz-2.6.32-24-generic

-rw-r--r--  1 root root 3.9M 2010-10-17 05:16 vmlinuz-2.6.32-25-generic

-rw-r--r--  1 root root 3.9M 2011-01-07 15:57 vmlinuz-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 3.9M 2010-12-02 06:18 vmlinuz-2.6.32-27-generic

Warning Before deleting :-

I'd like you to warn before deleting your kernel modules...

Do this very carefully because if you delete your current generic version of the kernel modules you could mess up your system which could lead to a non-booting Linux system!!!

Deleting :-



As I had a version append to my own Linux kernel so I appended the kernel name with “explict-hax0r”

So I could grep the name and get the job done …

Code:

-rw-r--r--  1 root root 114K 2011-01-07 15:29 config-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 1.6M 2011-01-07 15:57 System.map-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 3.9M 2011-01-07 15:57 vmlinuz-2.6.32.26+drm33.12-explict-hax0r

Note :- Above in my case I dint got the initrd-2.6.32.26+drm33.12-explict-hax0r file most probably because I am working in my own kernel...

But in your case you could manually rm files by :-

deleting the following files :-
Code:


/boot/vmlinuz -*kernel version*
/boot/ initrd-*kernel version*
/boot/config-*kernel version*
/boot/system.map-*kernel version*

And one more file to be deleted is the /lib/modules file

Code:

aneesh@aneesh-laptop:/$ cd /lib/modules/

aneesh@aneesh-laptop:/lib/modules$

now simple rm -rf[because rm would not delete dirs] the :-

Code:

/lib/modules/*kernel version*

lionaneesh 9Jan2011 14:04

Re: How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial
 
If the viewers could comment on this article...
It would be like a billion dolors to me ...

sfhdweb 10Jan2011 12:37

Re: How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial
 
thanks for sharing this great info

lionaneesh 10Jan2011 15:06

Re: How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial
 
Quote:

Originally Posted by sfhdweb (Post 77173)
thanks for sharing this great info

Thanks The pleasure is all mine....
The best you could do is work with us....
Check the link below

sneha123 19Jan2011 16:18

Re: How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial
 
Hey ,,,,,its very informative site,,,,thanks for sharing that,,,its great post ! thanks a lot for these guides..they're really helpful for us........
with regards,,,
sneha,

lionaneesh 19Jan2011 16:29

Re: How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial
 
Thanks But ...
If you wanna really appreciate My work...
There is a 'THANKS' button just at the ending of the article ...
Please Press that and Make me happy and Motivated...

sneha123 19Jan2011 16:51

Re: How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial
 
Quote:

Originally Posted by lionaneesh (Post 77823)
Thanks But ...
If you wanna really appreciate My work...
There is a 'THANKS' button just at the ending of the article ...
Please Press that and Make me happy and Motivated...

Ok,,,,,,,,I understand this,,,,,,,really thankful to you for reply my post,,,,,,,


All times are GMT +5.5. The time now is 20:13.