Skip to main content

Could I use diskpart to unhide partition before backup and hide afterward?

Thread needs solution

Acronis True Image Home v11
Windows XP Pro SP-3

I gave up on using the Secure Zone. I've defined a backup location (one primary partition encompassing an entire disk reserved just for backups) with quotas that are hopefully correct to allow ample working space for consolidation of old backups. My scheduled backup tasks store their tib files into this backup location.

One of the features of the Acronis Secure Zone was it was hidden. It wasn't assigned a drive letter so users couldn't accidentally delete the backup files stored there plus, I suppose, it afforded some protection against malware. Well, I was wondering if not assigning a drive letter to the partition until just before the backup and then releasing the drive letter assignment after the backup might accomplish a similar hiding scheme. When defining a task, I can specify pre- and post-processing commands. That is, commands can be ran before and after the backup. It seems that I could then use the following commands when defining a task:

Pre-processing command:
diskpart.exe /s assigndrive.txt

Post-processing command:
diskpart.exe /s releasedrive.txt

The text files would contain commands to diskpart which allows on its command line to specify script files (I merely added the .txt command to make editing easier by filetype association). The backup location is on drive E: which is my 3 hard disk (indexing in diskpart on drive indices starts at 0) and the 1st partition (for which indices start at 1). The script files would contain:

assigndrive.txt:
select disk 2
select partition 1
assign letter=e
exit

releasedrive.txt:
remove letter=e
exit

Normally the partition on the 3rd hard disk would not have a drive letter assigned to it which makes it harder to find and possibly screw up the backup files there. When the backup task runs, it first assigns a drive letter (E:) to this partition so the backup location of E:\Backups\TrueImage can be found, the backup executes and completes, and then the drive letter is removed from the partition.

I only came up with this scheme just a bit ago and haven't had time to think through all the ramifications of not having a drive letter always assigned to the partition. One problem that I can see is if the diskpart script fails to assign a drive letter which means the backup will fail since the backup location cannot be found. Also, I don't know if console windows might popup on the screen while these commands got executed or it they would remain hidden while ran inside the shell for the TrueImage program. Another problem is if the hardware config changes in regards to where are the hard disks or if their count changes (i.e., harddisk2 becomes harddisk1 because harddisk1 got removed). Another problem might be with USB devices that are already plugged into the host when Windows is booted and getting assigned the drive letter (E:) that was intended for the backup hard drive.

While this seems plausible to not leave a drive letter always assigned to the partition (drive) and do so only during the backup, I suspect there's something that I didn't consider beyond the problems already mentioned.

0 Users found this helpful

I assume you are using TI 11 and not TI 2011.

I think this should work okay. However, I don't think I would use E: for the drive letter. It would probably be better to use a higher letter that wouldn't normally be used (by a new drive). You could use V:, for example.

Anything run from a TI task in the pre/post commands is hidden. You won't see the window.

As for the hard drive numbers changing, you could easily test this for your "common" configurations and see if it does. If it doesn't, then you know it should be good unless you connect something different.

You could write a more complicated script that finds the disk number and makes sure to select the correct partition for the assignment. This script would be used instead of your pre-script.