Skeleton SD card image for the Raspberry PiThis image is used by the Woof build system, which is used to create Puppy Linux. The image file has three partitions, all formatted with filesystems, but empty -- Woof will fill them with the required files to boot Puppy.The SD image file is named 'raspi-sd-4gb-skeleton-ext4_nojournal-09jul2012.img', or in compressed form 'raspi-sd-4gb-skeleton-ext4_nojournal-09jul2012.img.xz'. As well as having ext4 filesystem in the second partition (without journal), the partitions are aligned on 4MB boundaries. The reasons for these settings is described here: http://bkhome.org/blog/?viewDetailed=02884 http://bkhome.org/blog/?viewDetailed=02883 http://wiki.laptop.org/go/How_to_Damage_a_FLASH_Storage_Device For news about later SD image files, please monitor my blog: http://bkhome.org/blog/ How to write image to an SD cardYou need a 4GB or larger card, and Class 6 or faster is highly recommended (apart from being very slow, Class 4 is reported to be unreliable in the Raspberry Pi).For the example of the card being /dev/sdb: ...make sure card is not mounted!... Be absolutely certain that the SD card is /dev/sdb, not your hard drive! Then do this is in a terminal (if you are not running as root (administrator), you will have to append "sudo" before each line): # unxz --stdout raspi-sd-4gb-skeleton-ext4_nojournal-09jul2012.img.xz | dd of=/dev/sdb bs=4M # sync ...always run "sync" afterward, before removing SD card. The partitions on the SD cardThere are three partitions:
The start of partition #3 (swap) is aligned on a 8MB boundary. There is a 4MB gap between each partition. The advantage of knowing these offsets is that you can mount a partition in the file, without having to write the file to an SD card. For example, to mount the first partition: # unxz raspi-sd-4gb-skeleton-ext4_nojournal-09jul2012.img.xz...access the files in /mnt/sdimagep1 # sync Ext4 without journalThe reason for not having a journal is primarily to minimise writes to the Flash memory. There is also a small speed improvement.This is how it was created, assuming the second partition to be /dev/sdb2 (partition must be unmounted): # mke2fs -t ext4 -O ^has_journal -L puppy -m 0 -b 4096 /dev/sdb2Be careful when you plug your SD card into a computer, as most Linux distros will mis-report the filesystem as ext2, and will not be able to mount it. It must be mounted as ext4: # mount -t ext4 /dev/sdb2 /mnt/sdimagep2The very latest build of Puppy Linux (as at July 9, 2012) reports the f.s. correctly. Regarding f.s. corruption, as for example power-failure while using your RP, unfortunately having a journal does not guarantee safety and can lead to a false sense of security. A journal will mostly safeguard the filesystem hierarchy but files can get corrupted, and in fact there is a high likelihood of that happening. You might find this web page interesting reading, "Ext3 and RAID: Silent Data Killers?" (it applies to ext4 also): http://lwn.net/Articles/349970/ In the case of power-failure or any other abnormal shutdown, Puppy will automatically run a filesystem check at next bootup. The way this is done is if Puppy detects a prior abnormal shutdown, a ramdisk is created with a mini-Linux inside it, the main partition (#2) is unmounted and it's f.s. checked, then reboot. This f.s. check will repair errors, but as for ext4 with journal there is no guarantee that files haven't been corrupted. It would be wise to examine whatever files you might have been working on at the time of the abnormal shutdown. How to copy image off the SD cardThe image file is actually less than the size of a 4GB card. This is so it can fit on a wide range of 4GB cards, including the cheatiest cheap ones that actually have far less than 4GB on themThe size of the image is 3,858,759,680 bytes, which is 3.59GB. This equates to 920 4MB blocks, and it is recommended to read from the SD card with 4MB block size, like this: # dd if=/dev/sdb of=raspi-sd-4gb-skeleton.img count=920 bs=4M # sync Have fun! Barry Kauler 09 July 2012 |