Cygwin bash script to unmount and mount an XP partition

As stated, I am looking into keeping my backup drive unmounted in normal windows use. Partly this is to address threats like cryptolocker. Since one of my backup drives is an internal drive, it will not likely afford any protection from such a threat. I am thinking of adding code to my rsync script to mount my backup partition, run rsync, and then unmount the partition. It would also be nice to restrict access to the partition to the rsync process, etc.

I know this is not a very specific post at this point, but if anyone has suggestions, they would be appreciated.

LMHmedchem

This is what you want to read:

http://cygwin.com/cygwin-ug-net/using.html\#mount-table

Things to learn about and understand:
commands -
/usr/bin/mount
/usr/bin/umount

files -
/etc/fstab
/etc/fstab.d - directory and /etc/passwd.

This is a complex topic. Check back when you more questions.

Thanks for the link, I will get to reading this. I'm sure there will be many more questions.

LMHmedchem

Jim,

It looks like the issue I am going to have is trying to use cygwin to mount a partition that is not currently mounted in windows. This means that there is no windows drive letter to refer to in /cygpath/. In linux, this would be the equivalent of mounting a drive that was not automounted at boot through a fstab entry. IN linux, I have had to manually mount windows partitions, usb drives, etc

I seem to remember that there are ways to reference hard drives other than their mounted drive letter, but I don't know if there is any way in cygwin. For instance, as far as I know, there is no cygwin equivalent of fdisk that I could use to see if cygwin is aware of my backup drive even though it doesn't have a windows drive letter.

Any ideas?

LMHmedchem

fdisk just looks in /dev/ in UNIX, I don't know if cygwin has a real equivalent for that, it'd be real hard to emulate. cygwin is not UNIX after all, it still has to deal with Windows limits.

How was the partition unmounted? Windows usually tries to automount anything and everything it can.

There are two things I can do (that I know of) to "unmount" in windows. I can go into the windows disk manager and do "remove" to the drive letter. After this is done, the drive no longer appears in windows explorer. I can also use easeus partition master to "hide" the partition. I don't know if that does anything different than removing the drive letter in disk manager. For both of these methods, the change seems to be persistent, meaning that is survives rebooting.

I don't know if either of these actions provides any protection from cryptolocker because I can't seem to find anyone who will tell me how cryptolocker goes about assembling the list of files that it encrypts. I know it uses a list of extensions, but I don't know how it assembles the list of paths where it looks. I am guessing that it would not find files on a drive without a drive letter, and I also doubt that it can mount a partition on it's own, but those are both just guesses.

I don't like guessing about whether or not my files are still going to be there in the morning.

LMHmedchem