It would just be cool if your shell script helps you to safely remove your flash disk after finishing its job. The solution is expected to meet the following needs:
- Suppose the flash disk is mounted as
/media/A
together with many other flash disks and the code can selectively just remove/media/A
without interfering other disks. For example, I can pass/media/A
as an argument. - A light solution. Installing another package of size 100MB to finish the task drives one crazy.
- I know some commands like
hdparm
except their documents are hard to read. If one can offer me a solution I hope he/she can offer also the explanation of the parameters, etc. - Best if the code can handle all kinds of flash disks (for example, my old one bought in 2003 with 32 MB) (and portable disks optionally).
- It should achieve the exact effect as right clicking the disk → clicking "safely Remove Drive". The safety concern will prevail, otherwise one may just unplug the disk which usually won't hurt.
umount
? As in,umount /media/A
. The command might be hidden a bit out of the way (perhaps/sbin
instead of/bin
), but it is a fundamental command and is likely to be in one of those two (or, possibly,/usr/sbin
).pumount
, which comes withusbmount