Why Use GRUB2? Good Question! (part 3) - page 2
Translating Bizarre Error Messages, and Fixes
Method 2: Move grub2 to /boot
If you want to keep the automated update-grub setup, you can move the grub files to your shared /boot so you can run them from any distro. But it's a bit more complicated than it sounds, because there are quite a few files that need to move.
Safest is to copy the current files to appropriate places on /boot, move them to a save backup spot, then link the /boot files back to where the system expects to find them.
Here's a set of commands that does that for Ubuntu 9.10. First, on the 9.10 machine where you installed grub2, copy all the important files to /boot:
cp -a /etc/grub.d /boot/grub/grub.d cp /etc/default/grub /boot/grub/grub-defaults mkdir /boot/grub/sbin cp -a /usr/lib/grub /boot/grub/lib cp /usr/sbin/grub* /usr/sbin/update-grub* /boot/grub/sbin
Be sure to check and make sure everything got copied! Then, on each distro that uses grub2, back up the existing files then link from the ones on /boot back to the standard location:
mv /etc/grub.d /etc/grub.d-SAVE ln -s /boot/grub/grub.d /etc/grub.d mv /etc/default/grub /etc/default/grub-SAVE ln -s /boot/grub/grub-defaults /etc/default/grub mkdir /usr/sbin/grub-SAVE mv /usr/sbin/grub* /usr/sbin/update-grub* /usr/sbin/grub-SAVE ln -s /boot/grub/sbin/* /usr/sbin mv /usr/lib/grub /usr/lib/grub-SAVE ln -s /boot/grub/lib /usr/lib/grubYou may need to adjust link locations for non-Ubuntu distros.
Both these solutions are hacks. You may need to add entries for new kernels by hand, or make similar adjustments. But if you're running multiple distros, you may feel it's better than needing to reboot every time any distro adds a new kernel. We can only hope that some future version of grub2 will address this problem in a more portable way.
Akkana Peck is a freelance programmer and writer, and author of the book Beginning GIMP: From Novice to Professional. She also fiddles with way too many kernels and Linux distros.
- Skip Ahead
- 1. Translating Bizarre Error Messages, and Fixes
- 2. Translating Bizarre Error Messages, and Fixes
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: GNOME 3.12 and New Betas for Ubuntu 14.04 and OpenMandriva Lx 2014.0
- 2Linux Top 3: Linus Lashes out, Linux 3.14 Gets PIE and Ubuntu One is Done.
- 3Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic
- 4Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 5Linux Top 3: Linux from Scratch, Ubuntu 14.01 Beta and Arch Updates