1. Macrium Reflect LTSC
  2. Imaging, Cloning, & File and Folder Backups

Backup and Restore using MRAuto


- Overview

- Usage

- Backup

- Restore

- List


Overview

MRAuto is a utility that simplifies image backup and restore by directly running from the command line and automatically generating image backup and restore definition files:

  • No definition file is required to start an image backup or restore.
  • MRAuto runs completely in the background with no user interface.
  • MRAuto handles common backup and restore scenarios with simple command line arguments.
  • MRAuro system restore tasks will automatically boot into the Macrium rescue media to complete the restore process where necessary.

MRAuto.exe can be found in the Macrium Reflect installation folder. By default, this is 'C:\Program Files\Macrium\Reflect'.


Usage

MRAuto requires administrator privilege to run. The options described are case-sensitive and can be used in short-form '-' or long-form '--'.

The exit status code can be obtained using the %ERRORLEVEL% variable in the command prompt. A return value of 0 means success, all other values indicate a failure. For example:

echo %ERRORLEVEL%

For restore tasks that require booting into the rescue media, the return code can be queried with the 'mrauto --status' command once the restore has been completed and the system has booted back into Windows.

Usage:

C:\Program Files\Macrium\Reflect>mrauto.exe
 
Macrium Reflect Auto - Backup/Restore Automation utility.
 
mrauto.exe -[b][r][s][l] <storage location> [backup name] <drive letters/disk numbers> [-t][-u][-p][-i][-e] [--stealth][--quiet]
 
  -b | --backup     Creates a backup.
  -r | --restore    Restores a backup.
  -s | --status     Displays status of the last auto restore.
  -l | --list       Lists backups in the storage location by time.
                    Lists disks/partitions in the image or system.
  -f | --filter     Filter backup list by wildcard match. Used in --list option.
  -t | --type       Backup type - Full/Diff/Inc.
  -u | --user       Network user name - Domain\User or User
  -p | --password   Network password.
  -i | --imagepwd   Image password for Backup/Restore/List.
  -e | --encryption AES encryption level for Backups. 0 - none, 1 - 128 bit, 2 - 192 bit, 3 - 256 bit
  -n | --nowarning  Suppress overwrite confirmation during Restore.
  -v | --verify     Verify image file after Backup or before Restore.
  -w | --wait       Wait for in progress Backup/Restore job to finish.
       --retention  Apply Reflect Default Retention Rules.
       --stealth    Suppress backup notifications.
       --quiet      Suppress the Reflect console output.
  -h | --help       Show options.
Help:

C:\Program Files\Macrium\Reflect>mrauto.exe -h
 
Options:
  -h [ --help ]
  -b [ --backup ] arg                   Creates a backup.
  -r [ --restore ] arg                  Restores a backup.
  -s [ --status ]                       Displays status of the last auto
                                        restore.
  -f [ --filter ] [=arg(=*.mrimg)] (=*) Filter backup list by wildcard match.
  -l [ --list ] arg                     Lists backups/disks/partitions.
  -t [ --type ] arg (=Full)             Backup type - Full/Diff/Inc
  -u [ --user ] arg                     Network User Name.
  -p [ --password ] arg                 Network Password.
  -i [ --imagepwd ] arg                 Image Password
  -e [ --encryption ] arg (=0)          AES Encryption Level. 0 - none, 1 - 128
                                        bit, 2 - 192 bit, 3 - 256 bit
  -n [ --nowarning ]                    Suppress overwrite confirmation during
                                        Restore.
  -v [ --verify ]                       Verify image file after Backup or
                                        before Restore.
  -w [ --wait ]                         Wait for in progress Backup/Restore job
                                        to finish.
  --retention                           Apply Reflect Default Retention Rules.
  --stealth                             Stealth Mode - Suppresses backup
                                        notifications.
  --quiet                               quiet Log - Suppress Reflect output.

Backup

Backup and restore support source partition selections by using drive letters, or disk and partition number combinations separated with a colon (:) character.

Note: Disk and Partition numbers use the 1-based index as shown in Macrium Reflect rather than 0-based index shown in the Disk Management console. 

Mixing drive letters and disk numbers in a single operation is not allowed, however, mixing of disk number and disk and partition number combinations is allowed. For example:

mrauto.exe -b <backup location> 1,2:1,2:3 

This example will backup all partitions contained on disk 1 and partitions 1 and 3 from disk 2.

To see available disks and partitions on the system, run 'mrauto.exe -l .':

The '--stealth' option will suppress all backup notifications. Customers wanting to suppress progress output may specify '--quiet'; when this option is used, no output from Macrium Reflect will be shown and customers may only be able to find the exit status with %ERRORLEVEL%.

When the backup location is a network share, ensure that the share has been added to the 'Network Share Settings' page of the Macrium Reflect Defaults and Settings as described here, or specify a user name and password to access the share using the '-u' and '-p' options.

Backup

C:\Program Files\Macrium\Reflect>mrauto.exe -b
 
 usage:   mrauto.exe -b <backup location> [image name] <{vol1,vol2}|{disk1,disk2}|{disk1:par1,disk2:par2}>
                        [-t full/diff/inc] [-u user] [-p pass] [-i imagepass] [-e 0/1/2/3]
                        [--verify][--wait] [--retention][--stealth][--quiet]
 
 example: mrauto.exe -b D:\Backups C: -u User -p Pass --stealth
          mrauto.exe -b D:\Backups Test C,D,E -t inc --wait
          mrauto.exe -b D:\Backups Test D --verify --retention --quiet
          mrauto.exe -b \\Share\Backups Test 1:1,2:2 -i ImagePass -e 1
          mrauto.exe -b D:\Backups Test 1,2
 
  For more information type 'mrauto.exe -h'

The following example will create an incremental backup of all of the partitions contained on disk 7 and disk 8. The target folder 'E:\Backups' is searched for an existing backup set that contains matching partitions. If a matching backup set is found, the incremental image will run and be appended to this backup set. If a matching backup set can't be found, a full image will run instead, starting a new backup set.

C:\Program Files\Macrium\Reflect>mrauto.exe -b e:\backups 7,8 -t inc

Restore

Note: Restores partitions are placed at the same sector offset and length on the target disk as they were on the source disk. There are no options in MRAuto to move or resize partitions. If this is required, the restore should be performed interactively.

As a result, it is not currently possible to restore to a smaller disk than the source disk using MRAuto.

Mixing drive letters and disk numbers in a single restore operation is not allowed. To see the drive letters and disk numbers contained within an image backup, run 'mrauto.exe -l <full path to image file>'.

By default, without specifying a target disk, the restore operation will try to locate the source disk in the system by matching the disk signature contained within the image file to a disk connected to the system. The operation will fail if the source disk is not found, for example when restoring the image to a different computer from where it was created. The optional 'target disk' parameter can be used to specify any disk on the target system that is large enough to accommodate the restored partitions.

If the image file is located on a network share, credentials that will be used to access the image file will need to be specified with the '--user' and '--password' options. Similarly, if the image is encrypted, the '--imagepwd' parameter will need to be used.

C:\Users\User\Downloads>mrauto.exe -r
 
 usage:   mrauto.exe -r <{[location] [image file]} | {full image path}>[?{vol1,vol2}|{disk1,disk2}|{disk1:par1,disk2:par2}]
                        [target disk] [-u user] [-p pass] [-i imagepass] [--verify][--wait][--nowarning][--quiet]
 
 example: mrauto.exe -r D:\Backups Test-00-00.mrimg
          mrauto.exe -r \\Share\Backups\Test-00-00.mrimg -u User -p Pass -i ImagePass --quiet
          mrauto.exe -r D:\Backups\Test-00-00.mrimg?C,D,E
          mrauto.exe -r D:\Backups\Test-00-00.mrimg?1:1,1:2
          mrauto.exe -r D:\Backups\Test-00-00.mrimg 1 --wait
          mrauto.exe -r D:\Backups\Test-00-00.mrimg --verify
          mrauto.exe -r D:\Backups\Test-00-00.mrimg?1:2 1
 
 NOTE: Restoring multiple disks within an image are not supported.
       Only multiple partitions in the same disk are supported.
 
  For more information type 'mrauto.exe -h'

The question mark (?) character following the file name indicates the disk or disk and partition combination list that will be restored. If this is omitted, all the partitions in the image will be restored.

Note: If the image contains more than one disk, the question mark (?) character must be specified.

 The next parameter is 'target disk', which indicates the disk number that will be the destination of the restore. If this is omitted, the original disk is used as the destination for the restore.

The following example shows restoring all of the partitions within disk 7 from the image:

C:\Program Files\Macrium\Reflect>mrauto.exe -r e:\backups\E02EA1FC9A1CD6C8-01-01.mrimg?7

Note: A backup image may contain partitions from more than one disk. In this case, as the restore option only supports restoring partitions from a single disk, a disk number must be specified when restoring.

This can be achieved by specifying drive letters or disk and partition numbers after the question mark symbol in the image file name. For example:

mrauto.exe -r D:\Backups\Test-00-00.mrimg?C,D,E 
mrauto.exe -r D:\Backups\Test-00-00.mrimg?1
mrauto.exe -r D:\Backups\Test-00-00.mrimg?1:2

Restore Status

The 'MRAuto.exe --status' command displays the completion status of the last restore job that was completed by booting into the rescue media. For example:

C:\Program Files\Macrium\Reflect>mrauto.exe --status
 
Loading log files... Found 53 file(s)
Looking for Auto Restore logs... Found.
 
Loading status from - C:\ProgramData\Macrium\Reflect\0D5D4C4B78A5D325_Restore27-01-2022 3.58 PM.html
 
File ID: 0D5D4C4B78A5D325
Date: 01/27/22 03:58:11 PM
Status: 0
Completion: Restore completed in 00:09:41

List

The list command 'mrauto.exe -l .' lists all the disks and partitions in the system. For example:

C:\Program Files\Macrium\Reflect>mrauto.exe -l .

The list command 'mrauto.exe -l <image file path>' lists all the disks and partitions within the image. For example:

C:\Program Files\Macrium\Reflect>mrauto.exe -l e:\backups\E02EA1FC9A1CD6C8-01-01.mrimg

The list command 'mrauto.exe -l <image files folder>' lists all the image files inside the folder. Optional wildcard filters can be used to narrow the search:

C:\Users\User\Download>mrauto.exe -l e:\backups\ -f *.mrimg
List

usage:   mrauto.exe -l <[backup file folder] | [full image path] | [.]>
                    [-u user] [-p pass] [-i imagepass] [-f filter]
 
example: mrauto.exe -l D:\Backups -f *.mrimg
         mrauto.exe -l D:\Backups\Test.mrimg
         mrauto.exe -l \\Share\Backups\Test.mrimg -u User -p Pass
         mrauto.exe -l D:\Backups\Test.mrimg -i ImagePass
         mrauto.exe -l .
 
 For more information type 'mrauto.exe -h'