Slashdot Mirror


Can Linux Work Without Shutdown?

Glen Raphael submitted this odd question a while ago: "Suppose I have a test tool running under Linux in an environment where the power is expected to die often and for long periods of time without any warning (and buying a UPS isn't an option). How can I make it safe to just turn off the power to the PC running Linux without properly shutting down?" So what is one to do when they want to run a Linux box and they can't trust their outlet? Glen continues...
"It's okay for fsck to run at startup but I want to minimize the damage it has to repair and I want to entirely avoid the need to boot as root in order to repair major damage. What can I do to accomplish that goal? Performance is not an issue. I thought of doing a "sync" every minute or so, but that seems silly. Is it possible to turn off disk caching instead and if so how do I do that? What else can or should I do in software to ensure that you can turn off the Linux machine by hitting the power switch or cutting power to the building and not expect major repairs when the power comes back up?

(Side note: If this problem can't be solved, the favored alternative is to give up on Linux and rewrite the tool using DOS. Right now I'm using RedHat 5.1 or 5.2 on a generic Pentium notebook.) "

61 comments

  1. Car MP3 player example by Anonymous Coward · · Score: 0

    One of the things you might look into is the work done to customize Linux to work on those car MP3 players, such as the one at http://www.empeg.com. Those players are made to shut off whenever the car does.

    One obvious thing to do would be to mount any of the filesystems you don't need to change (such as the root filesystem and maybe /usr) as read-only. There's no chance of corrupting anything on a read-only filesystem. As for the other filesystems, it just depends on what the system is doing at the time of the power outage. If nothing is happening, the system will be fine, but if there are many files open and/or being updated, then you could run into many problems.

  2. Synchronous Writes by Anonymous Coward · · Score: 0

    If you mount the filesystem with the -o sync
    option then you shouldn't loose any information
    when the power is lost. However you will still
    need to fsck the filesystem on startup.

  3. Orderly shutdown by Anonymous Coward · · Score: 0

    Yah, I would purchase an inexpensive UPS, just one that can carry the system for a few minutes. Either get a UPS with a power-failure signalling cable, or if they're too expensive, get a 120V SPDT relay with the coil hooked to the power (before it is buffered by the UPS). I'm not that familiar with standard shutdown signalling for Linux, but someone should be able to provide a schematic for connection of the relay switch contacts to a serial or parallel port. When the power fails, this relay will signal the loss and Linux will power itself down.

  4. DOS is just as vulnerable by Anonymous Coward · · Score: 0

    (Side note: If this problem can't be solved, the favored alternative is to give up on Linux and rewrite the tool using DOS. Right now I'm using RedHat 5.1 or 5.2 on a generic Pentium notebook.)

    What difference would it make if you used DOS or Linux? I mean, if you're writing to the disk (in DOS) and the power fails, you're still going to have disk corruption. Only when it powers back on, you won't get nice warnings and a self-scan on bootup..

    Just because DOS doesn't complain when it's abruptly shut off, doesn't mean it's any safer..

  5. Couple of solutions by Anonymous Coward · · Score: 0

    First of all mounting unneeded partitions as read-only is a good start. If you want to run fsck on a reboot but want it to work put a file in / called fsckoptions with just "-y" (excluding the quotes) in it. Or, if you want to skip fsck on every reboot make a file called fastboot in / and leave it empty (touch /fastboot). You may have to do this on each reboot so a good place for this command would be in /etc/rc.d/rc.local, put touch /fastboot at the end.

    I may be wrong on these paths, it is very early in the morning and I am about to pass out. Any questions look at /etc/rc.d/rc.sysinit (or have someone who is familiar with shell programming look) for all the the boot-time fsck stuff.

    FYI you can also change lines in /etc/fstab to make fsck skip certain filesytems on boot. Change the last number (should be a 1 for filesystems) to a 0 and fsck will not touch that partition on a reboot.

  6. Run / from RAM, mount everything else RO by Anonymous Coward · · Score: 0

    Linux can boot and run from a write-protected floppy (no HD at all). If you need proof, check out any of the "tiny" distributions. I prefer the version developed by the Linux Router Project (http://www.linuxrouter.org). It would seem to be a perfect starting point for your project. If you need to save data to a HD, re-mount it RW, write the data, then re-mount it RO.

  7. chattr by Anonymous Coward · · Score: 0

    If you are using ext2fs, you can use chattr to force synchronous writes to a file, a subtree or the whole disk. This fine-grained control, combined with mounting stuff read-only that you don't write to (/ & /usr, I hope) should give you what you need. You'll get through fsck at boot-time in a flash.

    -bithead

  8. the update daemon IS sync every 30 seconds by Anonymous Coward · · Score: 0

    The update daemon (on many UNIX flavors including linux) does sync every 30 seconds anyway.

    That's not enough to avoid filesystem corruption,
    though.

  9. Can't be done in rw mode at all. by Anonymous Coward · · Score: 0

    There is no way to make anything read write safe in a power fail situation. If you cut power to a disk while it is writing it will loose data. I suppose it is possiable to make a file system which could handle this but it would be very complex.

  10. hello, not all poor people are students ... KENNY! by Anonymous Coward · · Score: 0

    Yeah dickwad,

    Look at Kenny!

  11. DOS is just as vulnerable by Anonymous Coward · · Score: 0

    Sure your going to lose data if your writting to the disk and the power goes off, but Linux will lose information if power goes off while you aren't writting to the disk. Using DOS you alawys just flip the power switch to turn the computer off. It loses no data that way. And there is no file system corruption either.

  12. how to disable swap? by Anonymous Coward · · Score: 0

    how would one go about disabling the swap partition on an existing system, preferably in a reversable manner?

    Ideally, can lilo be used to select things other than which OS/kernel to use?

    I'd like to be able to have a "battery" or "wall power" profile that'd take care of the changes required for killing swap and mounting filesystems as read only.

    could different runlevels be used to do this?
    (as well as disbling unneeded services when mobile?)

  13. Mtools... by Anonymous Coward · · Score: 0

    Use the mtools on an IBM formatted disk and you will get dos like disk access...

    mcopy a: asdfkl (add an & if you want it to return)
    mdir
    mformat

    rtfm

  14. UPS is Rube Goldberg solution by Anonymous Coward · · Score: 0

    With a UPS you go from battery (12vDC in my experiance) to 110vAC (or whatever), into the computer's pwoer supply and back down to 12vDC and 5vDC (and 3.3vDC for ATX)...

    The laptop avoides this loss by going straight DC to DC, sometimes with strange voltages and such granted.

    I'm about this far from pulling out a spare power supply, soldering iron, battery, DC-DC converters and a few diodes to see if I can hack something up.

    Anybody have any clues to offer?

  15. You may use loop device instead of RAM by Anonymous Coward · · Score: 0

    If you don't have plenty of memory to create RAM disks you may use loop devices instead and create your rw partitions in file, not in RAM.


  16. $$$$ by Anonymous Coward · · Score: 0

    He probably has a better reason- maybe he is trying to build some sort of unconventional device that will run Linux- something that uses batteries. As someone mentioned before, the car mp3 player is a great example of this, it would lose power as soon as the driver shut off the car.

  17. DOS is just as vulnerable by Anonymous Coward · · Score: 0

    Wait, I've seen programs that display battery status for a laptop - I'm sure with a little hacking you can make it cleanly shutdown the system when battery goes to 1% (or whatever) of it's capacity.

  18. Why not use UMSDOS? by Anonymous Coward · · Score: 0

    The DOS filesystem, as far as I can tell, is
    stateless and doesn't get (much) damaged by
    unpredictable shutdowns. UMSDOS probably has
    many of the same characteristics.

  19. Smarter power supplies... by Anonymous Coward · · Score: 0

    Having a battery suppy directly to the internal components would be much more effiecient than going through two power conversions, DC->AC->DC.

    The only problem is that your monitor will lose its power too and even though you can still type and move your mouse, you have no idea where you are or what you are typing.

  20. Journaling by Anonymous Coward · · Score: 0

    Isn't this what "journaling" fs means?

  21. Points to Ponder by Anonymous Coward · · Score: 0

    One thing that would be ideal is to not loose all of the data in RAM when the computer looses power. The PC Emulator Virtual PC for the Mac has a feature called Save State (or something like that) which writes the contents of the emulated PC's ram to disk and terminates the PC as is. When you next open the PC emulator the PC programs and OS are restored to their saved state. How this could apply to your problem is if you were able to essentially run Linux without any real RAM by using hard disk swap space instead. The next trick would be avoiding a regular boot process when the power comes back. It's something to think about, but not very usefull unfortunatly.
    The other option that I'm not sure is available is using Static RAM. The Apple Portable had RAM that is very similar to PCMCIA Flash cards in that it didn't lose it's contents when it lost power. The use of this would be basically the same as the hard drive option, but again I've never seen anything like it available for a PC platform.

  22. How Car MP3 player does it by Anonymous Coward · · Score: 0

    We saw the empeg car player at the Debian booth during the LinuxWorld expo, and spoke to the guy that made it.
    They basically use a big capacitor to provide an UPS.

    In reply to some other replies, I don't understand why so many people are unable to read. The guy says he does not want an UPS, and still many people come back with 'but u really should use a UPS' or 'a UPS is really not that expensive'.
    He didn't _say_ it was too expensive, right?

    I'm very interested to see Linux run embedded myself, and believe me, there are systems that can NOT use an UPS. Not even a big cap like the car system.

    Everybody realizes that if you are writting to most filesystems and the power fails you can screw up your filesystem. I believe fs's that are power-fail proof do exist, but I wouldn't know which ones they are.
    Of course you'll always loose anything in RAM, but if creating a file would require only one sector to be written (an atonomic operation) then you will never screw up the fs itself.
    I don't know ext2 but FAT for example requires at least two writes to create a file.

    The real question is whether you need to write to disk at all, and if you do, does your info need to be saved between boots, or do you want to boot at the same state everytime (like in kiosk sort of applications for example).

    If you need to write to disk, you could mount all fs partitions r/o, and create a raw partition that you use for writes. However, if you need to save your data between boots you would have to create some sort of a file system again, but then one that can not be screwed up by power loss. (or use one that exists of course...)

    Well, I hope to see GNU/Linux move to more embedded applications, and it would be nice to have a 'out-of-the-box' solution.

    Breace.

    1. Re: How Car MP3 player does it by Anonymous Coward · · Score: 0

      Yeah, I guess you must be right, but that's what the creator of the radio told us. There's really no need to keep the harddisk mounted r/w for their app anyways. So either the guy didn't know what he was on about, or he didn't want to tell us the real deal?
      I dunno...

  23. Smarter power supplies...UPS by Anonymous Coward · · Score: 0

    It is called a UPS. It does not make sense to put that in the power supply. If you do, then the computer will shutdown, after some period of time, but you will not be able to see what is going on due to lack of power for a monitor.

    An external UPS would be easier to implement. It already exists, and you don't have the size and heat limitations of having it in case as a power supply. I have seen a couple of ISA cards for a PC that does that, but not for a long time. The 3 prong cord is a universal interface to most computer systems.



    ------------------------------------------------ --Domain: sorehands.com User:bill
    www.sorehands.com
    ------------------------------------------------ --
    Fired by Microsystems Software (now owned by the Learning Company) when he went to the Hospital for RSI treatment.

  24. Turning off in a jiffy by Anonymous Coward · · Score: 0

    I'd be looking for a new job if my boss did that to me...

  25. Write all the RAM to a FAT partition at shutdow by Anonymous Coward · · Score: 0

    There are laptops that writes all the contents of the RAM to a big file in a DOS partition. This is the system these laptops use to permit to power off of the system in any moment and to restore the same state of the system at the moment you powered off. I think you need a FAT partition on your system (because the laptop firmware is not able to write to ext2!) large as the main memory you have, f.i. if you have 128 Megs of RAM you'll need a partition of 150 Megs or more.
    I think NEC laptop could do this, but you can check in the VA research Web site, I know they are already doing it on their Linux lapotops (whitout having to use any of the sync or read-only mount).

  26. DOS is just as vulnerable by Anonymous Coward · · Score: 0

    The problem with that is, it's not the physical fs that causes data loss when power goes out. Linux (and Unix in general) keep large quantities of filesystem metadata in RAM, which is vulnerable to power-offs. Running the fs in synchronous mode will help some, but you're not guaranteed bullet-proof consistency whatever you do.

    I'm considering a situation that will require the ability to cleanly power off Linux (or *BSD, whatever trips my trigger at the time) systems that, due to space and cost constraints, cannot be equipped with UPS. I will have a central NFS server that will be equipped with UPS and such, so critical data will be sort-of-safe, but that doesn't completely mitigate the need for clean, consistent, no-fault dead power-off in embedded or pseudo-embedded environments.

    Granted, nothing else out there has this ability either (maybe QNX, or some RTOS or something... I don't know...), but it would be a major boon to Freenix if such capability were there. Hmm... new project...

    --Corey Brenner (too lazy to log in).

  27. My Compaq Presario does this by Anonymous Coward · · Score: 0

    I have a Presario 1255 that does this. To activate this "hibernate" mode, BIOS manages the shutdown and writes RAM to disk before powering off. Next time you hit the power switch, everything loads back up where you left off. I only let the battery die off unattended once (when conditioning it new) and if I'm not mistaken, I think it shut itself down in this fashion. The only catch would be enabling it to power back up unattended. As it is, you would still need to apply a finger to the shiny red button to get things underway again.

  28. Turning off in a jiffy by Anonymous Coward · · Score: 0

    About your boss! When you get ready to quit or get fired, pick the worst possible time to go into his office and rip his computer's power outta the wall!!

  29. Smarter power supplies... by KingKurly · · Score: 1

    Actually, I have a power supply, AT, not ATX unfortunately, that does have a builtin UPS. Looks kinda old, got it secondhand. I'll try to look for the source of it sometime..

    --
    It was recently discovered that research causes cancer in rats.
  30. Well... by oGMo · · Score: 1

    The reason you have to shut down is because you have mounted partitions as rw. If you don't need to write to them, you could always mount everything ro and then it shouldn't even fsck on boot. I think. I'm not going to try it. :)

    It's obvious you will need to write something, and you might be able to turn off the caching for that particular partition.

    It's really too bad you can't buy a UPS. Then you could hook it up to init to shut down the computer when it gets a powerfail signal...

    --

    Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

  31. Serial Cables by oGMo · · Score: 1

    I don't know, I haven't actually used one. I would assume given a halfway decent one (read: not the cheap consumer-quality kinds) they come with all the hardware and information you need. I believe there is documentation either with the kernel or with init that talks about this... I believe it was with the kernel... check it out.

    --

    Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

  32. Smarter power supplies... by BrianS · · Score: 1

    No kidding, he was talking about NOT using a UPS but having the battery built into the INTERNAL power supply of the case.

    I think the problem with this is that full size units consume a LOT more power than a laptop and thus eat battery power candy. I have a 250VA UPS on my 233MMX, 3HD, 1CD, 17" an it only last like 2 min before it is dead. I don't think the batteries from laptops have that much capacity.

    --
    -- I can't say enough in 120 chars!
  33. Not sure I understand why a UPS is not possible by bluGill · · Score: 1

    Not that much. One that will outlast the momentary power losses, and then allow an orderly shutdown can be had for about USD100. Unless you are a student you can afford that.

  34. Use the sync option to mount by j.e.hahn · · Score: 1

    In your fstab, and any place you mount a drive, use the sync option. This should disable the cache, and make all writes synchronous. It WILL hurt performance, but you shouldn't have to worry about disk state.

  35. Suspend to disk in Linux by j.e.hahn · · Score: 1

    > have a pentium notebook, which when the battery > is about to die (about 1% life remaining)
    >it enters save to disk mode. This feature >requires a fat or fat32 partition.. (because of >the program that creates the file in which the >data is stored)
    >
    >what happens is the ram (32mb) is saved to that >file. it isnt supported in linux.


    Untrue! Linux 2.2 either supports, or there is a patch for, suspend to disk. It's been discussed on linux-kernel a bit, and I know some generated a patch which supposedly works well. I don't know if it got added to the official kernel, though. Try looking in the kernel list archives.

  36. go remote? by Karl+Anderson · · Score: 1

    Do you have a box *anywhere* that you can trust to stay up?

    I run a NFS-Root workstation that boots from floppy and then gets its disk over NFS. It *can't* cleanly shut down, since it doesn't know what to do after the filesystems are unmounted. I've been just turning it off for a year, haven't had any problems (but hopefully someone will tell me if I'm being lucky). The server deals with keeping the disks happy.

  37. Serial Cables by jmalicki · · Score: 1

    If you get an APC BACKUPS PRO, it comes with the cable you need.

  38. shutdown by tgd · · Score: 1

    We had a discussion about this back in January on the autolinux mailing list (www.bangsplat.org/autolinux).

    The best way to handle it is to mount everything you can read-only. I've been experimenting with mounting everything read only and then mounting a ramdisk as an overlay filesystem allowing the system to be written to, as long as the files you write to don't need to be saved.

    Another way is to mount a ramdisk as a partition, copy off a read only partition, and periodically mount the original partion read/write, sync the two, and remount it read only.

  39. Why not use UMSDOS? by Lally+Singh · · Score: 1
    The reason that you can shut off at any DOS
    prompt is because SMARTDRIVE will sync the
    disks before the prompt is displayed.

    That's easy nuff to do in bash :-)
    PS1="`sync`\$ " or whatever...

    --

    --
    Care about electronic freedom? Consider donating to the EFF!
  40. e2fsck -p by motyl · · Score: 1

    Mount RW only the part of filesystem where you want to store some things permanently. Use ramdisk
    for temporary storage. Mount the rest RO or run everything from RAM as suggested.

    If you have e2fsck in your start-up scripts, add
    "-p" option to it.

  41. Inexpensive UPS by Drew+M. · · Score: 1

    Buying a UPS isn't as expensive as you think About 6 weeks ago, I bought a MGE Pulsar ES 2+. It will hold my system up for about 7 minutes, and has a serial cable and LINUX SOFTWARE (on the company's website) to shut it down when the UPS goes low. And the price... $50, not bad if you ask me. I was able to get it on sale at Fry's Electronics or it would have been about $100. Sounds like a good inexpensive solution to your problem. Give a UPS a try, you won't be dissapointed.

    Check out MGE's site here

  42. DOS is just as vulnerable by jmpvm · · Score: 1

    Just create a fat partition slightly larger than the linux partition at the beginning of the disk and the BIOS of the laptop will use that to store it's suspend file. Works perfectly.

  43. Not sure I understand why a UPS is not possible by A+nonymous+Coward · · Score: 1

    Because if you avoid it only because it won't last long enough, that's ok; just rely on the UPS long enough to do an orderly shutdown, then power everything off, including the UPS. Then when the UPS detects power back on, it will start up your box.

    --

  44. APM Support by John+C.+Quillan · · Score: 1

    As you said you are using a notebook. If it has advanced power management (APM) support, and I am not sure of a notebook that doesn't, you could take advantage of it. When the power goes out then the battery will power it. It that last for a few hours and the battery dies the the apm support will suspend the computer with out any problems. I also belive you could initiate a shutdown. a man on "ampd" should help.

  45. You could always use NT... by Claymore · · Score: 1

    I've been in an environment where we we had a lot of power failures (and we had a faulty UPS that took a few weeks to get replaced). Whenever we lost power and then regained it, the 3 or 4 NT boxes would come up again, occasionally run CHKDSK automatically, fix anything, and boot up normally. The Linux box (RH 5.1) would need fsck run on it every time, and on one occasion, a power failure *while* fsck was running trashed the disk quite badly, requiring two or three hours of work to get the whole lot working again. NT's journalling file system is actually damn reliable, and on a decent machine, the whole system can be quite reliable.

  46. Here's how I would do it.. by sgifford · · Score: 1

    We've hooked things up like this before, but had the occasional problem where the machine got the POWERFAIL signal from apcd, shut itself down properly, then power came back on before the UPS battery went dead. The machine ends up sitting there, properly shut down, until somebody drives to the site and flips the power off and on. Anybody got any ideas for working around this?

  47. Here's how I would do it.. by sgifford · · Score: 1

    It probably does send the POWEROK signal, but by that time, the OS is already shut down. Maybe I could create a special init state that mounted everything readonly and then just watched for POWEROK, and switched init states...

  48. Turning off in a jiffy by Pig+Hogger · · Score: 1
    Well, whenever my boss is pissed-at me, he yanks the plug on my own server. So, to avoid big fs damage, I use the following /etc/fstab which does the job fine:

    /dev/hdb1 /home ext2 rw, suid, dev, exec, auto, nouser, and sync 1 1
    /dev/hda1 / ext2 rw, suid, dev, exec, auto, nouser, and sync 1 1

    -- ----------------------------------------------
    Vive le logiciel... Libre!!!

  49. Smarter power supplies... by RalfM · · Score: 1
    I've often wondered abou this. Laptops don't have the problem of dying when disconnected from the mains because they have a battery (obviously seeing as they're portable :-)

    How about a powersupply with a battery built in, so that a powerloss will switch to battery, which in turn can be detected (laptops tell you when they're on mains or bat) and which could then force an immediate shutdown. The battery for this type of powersupply wouldn't even need to be real big. 5-10 minutes would surely be enough. In other words, batteries out of ancient laptops would suffice...

    Does anyone know of such a project already having been attempted? What is wrong with this idea? Would it be possible to build such an animal to just replace a normal power supply in a desktop box? Or does a desk top box just simply suck way too much juice for a battery to even cope for an immediate shutdown?

    Ralf
    http://www.dstc.edu.au/~ralf

    --
    The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.
    -Bertrand Russel
  50. Ram-disk based Linux by tony.damato · · Score: 1

    What about using the Linux Router Project distribution? According to an article I read in the most recent Linux Journal, when this system boots, it loads the system into a ram disk...so, if you lose power, oh well, just reboot... and no disks to fsck!

  51. If you have a bit of ram... by TheMeld · · Score: 1

    A while ago, rob posted an article about making a component stereo piece to play mp3 cd's. They used a pc running linux inside a cd player box to do it. Their solution to the fast power off problem was something like this:
    during boot, create some ramdisks.
    copy the contents of /etc, /var, and any other dir that has to be writeable to appropriate ram disks.
    remount all disk partitions ro.
    remout /etc, /var, blah blah blah from the ram disks.
    That solution works, but requires ram, and requires not needing real write access to the harddrive ever.

    --
    -Cheetah
  52. a few unanswered questions by josepha48 · · Score: 1

    1) you never said how big your system is. If is is small enough you can as other say run from ram
    2) have you though about 'embedding linux'? it is possible to embed the linux os in a device. I saw in the LJ (I think it was the linux journal) that the car mp3 player had 3 linux embeded oses running (2.0.35, 2.0.18, and cannot remember the other one) a mini cluster there (hehehe).
    does it have to be a desktop computer or can it be an embeded device?
    3) why is ups an unacceptable solution?
    4) what is this tool doing as it runs? (reading files, reading info from a port, writing data to files)?

    on a solution note
    1) it is possible to spin down disks (on most systems that is) hdparm /dev/hd? will tell you the disk paramters that are set I use -d1 -c1 -k1 or something like that to keep settings turn 32bit access on, and turn spindown on after 20minutes of inactivity
    2) it is also possible as many have said to use ram disks..
    3) and lastly have you thought about running the filesystem from a cdrom linuxpro has a distro that this can be done, then it is automatically mounted read only.. it would be interesting to have the / filesystem on cdrom, and the home directory in a ram disk and set up a diskless system.... or a system with a very small hard drive..

    --

    Only 'flamers' flame!

  53. Serial Cables by X-Type · · Score: 1

    I have an MGE 220 plus and it came with a cable and CD with unix/linux software. There is no problem with that.

    And I purchased it for quite cheap at www.egghead.com

    --
    010110000010110101010100011110010111000001100101
  54. Solid state by Gumber · · Score: 1

    What about solid state disks. Flash isn't that expensive. It isn't particularly fast, but it might be fine.

  55. Not sure I understand why a UPS is not possible by Ted+Nitz · · Score: 1

    From what I understand, the problem isn't a home system, or a computer... it's an imbedded system, of some kind, in many spots a USD100 component is far too costly, ie. if the price point for the entire machiene is under $300, typical markup is 50% in situations like this. Another reason it may not work is size problems, this may be a device that is required to be transportable easaily, or needs to fit into a small compartment somewhere. In either situation a UPS is far too expensive or large to be used.

  56. how to disable swap? by Black+Cardinal · · Score: 1

    Here are two ways to do it:

    1. To disable swap until you re-enable it, comment out any lines in your /etc/fstab that designate swap partitions (insert a '#' at the front of the line). Upon next reboot, swap will not be used (you can also turn it off with swapoff). Remove the '#' to re-enable (reboot or swapon required).

    2. To disable swap until the next reboot, just use the swapoff command: swapoff -a
    To turn it back on, issue a swapon.

  57. DtFS WOULD BE what you want by pog · · Score: 1

    Hello,

    Dtfs is an ext2fs based log-structured filesystem.
    (something like journaling filesystems). It logs all modifications of the fylesystem in an efficient way so that only the latest instructions that occurred during power failure are lost. And you can also undelete, undo some operations so that you can set the disk back to a safe state.
    http://www.complang.tuwien.ac.at/czezatke/lfs.ht ml
    The driver is still incomplete though.

  58. Turning off in a jiffy by JimMcCusker · · Score: 1

    What a prick...

    It doesn't sound like he likes the idea of you getting work done. Too bad for him that his temper gets in the way of business.

  59. Keeping those disks synced by alaric · · Score: 1

    It's always struck me as suckish that UNIXes need
    to be told to flush data to disks before taking
    them away. I can accept having to unmount NFS shares and the like, but why my floppy drive, or even worse, READ ONLY CD DRIVE!

    IMHO it'd be good if the OS still didn't block on writes, in that cp asdfsdf /mnt/floppy still came straight back to the prompt, but if there was any writes outstanding on any block device it would write until there were none - not even system areas; from observation Linux certainly seems to eagerly flush data blocks, but I suspect not the system areas of a disk. Anyway, it should indicate in some way what volumes were "safe", by turning off the floppy drive motor perhaps, so we can always eject a disk if the light's off. Just like DOS :-)

  60. Using DOS Instead? by linuxdoctor · · Score: 1

    Really. There is never an excuse to use any Microsoft product whatsoever. Unless, of course you want to end up in Hell!

    I don't see your problem. fsck is a very smark programme and whatever fixes it does genereally does not destroy anything. In may case, I designed a system that is running in an environment that is subject to power failures. When it comes back on line it generally reports only a new missing blocks and i-nodes. My software is smart enough to know how to this sort of thing.

    As for your particular application, if you need the data to be on the disc as soon as it is written, youn programmes can always call sync(). Not only is it a command, but it is part of the interface library.