2011/4/20 Nguyen Vu Hung (VNC) <[email protected]>: > (2011/04/20 14:34), Gwenhael Le Moine wrote: > > # sync; echo 3 > /proc/sys/vm/drop_caches; hibernate >> >> [1] http://www.linuxinsight.com/proc_sys_vm_drop_caches.html > > Đây là drop hay sync? > > You should never have to sync manually under normal circumstances if > your system is working properly. (Even though I do sometimes after > unmounting a usb key or a memory card but that's technical > superstition moer than anything else.) > > Any call to halt or chutdown or hibernate will sync as part of their work. > > I am speechless if you don't mention the version of your kernel. > > Basically, the sync(2) command executes the system call sync() > > BR, > > Nguyen Vu Hung
[16:01:54]@tibonom:/tmp☻ # uname -a Linux tibonom 2.6.39-rc4_cyc1 #6 SMP PREEMPT Tue Apr 19 15:22:00 ICT 2011 x86_64 Intel(R) Atom(TM) CPU N470 @ 1.83GHz GenuineIntel GNU/Linux But I don't get how relevant this is. A call to halt or shutdown will at some point unmount all mounted partitions which in turn will sync the filesystems. To see this you can mount -o async a slow device like an old usbkey, copy a large amount of data to it which should be rather quick and then umount the key. You'll see that the umount operation will take a long time because that's when the data are actually written on the key. The case of hibernate is a little bit different as I don't think any umount is involved but I'd be truly shocked if there wasn't a sync called at some point. As a sidenote you can call sync with Alt-PrintScreen-s if the kernel is configured to enable the "magic SysReq" key (Alt-PrintScreen). Gwenhael. _______________________________________________ POST RULES : http://wiki.hanoilug.org/hanoilug:mailing_list_guidelines _______________________________________________ HanoiLUG mailing lists: http://lists.hanoilug.org/ HanoiLUG wiki: http://wiki.hanoilug.org/ HanoiLUG blog: http://blog.hanoilug.org/
