Cygwin bash script to unmount and mount an XP partition

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cygwin bash script to unmount and mount an XP partition
# 1  
Old 11-19-2013
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.

# 2  
Old 11-19-2013
This is what you want to read:

Things to learn about and understand:
commands -

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

This is a complex topic. Check back when you more questions.
# 3  
Old 11-20-2013
Thanks for the link, I will get to reading this. I'm sure there will be many more questions.

# 4  
Old 11-22-2013

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?

# 5  
Old 11-22-2013
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.
# 6  
Old 11-22-2013
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.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

AIX - SAN Mount and Unmount on LPAR

We have 2 LPAR. LPAR #1 have a Application, Database Server process (ctree Server) and SAN+Physical Table. LPAR#2 has only Application. Both Application process are connected to Database via C-tree Server Process (Running on LPAR #1.. We want to keep one Active C-tree Server and one Backup... (1 Reply)
Discussion started by: gabhanes
1 Replies

2. Shell Programming and Scripting

Bash Script (tar + md) on Cygwin

Hi everybody, First, I'm sorry for my bad english! I have the following situation: I have a Windows 2012 R2 with Cygwin installed. The Windows Server is used as a backup Server with Dell AppAssure installed. At the moment, AppAssure saves Backup Targets to a repository on his D. The... (9 Replies)
Discussion started by: fibra3000
9 Replies

3. Shell Programming and Scripting

Script to unmount and mount by UUID

Hi, Need a bit of help on this one as I am a scripting noob. I have a linux based NAS that mounts USB hard drives in an inconsistent location and to make matters worse, seems to lose the mount for an unknown reason and doesn't remount automatically unless the drive is removed and re-inserted.... (4 Replies)
Discussion started by: gtr33m
4 Replies

4. UNIX for Dummies Questions & Answers

unmount the partition

Dear all, I have a two hard drive.On the second (/dev/sdb1 and /dev/sdb2) hard drive i have two partitions. The /dev/sdb2 has been mounted on the /home2 directory.I want to unmount that /dev/sdb2.I have no idea to how to do it.Can anybody give me the details about that?. Regards, Prakashkumar.S (2 Replies)
Discussion started by: prakashkumar41
2 Replies

5. OS X (Apple)

Can't Mount Disk / Image after bad unmount

I have had a little issue with one of my disks, the usb cacble was pulled out and one of the external drives on it would no longer mount. I used First Aid and it verified and repaired both OK / nothing to do). After lots of messing around and not being able to mount I used Drive Genius 2 and that... (1 Reply)
Discussion started by: Cranie
1 Replies

6. HP-UX

/usr out of disk space need to unmount/ expand volume /mount

Greetings, I am running HP-UX 10.2 and /usr is out of disk space already. I installed IE 5.0 for UNIX on my machine under /usr and browsed the Internet for a while and presto no more disk space. I have plenty of hard disk space on my computer so would like to expand the size of the volume. The... (5 Replies)
Discussion started by: Dirk_
5 Replies

7. Shell Programming and Scripting

Shell script to make and mount a Partition

Hi, I need to mount a new partition in a series of Pc that have a single hard drive of 20 GB; the used and partioned space amounts to 10 GB, between root, boot and swap; the script is to make the mounting process automatic These are the contents of my script: ... (1 Reply)
Discussion started by: HernandJ2
1 Replies

8. Gentoo

automating chroot and mount/unmount

Hello, I am trying to automate a task that I believe is easy. It is documented for manual system administrative purposes here: Gentoo Linux -- Installing the Gentoo Base System - chapter 6 I am attempting to do the following in a script: # cd $TOP_OF_ROOT_FS # mount -t proc none... (3 Replies)
Discussion started by: duderonomy
3 Replies

9. HP-UX

Cannot unmount mount points??

When taking a snap, I have a script that stops any active snap. When running the script, I'm getting a message that u02 and u04 are already mounted. How can I find out what process(es) is/are latching on the these mount points? Thank you for your time. (1 Reply)
Discussion started by: genzbeat
1 Replies

10. UNIX for Dummies Questions & Answers

I've created a partition with GNU Parted, how do I mount the partition?

I've created a partition with GNU Parted, how do I mount the partition? The manual information at is good, but I am sure about how I mount the partition afterwards. Thanks, --Todd (1 Reply)
Discussion started by: jtp51
1 Replies
Login or Register to Ask a Question