On Sunday, 16 December 2018 10:13:17 IST shimi wrote: > umount (assuming -l is not used), by definition, cleanly un-mounts the > filesystem - it makes sure all pending writes are written and all metadata > is cleanly committed, then completes. This makes 'sync' unnecessary - the > filesystem would not be considered unmounted before all blocks were already > reported written by the disk. So your 'sync', IMHO, does nothing. I assume > it returns immediately (assuming no dirty data exists on other fs's...). > You would see the umount waiting the way you would expect sync to wait (if > you reversed the order...) > > see also > https://unix.stackexchange.com/questions/345917/does-umount-calls-sync-to-co > mplete-any-pending-writes >
It must be a relic or a cargo cult action on my side, I was always calling sync AFTER unmounting drives. and wait little bit. > sdpram -S 30 /dev/sdX (I'm not sure if does anything honestly) > > > Wait for ~20 minutes > > physically touch the disk if I feel any movement , if not unplug the power > > the > > usb cord and then unplug the power plug. > > To what end? The sata to usb interface from the laptop. it should had say : 1. unplug usb cable from the laptop 2. unplug power cable from the wall socket > Why do you believe this is different from a normal shutdown of > your computer with your internal HDDs where the filesystems get unmounted > (the rootfs being re-mounted read-only) and then power off of the ATX power > supply? > I do not have the slightest idea how the sata to usb interface works, and if it behave the same as a direct sata to motherboard and atx power cut work. In a pc I would never unplug a sata cable while the power was still in, in fact I will never disconnect ANY cable inside a pc while the pc was still on. A sata to usb interface has it's own power source (I forgot to mention it). > I have both SSD and plain old HDDs plugged this way. > > > I'm feeling that I'm working in an unsafe manner, does any of you have a > > better suggestion how to shutdown the devices correctly to prolong the > > disk > > life ? > > What is unsafe in your opinion? Can you please elaborate? How does it > relate to prolonging disk life? Clean unmount is (so I believe...) for > filesystem integrity more than anything else... > "When in doubt, stop it's wrong" is a good line for any technical field, I do not know enough so I ask. I had a disk die recently (it was only three and a half year old disk). which was no longer recognized or even show any indication of starting up. I even tried to plug the sata disk into a pc and the bios there did not recognize it. I have replaced the sata to usb interface and the power block to a new one (just in case it was the interface who killed the drive). _______________________________________________ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il