ClearOS Documentation

×

Warning

301 error for file:https://clearos.com/dokuwiki2/lib/exe/css.php?t=dokuwiki&tseed=82873f9c9a1f5784b951644363f20ef8

User Tools

Site Tools


Command Line Tools for Troubleshooting and Manipulation of Remote Backup Services

The following tools can help you uncover specifics about your Remote Backup Service. ClearCenter's Remote Backup System works by remote mounting your secure, provisioned remote backup data store. While powerful GUI tools are available to make backing up to RBS simple and manageable, command line tools and parameters can help you drill into specifics and help debug issues.

Management of RBS Using Command Line Client

RBS has a powerful command line component called 'rbs_client'. Here is the help file on that tool:

rbs_client -h
rbs_client: Remote Backup/Restore Client Usage Help
Copyright (C) 2007-2011 ClearCenter
-t N      Set session time-limit in second(s), 0 = no limit.
-r[N]     Enable restore mode, default mode is backup.
          Optionally, N can be set to the desired snapshot.
-d PATH   Specify PATH to restore to, default: /
-T        Traditional high-speed mode.
-s        List all snapshots.
-m        Mount file-system.
-u        Unmount file-system.
-V KEY    Validate file-system key.
-H        Update backup history.
-D[N]     Delete snapshot(s).
-R        Reset backup history (DELETE ALL BACKUP DATA!)
-l F      Log to a file specified by F.
-W        Invoked from Webconfig.
-v        Verbose mode (debug output).

In many examples, I will use the -v switch. This is useful for getting more information about how something did or did not work. You may need it to gather additiona information if you open a support ticket.

Using this tool we can list our backup archives with 'rbs_client -s':

# rbs_client -s
Volume ID            Type       Timestamp          Size (Bytes)
daily/1536863640     Daily      Sep 13 12:34            6408192
daily/1536869574     Daily      Sep 13 14:12            6408192

The 10 digits is actually a timestamp in 'Epoch' time.

Performing a Restore

Performing a Archive Delete

Remote Mounting Your RBS Store

Connect with two shells, in one you will establish your mount and on the other shell we will view things and also to shut down the other shell when the time comes. Performing remote mounts this way will ALWAYS mount the remote system in a READ-ONLY mode.

Start with running the following in your first shell:

rbs_client -vm

You may get something similar to this output:

[13/Sep/2018:12:41:30 -0600] Initializing RBS Client: Mount Mode
[13/Sep/2018:12:41:30 -0600] DEBUG: ControlSocketWrite: 100:2.2:485eb36b5d90b4c7584947a06bf0acb0
[13/Sep/2018:12:41:31 -0600] DEBUG: ControlSocketWrite: 130:3:1
[13/Sep/2018:12:41:31 -0600] DEBUG: ControlSocketRead: 510:Ok!
[13/Sep/2018:12:41:31 -0600] DEBUG: ControlSocketWrite: 140:Export
[13/Sep/2018:12:41:31 -0600] DEBUG: ControlSocketRead: 520:Waiting for export...
[13/Sep/2018:12:41:31 -0600] DEBUG: ControlSocketRead: 530:rbs:35cded80aaba7b1d83b43126d30d69f0|9c2ccb31|3ac8bebb
[13/Sep/2018:12:41:31 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --portal 127.0.0.1:3260 --logout
[13/Sep/2018:12:41:31 -0600] iscsiadm: scsiadm: No matching sessions found
[13/Sep/2018:12:41:31 -0600] ERROR: iscsiadm: i
[13/Sep/2018:12:41:31 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op delete --portal 127.0.0.1:3260
[13/Sep/2018:12:41:31 -0600] iscsiadm: scsiadm: No records found
[13/Sep/2018:12:41:31 -0600] ERROR: iscsiadm: i
[13/Sep/2018:12:41:32 -0600] DEBUG: 127.0.0.1:3260,1 rbs:35cded80aaba7b1d83b43126d30d69f0
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.auth.authmethod --value CHAP
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.auth.username --value 9c2ccb31
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.auth.password --value 3ac8bebb
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.iscsi.FastAbort --value Yes
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.cmds_max --value 16
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.queue_depth --value 32
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.timeo.replacement_timeout --value 480
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.err_timeo.abort_timeout --value 60
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.iscsi.FirstBurstLength --value 65536
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.session.iscsi.MaxBurstLength --value 4194048
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.conn[0].timeo.noop_out_timeout --value 0
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.conn[0].timeo.noop_out_interval --value 0
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.conn[0].tcp.window_size --value 131072
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --op update --name=node.conn[0].iscsi.MaxRecvDataSegmentLength --value 16384
[13/Sep/2018:12:41:32 -0600] DEBUG: StartProcess: /sbin/iscsiadm --mode node --targetname rbs:35cded80aaba7b1d83b43126d30d69f0 --portal 127.0.0.1:3260 --login
[13/Sep/2018:12:41:34 -0600] iscsiadm: Logging in to [iface: default, target: rbs:35cded80aaba7b1d83b43126d30d69f0, portal: 127.0.0.1,3260] (multiple)
[13/Sep/2018:12:41:34 -0600] iscsiadm: Login to [iface: default, target: rbs:35cded80aaba7b1d83b43126d30d69f0, portal: 127.0.0.1,3260] successful.
[13/Sep/2018:12:41:35 -0600] DEBUG: Found session: 1
[13/Sep/2018:12:41:35 -0600] DEBUG: Found target match: rbs:35cded80aaba7b1d83b43126d30d69f0
[13/Sep/2018:12:41:35 -0600] DEBUG: Found target device: 10:0:0
[13/Sep/2018:12:41:35 -0600] DEBUG: Found target LUN: 10:0:0:0
[13/Sep/2018:12:41:35 -0600] DEBUG: iSCSI block device: /dev/sdf
[13/Sep/2018:12:41:35 -0600] WARNING: rbs_include.php:1100: stat(): stat failed for /tmp/rbs-keyfifo
[13/Sep/2018:12:41:35 -0600] DEBUG: StartProcess: /sbin/cryptsetup -c aes -s 256 -d /tmp/rbs-keyfifo create rbs /dev/sdf
[13/Sep/2018:12:41:45 -0600] DEBUG: StartProcess: /bin/mount -o noatime,ro -n /dev/mapper/rbs /var/lib/rbs/mnt

You may only connect through this method for a 30 minute period of time. Please disconnect before that time expires. If you use the rbs_client to do snapshot recoveries, deletes, or backups you will not time out.

Leave this shell open and to the rest of the commands, including dismounting the volume, in another shell

In another shell you can now do the following commands:

# cat /proc/mounts |grep /var/lib/rbs/mnt
/dev/mapper/rbs /var/lib/rbs/mnt ext2 ro,noatime 0 0

It can take a few secinds before this shows correctly.

Some things that will happen here is that you will see:

# ls /var/lib/rbs/mnt/
daily  lost+found  monthly  weekly  yearly

If there is nothing in here, you may still be in the process of mounting. Let's look at the daily backups:

# ls /var/lib/rbs/mnt/daily/
1536863640  1536869574

Here we can see our two archives as reported in 'rbs_client -s' earlier. From here we can perform partial restores, investigate as to whether something was backed up properly or not or even check sizes of things.

Don't stay cd'd into this directory. If this is open for over 30 minutes, it will shut down the connection.

When you are done, don't forget to dismount and clean up your other terminal with the following:

rbs_client -u

Perform partial restores

Sometimes an archive is too big to perform a full restore just to get the one file that got deleted. Using this method, we can mount the archive as read only and restore the file or directory that was lost or damaged.

Investigating Backups

Checking Sizes of Files and Archives

With your backup remotely mounted, you can check the sizes of your archives. This can help you trim your retentions to reasonable amounts

# du --max-depth=1 -h
6.3M	./1536863617
139K	./1536863640
6.5M	.

Deleting Files from the Archives

If you want to delete any files, firstly you have to remount the remote backup in read/write mode:

mount -o remount,rw /dev/mapper/rbs /var/lib/rbs/mnt

Then you can use the usual rm command to delete files. Note that file deletions can be slow.

content/en_us/kb_7_command_line_tools_for_rbs.txt · Last modified: 2019/02/17 02:21 by nickh

https://clearos.com/dokuwiki2/lib/exe/indexer.php?id=content%3Aen_us%3Akb_7_command_line_tools_for_rbs&1563800927