How to completely remove Grub legacy from Grub2 install?
by browny_amiga from LinuxQuestions.org on (#5NR6B)
Hi,
I have a system that used to run on grub 1 (legacy), but it got upgraded to grub 2. Now I want to clean it up and remove all config left over from grub legacy. How can I do that?
This is a Debian Buster Linux, and when I do
apt purge grub-pc
it will ask me if I want to erase /boot/grub, I say yes, but it does not erase anything there.
All the files are still there. If I now erase them by hand and reinstall grub-pc, it does not recreate them. I had this very strange behaviour before: dpkg somehow notices when a user erases files and marks these to never install them.
So how can I reinstall Grub2 from scratch, reset the whole config and remove all and every little bit of legacy config from grub legacy?
This is the directory with the leftover stuff from grub legacy and grub2 installed:
ls -la /boot/grub/
total 2616
drwxr-xr-x 5 root root 4096 Aug 24 23:14 ./
drwxr-xr-x 3 root root 4096 Aug 24 23:17 ../
-rw-r--r-- 1 root root 197 Apr 3 2010 default
-rw-r--r-- 1 root root 8704 Apr 3 2010 e2fs_stage1_5
-rw-r--r-- 1 root root 8544 Apr 3 2010 fat_stage1_5
drwxr-xr-x 2 root root 4096 Oct 5 2016 fonts/
-rw-r--r-- 1 root root 0 Feb 1 2016 grub2-installed
-r--r--r-- 1 root root 10268 Aug 24 23:25 grub.cfg
-rw-r--r-- 1 root root 1024 Aug 24 23:24 grubenv
drwxr-xr-x 2 root root 20480 Aug 24 23:05 i386-pc/
-rw-r--r-- 1 root root 9568 Apr 3 2010 jfs_stage1_5
drwxr-xr-x 2 root root 4096 Aug 24 23:25 locale/
-rw-r--r-- 1 root root 4214 Sep 13 2010 menu.lst~
-rw-r--r-- 1 root root 4214 Sep 13 2010 menu.lst_backup_by_grub2_postinst
-rw-r--r-- 1 root root 7904 Apr 3 2010 minix_stage1_5
-rw-r--r-- 1 root root 10720 Apr 3 2010 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 Apr 3 2010 stage1
-rw-r--r-- 1 root root 128552 Apr 3 2010 stage2
-rw-r--r-- 1 root root 2396122 Aug 24 23:14 unicode.pf2
-rw-r--r-- 1 root root 10280 Apr 3 2010 xfs_stage1_5
after I purge grub-pc and then remove the files manually, and reinstall grub-pc, the directory looks like this:
ls -la /boot/grub/
total 2348
drwxr-xr-x 2 root root 4096 Aug 24 23:49 ./
drwxr-xr-x 3 root root 4096 Aug 24 23:49 ../
-rw-r--r-- 1 root root 2396122 Aug 24 23:49 unicode.pf2
which is clearly impossible, there can't be that little in the directory for a functioning grub2 bootloader.
I have had this before, I have run into this again and again on Debian, the basic question is:
how do you remove a software package CLEANLY, meaning nothing left over, no files there and then reinstall it from scratch, a complete reset of the package like it was installed for the very first time on the system?
Also, I can't find out who owns the files in /boot/grub in the above longer directory listing, grub-common and grub-pc seems to not own anything in the /boot dir. But who does?
I have a system that used to run on grub 1 (legacy), but it got upgraded to grub 2. Now I want to clean it up and remove all config left over from grub legacy. How can I do that?
This is a Debian Buster Linux, and when I do
apt purge grub-pc
it will ask me if I want to erase /boot/grub, I say yes, but it does not erase anything there.
All the files are still there. If I now erase them by hand and reinstall grub-pc, it does not recreate them. I had this very strange behaviour before: dpkg somehow notices when a user erases files and marks these to never install them.
So how can I reinstall Grub2 from scratch, reset the whole config and remove all and every little bit of legacy config from grub legacy?
This is the directory with the leftover stuff from grub legacy and grub2 installed:
ls -la /boot/grub/
total 2616
drwxr-xr-x 5 root root 4096 Aug 24 23:14 ./
drwxr-xr-x 3 root root 4096 Aug 24 23:17 ../
-rw-r--r-- 1 root root 197 Apr 3 2010 default
-rw-r--r-- 1 root root 8704 Apr 3 2010 e2fs_stage1_5
-rw-r--r-- 1 root root 8544 Apr 3 2010 fat_stage1_5
drwxr-xr-x 2 root root 4096 Oct 5 2016 fonts/
-rw-r--r-- 1 root root 0 Feb 1 2016 grub2-installed
-r--r--r-- 1 root root 10268 Aug 24 23:25 grub.cfg
-rw-r--r-- 1 root root 1024 Aug 24 23:24 grubenv
drwxr-xr-x 2 root root 20480 Aug 24 23:05 i386-pc/
-rw-r--r-- 1 root root 9568 Apr 3 2010 jfs_stage1_5
drwxr-xr-x 2 root root 4096 Aug 24 23:25 locale/
-rw-r--r-- 1 root root 4214 Sep 13 2010 menu.lst~
-rw-r--r-- 1 root root 4214 Sep 13 2010 menu.lst_backup_by_grub2_postinst
-rw-r--r-- 1 root root 7904 Apr 3 2010 minix_stage1_5
-rw-r--r-- 1 root root 10720 Apr 3 2010 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 Apr 3 2010 stage1
-rw-r--r-- 1 root root 128552 Apr 3 2010 stage2
-rw-r--r-- 1 root root 2396122 Aug 24 23:14 unicode.pf2
-rw-r--r-- 1 root root 10280 Apr 3 2010 xfs_stage1_5
after I purge grub-pc and then remove the files manually, and reinstall grub-pc, the directory looks like this:
ls -la /boot/grub/
total 2348
drwxr-xr-x 2 root root 4096 Aug 24 23:49 ./
drwxr-xr-x 3 root root 4096 Aug 24 23:49 ../
-rw-r--r-- 1 root root 2396122 Aug 24 23:49 unicode.pf2
which is clearly impossible, there can't be that little in the directory for a functioning grub2 bootloader.
I have had this before, I have run into this again and again on Debian, the basic question is:
how do you remove a software package CLEANLY, meaning nothing left over, no files there and then reinstall it from scratch, a complete reset of the package like it was installed for the very first time on the system?
Also, I can't find out who owns the files in /boot/grub in the above longer directory listing, grub-common and grub-pc seems to not own anything in the /boot dir. But who does?