10 March 2009

Leanux - Running Linux on FAT just for fun

Most of the flash devices assume that fat is the only file-system. And there are plenty of electronic devices that run linux on fat. So just to know what it is to run linux on vfat, I tried it myself.

The openSUSE 11.1 installer wont allow you to partition the root as vfat. So I made 2 partitions, one ext3 and one vfat. Installed on ext3. Copied the whole partition to fat. I copied original files in place of symbolic links. Added vfat filesystem module to initrd . Modified grub boot from the fat partition with init=/bin/bash.

FAT's lack of support for posix file-permissions. was easy to overcome by mounting with all permissions to everyone, without users or noexec. It doesn't support symlinks, and special files. mknod will fail. But /dev is a tmpfs and it just copies the persistent files from /dev to the tmpfs on boot, instead of copying I created fresh device files in tmpfs. `mount` failed trying lock the file /etc/mtab. Mounting with -n worked. I guess plenty of things would fail if I try to run a proper desktop on FAT as it is.

I booted only to /bin/bash. When I tried doing a "exec init 1", it complained something like cannot remove /var/run/do_confirm. I didn't proceed further. This was a fun way to kill time while getting some insight of the booting process.

5 comments:

Anonymous said...

good I will not try these ;)

Anonymous said...

Could you run some intermediate FS that does compression or encryption and just uses the FAT storage as storage.
For example, you could save an iso image on the FAT drive (less than 4 GB) and mount an iso file-system, you would still need a compatible FS for root to mount on.

Anonymous said...

if you want you can install "systemrescuecd" http://www.sysresccd.org/Main_Page on your usb stick with fat filesystem, and you also can use your stick as usual.

Anonymous said...

Try posixovl for posix ablilities on fat/ntfs

DevOps said...

This is greek,
I guess the simple way is to format the flash devices to ext3 and install linux on it, anyway it was a good little tip.