1. Preamble
The aim of this howto is to show how you can upgrade a Frugalware-1.6 (Fermus) system to Frugalware-1.7 (Gaia).
2. pacman-g2
The new release comes with an improved pacman-g2, you should install it first:
pacman-g2 -Sy pacman-g2
3. Upgrading the system
Now it’s time to upgrade the system itself:
pacman-g2 -Su :: Starting local database upgrade...
You will be asked to replace some packages automatically. These are normal and you are expected to answer Y to these questions (or just hit ENTER).
After this, the list of to-be-upgraded packages is displayed. Just hit enter and wait. Make some tea, it can take a while. :-)
4. Updating config files
pacman-g2 does not touch configuration files in case you customized them. You should run
find /etc -name '*.pacnew'
and update each configuration file based on the .pacnew version. Once you’re done with one, you should remove the .pacnew file.
5. slocate removal
slocate has been removed and replaced by a maintained version called mlocate. It uses a very similar config file and should continue to function like slocate did before. Just wait for the first cron job iteration to update your mlocate database and you will be good to go. The only cleanup that should be done is the removal of the old slocate database. Use the command below as root to do this.
rm -rf /var/lib/slocate
6. timeconfig updates
Updates were made to timeconfig from frugalwareutils package to make it work with localtime again. It is recommended that you rerun timeconfig after a complete upgrade to update it, even if you are not using localtime. Also, you can perform the following cleanup command as root to remove a file that is no longer used.
rm -f /etc/hardwareclock
7. GRUB2 upgrade
We have dropped support for the old GRUB1, also called grub legacy. Your system will still continue to boot as it did before, as the old grub is still installed in your MBR and in your /boot/grub directory.
However, you should still upgrade ASAP to GRUB2. The exact upgrade directions will vary depending upon how your local machine was originally setup.
If you had previously installed GRUB1 to your root partition’s VBR, then you will have to change to installing GRUB2 to your drive’s MBR instead. GRUB2 does not support the VBR method anymore for technical reasons. This should not be a problem, as GRUB2 from this or any other distribution should be able to boot all your installed Operating Systems, including Windows, with its single installation presence.
There were two main installations we supported with GRUB1. One was the simple regular drive installation, and the other was software RAID1, which was mirror mode. Generally, you will want to install GRUB2 to your first hard drive’s MBR. This command should work, assuming you replace the last part with your real first hard drive device node.
grub-install --recheck --no-floppy /dev/sdX
If you are using RAID1, run this command on each of the disks used in the array so you will still have a bootable drive should any of them fail.
Before you reboot, you must generate a new GRUB2 config. This is done by this command:
grub-mkconfig -o /boot/grub/grub.cfg
Note that it is no longer acceptable to edit your grub configuration manually. Instead, it is advised to insert any customizations you require in /etc/sysconfig/grub-config and /etc/sysconfig/grub-custom.
If you used cfdisk to format your hard drive originally, you may run into these errors from grub-install:
/usr/sbin/grub-setup: warn: Your embedding area is unusually small. core.img won't fit in it.. /usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged.. /usr/sbin/grub-setup: error: will not proceed with blocklists.
This is caused by having insufficient empty space between the end of the MBR label and the first partition. There are two solutions, one being to repartition your disk, which will probably means a reinstallation of everything as well. It is preferred for your disk to start the 1st partition on sector 2048. This gives grub2 plenty of space to use in the future as well. If you choose this method, reformat with fdisk. It automatically chooses the proper starting sector.
The 2nd method is not one that is widely recommended, but you may use it if you wish. But it will cause some headaches when it comes time to reinstall GRUB2, such as a future upgrade. However, this will only work if your /boot directory is located on an ext2/3/4 filesystem. Run the following commands to complete this alternate install method. Replace /dev/sdX with the proper device.
grub-install --recheck --no-floppy --force /dev/sdX chattr +i /boot/grub/core.img
This bypasses the problem of GRUB2’s core getting relocated on disk, which is why the blocklist install method is not recommended.
If you were using RAID1 with the old grub, you may run into these errors from grub-install, depending on how you set it up originally:
error: found two disks with the index 0 for RAID md0. error: superfluous RAID member (2 found). error: found two disks with the index 0 for RAID md0. error: superfluous RAID member (2 found). /usr/sbin/grub-probe: error: unknown filesystem. Auto-detection of a filesystem of /dev/md0 failed. Try with --recheck. If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <bug-grub@gnu.org>
This is caused by a technical bug with the old 0.90 mdadm metadata format, and is a problem that GRUB2 cannot resolve at all. This is because it has no way to tell if the RAID metadata is for the whole disk or just the last partition on the disk. This bug occurs if the two just happen to align at the same place.
The only true solution to this problem is to recreate your array. So, before proceeding, you should make sure you have a proper backup of any data you cannot afford to loose if something goes wrong.
Assuming you are prepared to proceed, there are two possible solutions. First, we will try the method that is less painful, but not widely tested.
1) Reboot your system into a livecd. The frugalware installer will suffice for this.
2) After booting, goto a tty. This is done by pressing Alt plus one of the function keys from 2 to 6. Now, login to the shell.
3) Run this command on every single device you were using in your RAID1 array. Replace /dev/sdXX with the proper device name for each one.
mdadm --zero-superblock /dev/sdXX
4) Now, it’s time to recreate your RAID1 array. Replace the /dev/mdX with what you want the new device node to be. Replace --raid-devices=X with the number of RAID devices you are going to use to recreate the array. Finally, replace the (ALL RAID DEVICES) at the end with a complete list of all your RAID devices, using their full file paths.
yes | mdadm --create /dev/mdX --metadata=1.0 --level=1 --assume-clean --raid-devices=X (ALL RAID DEVICES)
5) Now, if this worked, you should be able to mount it immediately. Run this command to be sure. Again, replace /dev/mdX with whatever you used in the previous step.
mount -o ro /dev/mdX /mnt
6) If the previous step worked, then you are ready to install GRUB2. First, remount the RAID device as RW.
mount -o remount,rw /mnt
7) Now, mount some support directories and chroot into it.
mount none -t proc /mnt/proc mount none -t sysfs /mnt/sys mount none -t devtmpfs /mnt/dev chroot /mnt /bin/sh
8) Next, install GRUB2. Run this command on each of your RAID device’s MBR. Replace /dev/sdX with the appropriate device.
grub-install --recheck --no-floppy /dev/sdX
9) Now, generate the first GRUB2 config.
grub-mkconfig -o /boot/grub/grub.cfg
10) Finally, exit, unmount everything, and reboot. Commands are below.
exit umount /mnt/proc umount /mnt/dev umount /mnt/sys umount /mnt reboot
In the event that this previous method fails to convert your array, you will will have to do a complete reinstallation via the regular installer. This is why you should keep a backup.
After a complete upgrade, you should clean up the leftovers from GRUB1.
rm -f /boot/grub/{*_stage1_5,menu.lst,stage1,stage2,message,default}
8. The reboot
Since the kernel is upgraded, too, you have to reboot your machine.
Done!