Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to find out what filesystem should I use if I know in advance that a running Linux system is going to have the power pulled from underneath it.
I'd read about tux2, but it looked like all the patent problems with NetApp had run it off the road
I basically need a filesystem that after a hard crash isn't going to need manual intervention to bring it back up. I've been using reiser for a while now, but even with reiser I've experienced problems with sudden power outtages and had to run fsck.reiser on the partitions to fix things.
I have requirements that don't permit me to use a UPS, and the power is very unpredictable quite often dropping without warning.
What I had in mind was something along the lines of whatever Nomad Jukeboxes, or TiVo like set top boxes that can have their power pulled from without notice and still power back on without any disk corruption.
I see where you're coming from tink, but I'm thinking there's something more to it (perhaps a bespoke FS - I'm joining you in stabbing in the dark here ).
The reasoning behind there being more to it is that in consumer devices like the Nomad jukeboxes or TiVo boxes is that the end user isn't a computer user, they don't know about what's going on under the covers, they just expect it to work. Now, I've never ever heard of a TiVo or a Nomad (or iPod, etc.) having to be returned to the manufacturer because the batteries were pulled out of the thing or the power lead being yanked out not giving it a chance to shutdown gracefully - it just works, no evidence of an fsck, no lag in getting the device to start up again, they all just giddy on up
I like the idea of mounting the OS partition as read only, I'm **assuming** (I know I know..an ass outta.....) that you could pull the power on a read only partition as much as you like and not do any damage to the partition. Now we've just got to figure how to make sure that the pesky partition that you want to write data to doesn't get corrupted after a power down..
Has anyone worked on systems like this before that could cast some light upon our speculations?
Thanks for the replies tink, they've got me thinking about new directions
Well ... one possibility I can think of would be a set-up
where the machine e.g. streams video to a RAM-DISK,
and once a certain level of that thing is filled up puts
a HDD partition into a RW state, writes the block, flushes
the buffers and goes RO again ... would make the chance
of a failure during write-access pretty small (not impossible).
Just think about it logically: even if those other devices
had static RAMs in the GB size range, once the tuner
stops sending a continuous data-stream it'd STILL be
chopped-off at that stage and need some sort of consistency
check ... unless of course there's a setting telling an FS
to ignore silly things as unclean shutdowns, and just
forfeit whatever was going on while it crapped out. That
should be quite possible with a journaling FS like Reiser
or the likes.
I don't think that a Nomad Jukebox nor TiVo Operating Systems are on the hard drive. I'm sure that they use ROMS or flash ROMs similar to the USB flash memory systems. Think of these devices as embedded processors and not desktop computers.
The storage drive on a TiVo probably does have a formatted filesystem. It is possible to write raw data to an like a file stream with fixed bytes. If recording data and power is removed the last frame of data is automatically overwritten. I use data acquisition sytems of this type.
Yeah, I understand the strategy of framing for DVR's, but even before you get to overwrite the last partially written frame that's only going to be permissible if at the FS level you've not screwed up something pretty bad (every journaling FS I've looked at suffers from the possibility of corruption).
One technique that would work would be to have 3 partitions:
partition A - OS partition - read only
partition B - workspace1
partition C - workspace2
Partition B & C would be initially set read only and the application caches data waiting to be written for a set period. The app then mounts partition B read write, writes its data to partition B and then unmounts. Once unmounted it repeats the procedure to partition C.
This way, on boot up you could check to see if either of the partitions were corrupt, if a problem is found format the bad partition and copy over the data from the good partition. By perhaps splitting partition B & C over many partitions the need to copy over data would be dropped and you would just suck up the loss of potentially a gig or two of data.
Other than a RAM/ROM based system or read-only FS access, I would say michaelk has the best idea.
Quote:
Has anyone worked on systems like this before that could cast some light upon our speculations?
I designed a miniature server device that used a RAMDisk stored OS and Compact Flash as a storage media. For shutdown, the system would just remount everything read-only (it didn't unmount them) and cut the power.
Point is that, yes, you can kill the power to a read-only mounted file system with negligible risk of corruption. Unless there is some sort of hardware failure, anyway.
oops sorry tink, I missed your last post and the idea I put forward was kinda in the same manor that you said just using two hd' partitions instead of ramdisk. Made me feel kinda like the manager guy in the fedex adverts who does the hand wiggle thing when he repeats the same suggestion
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.