<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sun, Dec 16, 2018 at 9:53 AM <<a href="mailto:borissh1983@gmail.com">borissh1983@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm using sata to usb interface to extract data and to work with end user hard <br>
drives connected to a laptop.<br>
<br>
I'm using that for a periodic offline backups to HDD and an SSD (I know <br>
unreliable but that is the best I have for now). <br>
<br>
What I do today when I need to shutdown it are the next steps :<br>
<br>
unmount everything<br>
sync<br></blockquote><div><br></div><div>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...)</div><div><br></div><div>see also <a href="https://unix.stackexchange.com/questions/345917/does-umount-calls-sync-to-complete-any-pending-writes">https://unix.stackexchange.com/questions/345917/does-umount-calls-sync-to-complete-any-pending-writes</a><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
sdpram -S 30 /dev/sdX (I'm not sure if does anything honestly)<br>
Wait for ~20 minutes <br>
physically touch the disk if I feel any movement , if not unplug the power the <br>
usb cord and then unplug the power plug.<br>
<br></blockquote><div><br></div><div>To what end? 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?<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I have both SSD and plain old HDDs plugged this way. <br>
<br>
I'm feeling that I'm working in an unsafe manner, does any of you have a <br>
better suggestion how to shutdown the devices correctly to prolong the disk <br>
life ?<br></blockquote><div><br></div><div>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...</div><div><br></div><div>-- Shimi<br></div></div></div></div>