Skip to contentSkip to conversation

ReiserFS on a USB memory stick?

DISCUSSION Felix E. Klee 2 participants 6 messages Oct 3, 2003 – Oct 7, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

I want to run LINUX on a 512MB USB memory stick that supports a minimum of 100,000 rewrites. I'll mostly be running an EMACS session with Preview-Latex where I'll be editing and compiling TeX files. Note that I don't care if the stick fails after 3 months, but it should last about that long.

Is ReiserFS a suitable file system for that kind of application or are there better systems? Are there some ways to tune caching so that data isn't written to the stick as often as it could?

BTW, I already found JFFS2 but it seems to be made for direct access to flash hardware, while a USB memory stick emulates a hard disk or floppy super drive.

Felix

Signature · 3 lines
To contact me off list don't reply but send mail to
    felix DOT klee AT inka DOT de
Otherwise your email to me might get automatically deleted!
#1 lore raw
Quoted 12 lines · Felix E. Klee

Hi,

I want to run LINUX on a 512MB USB memory stick that supports a minimum of 100,000 rewrites. I'll mostly be running an EMACS session with Preview-Latex where I'll be editing and compiling TeX files. Note that I don't care if the stick fails after 3 months, but it should last about that long.

Is ReiserFS a suitable file system for that kind of application or are there better systems? Are there some ways to tune caching so that data isn't written to the stick as often as it could?

Quoted 8 lines

BTW, I already found JFFS2 but it seems to be made for direct access to flash hardware, while a USB memory stick emulates a hard disk or floppy super drive.

Felix

Compact flash does wear leveling in hardware, I don't know about memory sticks. If people use the FAT filesystem on them, then almost surely they do also.;-)

If there is wear leveling, reiserfs will work. You might want to reduce the journal size a bit though.

Signature · 1 line
Hans
#2 lore raw
Quoted 10 lines · On Fri, 03 Oct 2003 21:06:53 +0400 Hans Reiser wrote:
Quoted 10 lines

I want to run LINUX on a 512MB USB memory stick that supports a minimum of 100,000 rewrites. I'll mostly be running an EMACS session with Preview-Latex where I'll be editing and compiling TeX files. Note that I don't care if the stick fails after 3 months, but it should last about that long.

Is ReiserFS a suitable file system for that kind of application or are there better systems? Are there some ways to tune caching so that data isn't written to the stick as often as it could?

Quoted 5 lines
Quoted 3 lines

BTW, I already found JFFS2 but it seems to be made for direct access to flash hardware, while a USB memory stick emulates a hard disk or floppy super drive.

Compact flash does wear leveling in hardware,

AFAIK, only the expensive ones do.

Quoted 3 lines

I don't know about
memory sticks. If people use the FAT filesystem on them, then almost surely they do also.;-)

I guess not - it's mentioned neither on the packaging nor in the specifications at

    http://www.twinmos.com/flash/flash_p_mobile_usb20.htm#s
Quoted 2 lines

If there is wear leveling, reiserfs will work. You might want to reduce the journal size a bit though.

I'm a newbie to the internals of file systems so I don't see what would be the advantage of that other than using less space. Could you tell me why making the journal size smaller would be an improvement?

BTW, I read on
http://freshmeat.net/articles/view/212/
that the journal isn't cached. Is this really true? If so this would probably render ReiserFS totally unusable for a flash memory (even with wear leveling) because there would be far to many accesses.

However, I wonder if other file systems are much better even if they cache all disk writes. The problem that I see is that there probably are always parts on the disk that are used for maintainance (e.g. an inode-table) that get written to over and over again.

But this problem can be somewhat improved to my liking by proper caching of write accesses. I need a solution where data is written not more than once to the same sector in less than, say, a minute. Is such a solution feasible, i.e. are there file systems that cache all write accesses? Or is this not a question of file systems at all, i.e. is caching done by LINUX on a layer between the block device and the file system(if so, this would answer my caching questions above)?

Finally: Do you have an idea which common LINUX file system distributes writes best (this includes writes to inode-tables, etc.)? You mentioned FAT before, but this is not really usable for running LINUX on it (other than with UMSDOS or some such thing).

Felix

Signature · 3 lines
To contact me off list don't reply but send mail to
    felix DOT klee AT inka DOT de
Otherwise your email to me might get automatically deleted!
#3 lore raw
Quoted 4 lines · Felix E. Klee

I'm a newbie to the internals of file systems so I don't see what would be the advantage of that other than using less space.

none

Quoted 7 lines

Could you tell me
why making the journal size smaller would be an improvement?

BTW, I read on
http://freshmeat.net/articles/view/212/
that the journal isn't cached. Is this really true?

Not at all. All journaling file systems cache the journal, with the possible exception of NTFS whose performance sucks.

Also, preserve lists were replaced in ReiserFS by the journaling code many years ago. Maybe I should work on updating our website today, and displace all the V3 docs with V4 docs....

In my benchmarks at least, ext3 performs better than XFS except for very large files and large directories.

Quoted 17 lines

If so this would
probably render ReiserFS totally unusable for a flash memory (even with wear leveling) because there would be far to many accesses.

However, I wonder if other file systems are much better even if they cache all disk writes. The problem that I see is that there probably are always parts on the disk that are used for maintainance (e.g. an inode-table) that get written to over and over again.

But this problem can be somewhat improved to my liking by proper caching of write accesses. I need a solution where data is written not more than once to the same sector in less than, say, a minute. Is such a solution feasible, i.e. are there file systems that cache all write accesses? Or is this not a question of file systems at all, i.e. is caching done by LINUX on a layer between the block device and the file system(if so, this would answer my caching questions above)?

Quoted 5 lines

Finally: Do you have an idea which common LINUX file system distributes writes best (this includes writes to inode-tables, etc.)? You mentioned FAT before, but this is not really usable for running LINUX on it (other than with UMSDOS or some such thing).

No no, FAT DOES NOT distribute writes, which is why if FAT is used on something you know it must use wear leveling (or it is a piece of trash).

I suggest you simply ask your manufacturer if your stick does wear leveling. It most likely does.

Quoted 5 lines

Felix

Signature · 1 line
Hans
#4 lore raw

I should also add, in regards to the article, if you are using XFS on Linux, it is not as stable as ext3 and reiserfs. I think the article author doesn't understand just how much code gets changed during a port. It took them years to do the port. ReiserFS is more stable mostly because it was finished before the others (we worked pretty hard to make that happen).

Signature · 1 line
Hans
#5 lore raw
In reply to Hans Reiser
Quoted 8 lines · On Sat, 04 Oct 2003 08:50:22 +0400 Hans Reiser wrote:
Quoted 4 lines

Finally: Do you have an idea which common LINUX file system distributes writes best (this includes writes to inode-tables, etc.)? You mentioned FAT before, but this is not really usable for running LINUX on it (other than with UMSDOS or some such thing).

No no, FAT DOES NOT distribute writes, which is why if FAT is used on something you know it must use wear leveling (or it is a piece of trash).

Ah, I misunderstood your reply to my original message. I thought you were referring to the fact that files in a FAT based system get fragmented fast and therefore data gets distributed (which actually doesn't matter since the file allocation table is probably the most problematic part).

Quoted 2 lines

I suggest you simply ask your manufacturer if your stick does wear leveling. It most likely does.

I just got answers from TwinMOS international and German technical support. One said that all their sticks use wear leveling technology, the other said, more specifically, that it uses so called "random write" technology.

So, I guess it doesn't really matter what file system I use if I want to minimize the wear on the stick.

BTW, as I'm running LINUX on the stick, it might be a good idea to backup, erase and restore the entire data on the stick once in a while. Due to wear leveling technology this might interchange the physical position of areas with rewritable data (/home, /var, etc.) and areas with read-only data (/usr, etc.). This might also be a good chance to try out different file systems ;)

Felix

Signature · 3 lines
To contact me off list don't reply but send mail to
    felix DOT klee AT inka DOT de
Otherwise your email to me might get automatically deleted!