• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: What filesystems are supported for SD cards?  (Read 2699 times)
dsrt
Newbie
*

Karma: 0
Posts: 2


View Profile
« on: June 09, 2010, 10:15:17 PM »

What filesystems are supported for SD cards plugged into the SDIO port of a SheevaPlug?

I've had a plug for several months serving light duty as a Linux machine for experimentation, with the Ubuntu 9.04 image.  It has worked well, so I recently got another.  For the new one I installed Debian, using file from:

http://www.plugcomputer.org/index.php/us/resources/downloads?func=select&id=5

Submitted On: 10 Sep 2009
Submitted By: Jeff Lagman (jlagman)
File Date: 08 Sep 2009
File Version: 1.0.0

sheevaplug-installer-v1.0.tar.gz [MD5: 2ab9f45091232f7d998f0278bef2b751]

I couldn't get the "installer-debian-lenny" image to apply, so I tried "installer-debian-squeeze", and it finished with no problem.  After updating:

- apt-get update
- apt-get upgrade

the plug OS is (mostly) up to date.

debian:~# uname -r
2.6.30.2

Next I go buy an 8GB SD card:

SanDisk - 8GB Secure Digital High Capacity Memory Card

After inserting it in the SD port, I note the filesystem entry corresponding to the card.

debian:~# ls -la /dev/mmcblk0
brw-rw---- 1 root floppy 179, 0 Jun  9 04:28 /dev/mmcblk0

From the various forum discussions, I gather that the card needs to be formatted and mounted.

debian:~# mkfs.
mkfs.bfs      mkfs.ext3     mkfs.jffs2    mkfs.ubifs
mkfs.cramfs   mkfs.ext4     mkfs.minix    mkfs.vfat
mkfs.ext2     mkfs.ext4dev  mkfs.msdos

Lots of file system options, so I look around to see what filesystem is appropriate.  It seems many recommend ubifs for its flash orientation.  So I attempt to create the filesystem.  After a few tries, and various problems, I use fdisk to split the card into an extended partition with two 4 GB volumes.  After some trial and error, I arrive at:

debian:~# mkfs.ubifs -v -m 2048 -e 126976 -c 4096 -x zlib /dev/mmcblk0p1
mkfs.ubifs
        root:         (null)
        min_io_size:  2048
        leb_size:     126976
        max_leb_cnt:  4096
        output:       /dev/mmcblk0p1
        jrn_size:     8388608
        reserved:     0
        compr:        zlib
        keyhash:      r5
        fanout:       8
        orph_lebs:    1
        super lebs:   1
        master lebs:  2
        log_lebs:     5
        lpt_lebs:     2
        orph_lebs:    1
        main_lebs:    3
        gc lebs:      1
        index lebs:   1
        leb_cnt:      14
        UUID:         C1DE8EC1-6892-448A-A5B0-9C51F034E5A3
Success!
debian:~#

Next, I try to mount the filesystem:

debian:~# mount -t ubifs /dev/mmcblk0p1 /mnt/sdcard1/
UBIFS error (pid 4586): ubifs_get_sb: cannot open "/dev/mmcblk0p1", error -22
mount: wrong fs type, bad option, bad superblock on /dev/mmcblk0p1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

After some more looking around, I work out that ubifs is not expected to work with SD flash, as ubifs expects to talk to raw flash, while SD uses FTL (Flash Translation Layer).  Same deal with jffs2.  While both of these filesystems work fine on the plug's internal flash, they're not intended for use with SD.

Next I try to take a step back, and try vfat:

mkfs.vfat /dev/mmcblk0p2
mount -t vfat /dev/mmcblk0p2 /mnt/sdcard2

debian:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   256876         0    256876   0% /lib/init/rw
udev                     10240       120     10120   2% /dev
tmpfs                   256876         4    256872   1% /dev/shm
rootfs                  472968    197820    270312  43% /
/dev/mmcblk0p2         3873376         4   3873372   1% /mnt/sdcard2
debian:~#

So, vfat seems to work.

Next I try ext2 and ext3.

debian:~# mkfs -t ext3 /dev/mmcblk0p1
mkfs.ext3: /lib/libblkid.so.1: version `BLKID_2.17' not found (required by mkfs.ext3)
debian:~# mkfs -t ext2 /dev/mmcblk0p1
mkfs.ext2: /lib/libblkid.so.1: version `BLKID_2.17' not found (required by mkfs.ext2)
debian:~#

Long story short, it would be nice to use a journaling filesystem.  I don't seem to have the updated library to use ext<n>.  What are my options?

Thanks for any insight / recommendations.
Logged

hausschuh
Newbie
*

Karma: 0
Posts: 33


View Profile
« Reply #1 on: June 09, 2010, 11:22:53 PM »

This is a bug in the e2fsprogs. I came across it some days ago.
It has been fixed in the unstable tree of debian. So I fixed it by downloading the deb files for e2fsprogs and the 2 dependencies from the debian/unstable site and installed it via dpkg -i <debfile>

By the way - the SD Slot can't distinguish between filesystems. So all filesystems are supported as long as there are "drivers" for it.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #2 on: June 10, 2010, 02:00:03 PM »

What are my options?
Do you have any other Linux system available?  And a USB adaptor for an SDHC card (or an SD slot in a laptop...)?  If so, format it to ext3 on the other system to get around the e2fsprogs bug.
Logged

dsrt
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #3 on: June 12, 2010, 08:41:13 PM »

Thanks for the replies.  I'm not a Linux expert, so keep that in mind if I'm asking basic questions.

So, the e2fsprogs bug is preventing this image from being able to format the SD card using ext3?  I checked, and this package is installed on the plug.  I guess it is not configured right?  Wikipedia says that the unstable tree is squeeze.  So if I did "apt-get upgrade", wouldn't that pick up the updated package with your fix?

Is ext3 a good "default" filesystem for an SD card?  I would not need to access this card anywhere except on the plug, so interoperability isn't an issue.  (It might be nice to swap the card between the two plugs.)  Is wear-leveling an issue when considering this choice, or does that happen transparently to the filesystem layer?  It's great that the SD can't distinguish between filesystems, so given that, what is a good choice?

I do not have any other Linux machines with SD card access.  I guess that's an option, to go buy a USB adapter.
Logged

Pages: [1]
Print
Jump to: