Fatdog64 Full Install Guide

Warning

I need to begin this guide with one notice and two warnings.

First and foremost, Fatdog64 runs best in frugal install mode, because that is what it is designed for.

Second, Fatdog64 officially does not support full install. If you have problem you are most likely on your own.

Third, Fatdog64 is not designed to support full install. Certain advertised features of Fatdog64 depends on its layered filesystem and will not work when you are running Fatdog64 in full-install mode. They will simply do nothing.

If this does not convince you not to run in full install, then nothing will; and in that case may this guide be of help to you in your quest to make Fatdog64 run in full install mode.

But before you do anything, please read this guide until its completion and ensure yourself that you understand what it means and understand what every step does. Don't just follow blindly. These steps contain dangerous data-destroying commands that can easily wipe out your data - even in unrelated places.

YOU HAVE BEEN WARNED. CONTINUE AT YOUR OWN RISK.


Background

Skip background and just how me the steps.

What is "full install" anyway? A "full install" is the traditional way of every other operating system there is installed and running. This includes setting up a dedicated partition that will hold the files that make up the operating system; and then copying over those files to that partition; and finally installing boot loader to start the operating system.
If you install Ubuntu (as opposed to running its LiveCD), then you would have installed in "full-install" mode. If you install Centos, you would have installed in "full-install" mode. If you have Windows installed, it will be in "full-install" mode. Almost every other operating system is installed in "full-install" mode.

Fatdog64, by contrast, runs in what people call as "frugal install". In "frugal install", the operating system files are combined together in one huge file (usually compressed to make is smaller) instead of spread all over in a partition. To perform "frugal install", you basically just need to copy these few files (usually not more than 5, in Fatdog64 it's actually two files only) to an existing partition, and modify an existing bootloader to boot from this compressed file. No dedicated partition is needed - Fatdog can use and share partition with existing operating systems (Windows, other Linux, etc). No dedicated bootloader is needed either - in most cases you can configure your existing bootloader (Windows, Linux, etc) to boot Fatdog.

A "frugal install" is very much like a LiveCD except that the operating system has designed to support this mode of working from the ground-up, designed to permanently run in this mode, and make use of special features you can only get when running in this mode. There are many benefits of running in frugal install. Apart from the fact that you don't need dedicated partition, there are other benefits:
  1. Easy and very quick to install, even by hand: you only need to copy a handful of files instead of requiring and installer to copy thousand of files which must be copied to the correct places and configured correctly
  2. The original operating system files are never changed, so you can always restore to a pristine "factory-default" setup in an instant.
  3. The layered filesystem model used in "frugal install" offers many benefits you cannot in full install - e.g. instant zero-copy sandboxing, ability to install/uninstall packages without altering original OS files (using SFS system), etc.
But full-install is not also without benefit. Firstly, the partition is dedicated to the operating system so it can do what it pleases; it can optimise itself in the way that a frugal install cannot. It uses the minimum amount of resources so it is generally faster (though how much faster is arguable) and it uses less RAM (though how much lesser is also arguable).

Whatever it is, it is worthwhile to repeat again that Fatdog64 does not officially support full install since Fatdog64 600 (Fatdog64 521 and older did support full install). But it does not meant it cannot be done. It means that it is not fully tested, and there is no automated support for installing Fatdog in full-install mode so you will have to install it manually - of which the steps are outlined below.



Layered Full Install


There are two full-install possibilities: Layered Full Install and True Full Install.

1. In Layered Full Install, the stackable filesystem is still active and working.
You still get many of its benefits (with caveats). 

2. In True Full Install, the stackable filesystem is not used at all.
In this mode Fatdog runs like any standard Linux distributions (with its associated headaches).

To simplify matters, in this guide I will first show to get Layered Full Install working, and then used that as a base to go with True Full Install.

One last comment before we go: The guide assumes you already have a working bootloader (grub, grub4dos, extlinux, rEFInd, etc) and you know how to configure them to add new OS installs.

Assumptions

1. This guide will not provide details of the bootloader installation or configuration steps; there are plenty of other guides and tutorials for those. If you don't know how to do this then STOP AND DO NOT READ ANY FURTHER. For the rest of this guide, I will use grub4dos as an example but the principle is the same and the instructions should be adaptable to other boot loaders. 

2. The guide assumes you are currently running Fatdog in LiveCD mode. 

3. You will perform standard installation. That means, one kernel file (vmlinuz) and one initrd file. No small initrd, or other variations.

Steps

1. Create and format the partition where you want to install Fatdog to.

For the sake of illustration, I will assume we're going to install to /dev/sda2. You should replace this with your own where you want to install. You should replace reference to /dev/sda2 and its mountpoint (/mnt/sda2) to the partition and mountpoint of your choosing.

If you don't know understand what this means or you don't know how to create a new partition - STOP AND DO NOT READ ANY FURTHER.

I will also assume that this partition /dev/sda2 is empty. If yours is not empty, please delete all the other files and directories there. Also, for obvious reasons, this partition must be a Linux-compatible partition (ext2, ext3, ext4, or xfs, etc). We recommend to use a self-healing filesystem (filesystem with a journal, such as ext3 or ext4).

2. Use the Fatdog Installer to install Fatdog to the target partition /dev/sda2.

3. Once installed, from with Fatdog desktop, click the sda2 drive icon. Rox will launch and shows a lone boot folder, which contains the vmlinuz and initrd that has just been installed. In addition /dev/sda2 is now also mounted at /mnt/sda2.

4. Click that boot folder to go inside, and then click initrd. It will open and extract the contents of initrd to a temporary location. Please notice among the many files, there will be a file called fd64.sfs.

5. Switching to the Rox folder that contains the initrd's contents, open a terminal with the current directory set to the folder shown by Rox (step: right-click, then choose "Window", then choose "Terminal here").

6. In the terminal, type the following:
unsquashfs -f -d /mnt/sda2 fd64.sfs

Remember to replace /mnt/sda2 with the actual partition mountpoint that you use.

7. When the process is done, close the terminal. Then go back to the folder that contains expanded initrd's content.

8. Delete that fd64.sfs. Then click repack-initrd.

9. The installation is now practically done. Next, you just need to instruct your bootloader to boot Fatdog. The following is an example for grub4dos menu.lst:

title fatdog layered full install
root (hd0,1)
kernel /boot/vmlinuz savefile=direct:device:sda2:/ basesfs=none
initrd /boot/initrd
As usual, replace sda2 with the partition that you actually use. Test it - boot to it now.

After-note

With layered full install, the layer system is still active and thus you can still load SFS just like when you run frugal install. The only catch is - these additional SFS files cannot be located in the same partition of your full install. For example in this guide you cannot have SFS files in /dev/sda2 partition - it won't work. You have to put them elsewhere (sda1, sda3, sdb1 etc, anywhere but sda2).

You can still make use of the sandbox facilities, too.

If you change the direct:device:sda2:/ to ram:device:sda2:/ , you will be running full-install with the RAM layer and you will get the ability to choose whether or not to save changes made during the session. The details on how to configure this is discussed elsewhere.



True Full Install

With true full install, the stackable filesystem is fully de-powered and you will be running Fatdog64 in the traditional way, in every sense of the word.

To be able to perform True Full Install, you must have successfully perform the Layered Full Install as explained above. The following steps picks up where Layered Full Install ends. I continue to use sda2 for illustrative purposes.

1 - 9. Perform Layered Full Install.

10. Boot into the Layered Full Install and check and everything is working well as it should.

11. Now, using drive icons, open sda2 (the device you have your layered full install). There will be tons of folders here now (this is the result of what you did in step 6).

12. Find the boot folder and click it to go inside, and then click initrd. It will open and extract the contents of initrd to a temporary location. Please notice among the many files, there will be a file called kernel-modules.sfs.

13. Switching to the Rox folder that contains the initrd's contents, open a terminal with the current directory set to the folder shown by Rox (step: right-click, then choose "Window", then choose "Terminal here").

14. In the terminal, type the following:
unsquashfs -f -d / kernel-modules.sfs

and on Fatdog64 721 onwards, also do this:
cp -a kernel /

15. Close the terminal, and also close that Rox folder with initrd's content in it.
Do not click repack-initrd - you don't need to repack it because we haven't changed anything.

NOTE: Step 16 unnecessary for Fatdog64 721 onwards.
16. Open the file /etc/fstab with your favorite editor (e.g geany).

Look at these lines:
# proc         /proc         proc   defaults         0      0   # mounted by /init
# sysfs         /sys         sysfs   defaults         0      0   # mounted by /init
Remove the hash (#) at the beginning, so they look like this:
proc         /proc         proc   defaults         0      0   # mounted by /init
sysfs         /sys         sysfs   defaults         0      0   # mounted by /init
Then save the file.

NOTE: Step 17 unnecessary for Fatdog64 721 onwards.
17. Open the file /aufs/pup_save/etc/BOOTSTATE with your favorite editor.

Delete all the contents inside, and replace it with the following:
NOT_USING_AUFS=true
AUFS_ROOT=/aufs

SAVEFILE_MOUNT=/
18. It's done! Now you only need instruct your bootloader to boot Fatdog properly.

It is best to create a new entry for the True Full Install setup that you have just created, rather than modifying the entry you created for the Layered Full Install while you're testing (because the the Layered Full Install gives you a way out to boot the system in case you have not done these steps correctly; and then "fix" your mistakes):

The entry could look something like this (assuming grub4dos again):

title fatdog true full install
root (hd0,1)
kernel /boot/vmlinuz root=/dev/sda2 rw rootwait
19. Now re-boot and boot into the True Full Install entry you have just created.
If it works, then you can safely delete the "initrd" file in your / directory (and the Layered Full Install boot entry).
If you fail, you can always go back to your layered full install mode and re-do the above.

After-note

With true full install, the layer mode isn't used at all and you cannot use any layer-related functions such as loading SFS, sandbox, etc. There are many posts in the Puppy Linux forum explaining how to do the equivalent of these.

If you don't delete the Layered Full Install boot entry, you can always use it to boot in Layered Full Install mode again. Just remember, if you do that, before you boot into True Full Install again you need to re-do step 17 - edit your
/aufs/pup_save/etc/BOOTSTATE and make sure it contains the correct content (NOTE: not necessary for Fatdog64 721 onwards).