umount and data is lost?

umount and data is lost?

Nadav Har'El nyh at math.technion.ac.il
Sun Nov 6 20:53:31 IST 2011


On Sun, Nov 06, 2011, Diego Iastrubni wrote about "Re: umount and data is lost?":
> 6) hdparm... does it work on nand devices? I did mention this once or twise. 
> Just to make things clear: this is not a PC, it's an ARM based device.

I don't know if there's anything special to say about "nand devices" or
"arm based devices". The only question is whether it is possible the
device in question has additional volatile RAM cache. I'd think an SSD
can be developed *without* write caches (e.g., if it pre-flashes unused
blocks), but I simply don't know. Reading what you wrote later, write
caches were probably not the problem anyway....

> I looked at the source again of my application, and it seems that the boot I 
> was doing is not the "external power off" reboot I was thinking of, but the 
> linux reboot(LINUX_REBOOT_CMD_RESTART) (man 2 reboot). This one was supposed 
> to umount() my partitions, and flush all data, correct? It does not in my case. 


No, it doesn't. It just reboots immediately... Even the manual you
pointed us to says so ("If not preceded by a sync(2), data will be
lost.").

So if you called this reboot(), and did NOT umount or sync properly,
this explains everything!

Maybe you're confusing reboot(2) with reboot(8), the shell utility,
which does reboot the machine slowly, after stopping all applications,
flushing all filesystems, and so on?

-- 
Nadav Har'El                        |                     Sunday, Nov 6 2011, 
nyh at math.technion.ac.il             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |I saw a book titled "Die Microsoft
http://nadav.harel.org.il           |Windows". Turns out it was in German...



More information about the Linux-il mailing list