How to enable squash file system support

I want to reduce the root file system size of ubuntu and port it to devkit. I have done the following

  1. installed squash file system 4.0
  2. Enabled it in kernel and had created uImage with squashfs and devkit support.
    3.Have created indiviual squashfs of all files of root file system ex:bin.sqfsh, etc.sqfsh
  3. modified etc/fstab to enable squashfs support
  4. created two partitions in sd card (fat32 and linux/ext3).
  5. placed the squashfs in linux partitions and booted
    it throw the following error

twl4030_rtc twl4030_rtc: setting system clock to 2000-01-01 00:00:01 UTC (946684801)
kjournald starting. Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on mmcblk0p2, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem).
Freeing init memory: 156K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to kernel.

Now where is the mistake? I suspect that the panic may be due to the reason that
I have created an ext3 type partition where i had placed my squashfs, so i guess the machine is looking for an ext3 type file system but it is not able to find it hence it throws such an panic.

if my suspicion is correct how to resolve this error or if my suspicion is wrong kindly help me in enabling squashfs rfs r how to create a minimal rfs?

thanks bahri,
for your kind reply and help i would try out…gues i made a sily mistake sqsh instead of sqfs… can you kindly expain more about the partition u mentioned. What i do while partition is
create an partition fat32/ with 49M {MLO,Uboot,uImage(with squasfs enabled)}
and create the remaining space for linux partition {for rfs}
and one more query… can i create a single sqfs of the root file system or create sqfs for indivual directories in root file system.

wow bahri,
thanks a lot for your kkind help…really helpful would follow it and put my success acroos your name ;)…

Are you able to boot wwith squashfs on beagle bone black?

I need some help on booting BBB with squashfs. Could you please share exact steps/ procedure.

Thanks,
Mrudula

hi chandra , to make a squash file system you have to
1. for the partition of your mmc you make first partition (mmcblk0p1)
fat 32 / +64M which contain the uImage (activate the squashfs)
2. for the second partition mmcblk0p2 / +1M
3. in you rootfile system called for example "rootdir"
mksquashfs rootdir rootdir.sqfs (your mistake is that you use
sqsh)
dd if=rootdir.sqfs of=/dev/mmcblk0p2

then when you boot you set the bootargs :setenv bootarg rootwait root=/
dev/mmcblk0p2 rootfstype=squashfs console=ttyS2,115200n8
good luck

so i will give you the best way to do the partition for a mmc (2 go)
*the first partition (uImage(squashfs and ext3 enabled) ,MLO,uboot):
      Type the mount command to check your currently mounted
partitions. If MMC/SD partitions are mounted, unmount them.
In a terminal open the block device with fdisk :
   $ sudo fdisk /dev/mmvblk0
  Print the current partition table typing p : you will see something
like this "Disk /dev/mmcblk0: 1967 MB, 1967128576 bytes"
and bellow you will see different partition in your card press "d"
Command (m for help): d ,to delete them and select the number for the
partition that will be deleted [1-4] delete them all.
Command (m for help): x
Expert command (m for help) : h
Number of heads (1­256, default 4): 255
Expert command (m for help) : s
Number of sectors (1­63, default 62): 63
Warning : setting sector offset for DOS compatibility
Now for the number of cylinders, we consider the global size
(1967128576 bytes) then divide it by (255*63*512) which gives
around 239.16 cylinders. We must round it down to 239.
Expert command (m for help) : c
Number of cylinders (1­1048576, default 4): 239
After these geometry settings, exit expert mode ('r' command) then
print again the partition table to check geometry:
Command (m for help): p
Disk /dev/mmcblk0: 1967 MB, 1967128576 bytes
Now, let's create the boot partition :
Command (m for help): n
Command action
   e extended
   p primary partition (1­4)
p
Partition number (1­4): 1
First cylinder (1­239, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1­239, default
239): +64M
Then we change its type to FAT32
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))
Command (m for help): w
Now, format the first partition in your card:
sudo mkfs.vfat ­-n beagleboot -­F 32 /dev/mmcblk0p1 this
partition will be fat32 named beagleboot
Then, remove and insert your card again. then copy (uImage(squashfs
and ext3 enabled) ,MLO,uboot in the card

*the second partition to hold the root filesystem. Its size can be as
small as 1MB for our use because we use the file system compressed bu
squashfs and this filesystem will be read only (you can make any
change) this type of root file system is made to protect the system
from any change :
sudo fdisk /dev/mmcblk0
Command (m for help): n
Command action
   e extended
   p primary partition (1­4)
p
Partition number (1­4): 2
First cylinder (35­239, default 35): 35
Last cylinder, +cylinders or +size{K,M,G} (35­239, default 239): +1M
Command (m for help): w
then your rootfile system called "rootdir" which contain
(etc,dev,bin,....) for example
$ mksquashfs rootdir rootdir.sqfs // to create your filesystem
image: called rootdir.sqfs
$ dd if=rootdir.sqfs of=/dev/mmcblk0p2 // this will copy all the
files(etc,dev,bin, ...) into the partition mmcblk0p2 probably you will
be not able to open this partition and see what she contains

*the third partition. Now, create another primary partition to hold
the general purpose
filesystem storing user and application data. Its size can fill the
remaining space on the card (accept the last cylinder proposed by
default):
Command (m for help): n
Command action
   e extended
   p primary partition (1­4)
p
Partition number (1­-4): 3
First cylinder (36­239, default 36): 36
Last cylinder, +cylinders or +size{K,M,G} (36­239, default 239): 239
Use 'w' to write your changes. To reload the new partition table,
remove the MMC card and plug it in again.
umount /media/disk umount /media/disk-1 umount /media/
beagleboot
Now, format the third partition in your card:
sudo mkfs.ext3 ­-n journaled_fs -­F /dev/mmcblk0p3 this partition
will be ext3 named journaled_fs
and copy the rootfilesystem in ext3

finally to boot from the second partition with squashfs and in that
case you will not be able to make any change to your filesystem
     bootargs=rootwait root=/dev/mmcblk0p2 rootfstype=squashfs
console=ttyS2,115200n8

to boot from the third partition with ext3
     bootargs=rootwait root=/dev/mmcblk0p3 rootfstype=ext3
console=ttyS2,115200n8

if the method of the partition look difficult you can use the gparted
apt-get install gparted
gksudo gparted /dev/mmcblk0
create the first partition fat32 64Mo
create the second partition 1 Mo
create the third partition ext3 2 go - 65 mo (looooooool)

goood luck