![]() |
ext3 linux filesystem on SD
My N800 has a 2 GB SD and a 128 MB mini-SD. I wasn't using the 128 for anything, so i installed the ext2 progs app and formatted it with ext3. I want as much space as i can get, so i ask for:
no reserved space for root (-m 0) smallest blocks (-b 1024) I ask for journaling, which consumes some space but makes the file system recoverable from a variety of errors. This makes the file system ext3. (-j) Become root: On the N800, put the target in the external drive and say: mke2fs -b 1024 -j -m 0 -L extra /dev/mmcblk1p1 Unfortunately, the busybox 'df' doesn't report inodes (number of files). And mke2fs's default number of inodes is probably double what you need or more. You need an inode per file, so not having enough means you can't create more files. Running out is bad. However, even unused inodes take up space. So too many inodes is bad. Anyway, the card was recognized by OS2008 immediately. (I didn't have to edit /etc/fstab). And, it lets me execute apps from it (which FAT and VFAT won't do). My Linux (Ubuntu Fiesty Fawn) box mounts it as ext3 automatically. I have to use 'sudo' on the linux box to copy files to it. I may make a 'user' account (uid = 29999, with gid 29999) on the desktop box that would likely do the right thing without fuss. Since things can be executed on it, i should be able to move stuff from the internal card to it, leaving a symbolic link behind from the root filesystem. That should let me install more total stuff than would otherwise fit on the internal card alone. People on this forum talk about booting from mmc or one of the SD cards to get what i want. It doesn't look as if it's needed. Anyway, since i only run Linux on my desktops, this really rocks for me. BTW, under OS2006 on my 770, this didn't work. I never had root, so i wasn't able to edit /etc/fstab to find out if that would work. |
Re: ext3 linux filesystem on SD
Quote:
mke2fs -b 1024 -i 32768 -j -m 0 -L extra /dev/mmcblk1p1 The default is probably 4k (in any case it shouldn't be smaller than the block size). |
Re: ext3 linux filesystem on SD
Maybe for more info you can use "di" (it's available in my repo)
di -f "m i" will display "mountpoint number_of_inodes" Using -m 0 might create performance penalty on full device.. |
Re: ext3 linux filesystem on SD
In the Fedora linux list, we had a long thread about ext3 on Sd cards. Consensus was that it is bad to do this because it will use up the finite number of writes on the card. They recommend VFAT because it does not make as many separate writes when files are accessed. ext2 is expensive because it tracks so many attributes,especially atime.. ext3 is more costly because of journaling.
In this list, I've not seen much discussion on this, but plenty of people write 'my SD card died.' Maybe that's just a coincidence :) PJ |
Re: ext3 linux filesystem on SD
I remove atime on ext2 filesystem on my PC. Just do the same on the IT?
While FAT is adapted for very small cpu systems, there are a lot of limitations.. ->Max File size ->No links (hard/soft) <-- painful for people here who port stuffs ;) ->No security wrt to User Rights. Also no posix file permissions. ->Case insensitive ->No recovery mechanism ->Obscure patent ->Strange naming convention ->Character encoding I agree about journaling impact.. |
Re: ext3 linux filesystem on SD
Quote:
Oops, too slow! :) |
Re: ext3 linux filesystem on SD
By the way, I've ported some recent ext2fs stuffs in my repo when I was having fun with partition encryption
e2fsck-static 1.40.3-1 e2fslibs 1.40.3-1 e2fsprogs 1.40.3-1 libblkid1 1.40.3-1 libss2 1.40.3-1 libuuid1 1.40.3-1 Just realized I forgot the -dev packages for the developpers hanging here :) |
Re: ext3 linux filesystem on SD
Quote:
http://www.internettablettalk.com/fo...1347#post81347 http://www.internettablettalk.com/fo...4708#post34708 http://www.internettablettalk.com/fo...5832#post25832 These are just my opinions. I've been using ext3 since day one (ok maybe two :) of mmc booting and the (kingston 2gb mmc) card is sill ok after 1 or 2 years of heavy service in 770. I've switched to ext2 on n800/OS2007 and N810/OS2008 since the OS is sufficiently stable and does not reboot. OS2005 and 6 was very panicky and fragile system on 770 so ext3 definitely paid off. |
Re: ext3 linux filesystem on SD
I was talking of the CPU usage of the journaling, not the "finite number of write" which is probably more than you can use..
|
Re: ext3 linux filesystem on SD
Over the years, i've done benchmarking on various Linux systems, starting with my 386. I've taken a disk, formatted it, filled it to full with lots of little files, deleted random files here and there, then ran disk throughput benchmarks with the remaining fragmented space. I saw no evidence of slowdown with and without -m 0. I've heard that others have done this work and have indeed measured a slowdown. But i've been running with -m 0 under Linux since very early on without problems. Tossing 5% to the ether has bothered me since Berkeley included it in 4.2 BSD. It's a tax. There's a similar tax for journaling (ext3), but ext3 has saved my data multiple times. Yes, i do backups too.
New Hampshire does not have an income tax. I haven't figured out what services i'd be missing if i lived there. Maybe nothing. The highways seem to be plowed quicker and better than Taxachuesettes. |
Re: ext3 linux filesystem on SD
Historically, on *nix systems, the reserved filesystem space wasn't intended primarily for performance reasons and has little to do with fragmentation*. The concept was to provide systems administrators with enough space to manage things when the users fill up the disk.
Remember, on [large, multi-user] *nix systems, many files are opened and written to during normal system operation or the login process. This is especially true in a windowing environment (ie., Openwindows, Xsgi, etc.). Without this reserved space, it can be very difficult to login as root and do anything (ie., compress files) to make the system useable for the screaming hordes. When a disk is "full" you still want log files to continue to be written...if login can't write to wtmp, it's not pretty. (Welcome to a good description of my day job!). With the introduction of "modern," "high-capacity" drives (circa 1992), the historic percentage of space reserved for root has grown to a huge size. I typically cut that down to a small number of blocks, but don't set it to zero. On my personal systems, I'll set the reserved size to zero for "data" volumes, but not for the partition that holds /var, /, or /etc (if they differ). Oh, by the way, I also run ext3fs on the internal sd and removable sd cards in my N810. * Since historically (ie., in things like the Berkely FFS, UFS, ext2fs) there's no "defragmentation" command under *nix, so the presence of reserved space still doesn't allow the end user--even root--to defragment the filesystem. I don't consider ufsdump/newfs/ufsrestore to be a "solution". :) |
Re: ext3 linux filesystem on SD
As a long time Unix administrator, i can say that having a little extra space for root only has NOT proven valuable. The primary command to make new space is not gzip, or even bzip2, but rm, which is faster and doesn't require extra space. Having the user's write(2) fail is bad, and it doesn't matter if 5% of the disk is free or not. So, i maintain a margin. But if 5% is reserved for root, then two margins are maintained. That's double taxation. Besides, these days one can create a RAM filesystem for temp space. My desktop has more than a gigabyte of RAM that could be tapped.
Besides, on larger multiuser systems (eg: the n800), there are multiple volumes. Just because one drive is full doesn't mean they all are. That said, the Unix 'sort' command could fill three filesystems with a single command: /tmp, /usr/tmp and ".". |
Re: ext3 linux filesystem on SD
OK, so it's been a couple months. That thing i was trying to avoid actually happened. My ext3 filesystem has become corrupt. First symptom: media player couldn't find the next audio track - and the book was just getting to the exciting part.
I rebooted, and unmounted the SD card. e2fsck fixed some errors, then aborted with "short read". I thought that meant that there was at least a bad block on the card, but dd could read the entire volume, and 3 runs of badblocks didn't find anything. I ran e2fsck again, and it got further, making some changes. Then it got a segmentation violation. That's repeatable. I've got a USB SD card adapter, so i mounted the card on my x86 linux desktop machine. It can read the card - dd reads the whole thing (only a little quicker than the n800 can). But e2fsck there says that the magic number is not recognized. Oh. Some byte order problem? I dunno. The Arm is not the same byte order as the x86. So, i'm back to plan B. For some reason, the n800 mounts the corrupt filesystem. Plan B is to copy as much as possible from the card to backup, reformat, and restore. Fortunately, the little files (text, etc.) are the important ones. The big files - audio and video, are never edited on the n800, and so are available on the desktop, if i want them. In fact, a list of directories is enough to restore these. The first attempt at backup failed. There's a directory loop, and the backup keeps cycling through the same files... But it appears that most or all the files will be recoverable. Last week's backup will not be needed. A good thing, since lots has happened in the last week. No idea what might have caused the error. My friends complain that it is impossible to mess up a flash drive. |
Re: ext3 linux filesystem on SD
Backup, reformat with badblocks check, restore. Back on the air. No media errors found.
|
Re: ext3 linux filesystem on SD
It has happened yet again. Current idea is that the little tab that holds the 'internal' SD card in slides free, causing intermittent contact. e2fsck crashes with seg fault. Might like to debug e2fsck, but am reformatting card. At least there does not seem to be anything wrong with the card.
The n800 does not boot with a corrupt internal SD card. What does it use it for? Well, it *might* use it for VM, but even if i've turn that off, it won't boot with a corrupt card. That means i must at least format it in the external position. Wasn't there a possible bug having to do with large SD cards (16 GB in this case) and the external position? Or is that fixed? I've reflashed with the latest. |
Re: ext3 linux filesystem on SD
If you think the tab might be sliding, try a piece of tape to hold it in place.
|
Re: ext3 linux filesystem on SD
How do you use the noatime option? I know how to do it in my /etc/fstab file, but It was my understanding that under OS2008 the fstab file was ignored. Am I wrong and all I gotta do is edit my fstab, or is there more to it than that?
|
Re: ext3 linux filesystem on SD
Quote:
|
Re: ext3 linux filesystem on SD
Quote:
|
All times are GMT. The time now is 19:55. |
vBulletin® Version 3.8.8