Ten common backup/restore related questions



1. How to migrate from dump to ufsdump                                                                                                    

2. Porting tar/cpio data to non-Sun platforms.                                                                                                 

3. Define optimum bs(bf) for tape drive types.                                                                                                 

4. Define tape drive addresses for particular tape drives.                                                                                 

5. Define minimum OS for backup tape device.                                                                                             

6. Define "Berkeley" style when writing to tape using /dev/rmt/0bn                                                                    

7. Describe "gotchas" when trying to copy 1 disk to another.                                                                         

8. Describe common cpio commands                                                                                                             

9. Command to copy a fs to remote host                                                                                                     

10. Difference between stacker and jukebox  

 

1. I use to use dump in 4.x, but since my upgrade to 5.x, I can't find it? The /etc/dump and /etc/restore commands were renamed /usr/sbin/ufsdump and /usr/sbin/ufsrestore. Files created with the SunOS release 4.x dump command can be restored on a SunOS release 5.x system with /usr/sbin/ulfsrestore. The ufsdump command accepts the same command syntax as the SunOS release 4.x dump command. See man page for more information on options and syntax examples. 

 

2. How can I dump data from my SUN/Solaris system, then read on a non-SUN system? To start with, ensure that tape drives (if appl) are compatible with each other...including the media itself. For example, an 8505xl on a Solaris system cannot be read by an EXB-8200 on SGI UNLESS you write the data to the tape using the low density mode (/dev/rmt/01). Archives created with the SunOS 5.x cpio command may not be compatible with older SunOS releases. The cpio command allows you to create archives that can be read with several other formats. You specify these formats using the -H option and one of these arguments: - crc or CRC -- ASCII header with checksum - ustar or USTAR -- IEEE/P1003 Data Interchange - tar or TAR -- tar header and format - odc -- ASCII header with small device numbers - bar -- bar header and format The syntax for using the header options is: cpio -o -H header-option < file-list > output-archive How to Create an Archive Compatible with Older SunOS Releases (or NON-SUN) Type cpio -oH odc < file-list > /dev/rmt/n and press Return. The -H options have the same meaning for input as they do for output. If the archive was created using the -H option, you must use the same option when the archive is read back in or the cpio command will fail, as shown in this example:


  • ebs% find . -print | cpio -oH tar > /tmp/test
  • 113 blocks
  • ebs% cpio -iH bar < /tmp/test
  • cpio: Invalid header "bar" specified
  • USAGE:
    cpio -i[bcdfkmrstuvBSV6] [-C size] [-E file] [-H hdr] [- I file [-M msg]] [-R id] [patterns] cpio -o[acvABLV] [-C size] [-H hdr] [-O file [-M msg]] cpio -p[adlmuvLV] [-R id] directory ebs%

When you create an archive using different options, always write the command syntax on the media label along with the names of the files or file system on the archive. If you do not know which cpio options were used when an archive was created, all you can do is experiment with different combinations of the options to see which ones allow the archive to be read. 

 

3. What blocking factor (density) is best for my type of tape drive? Generally speaking, larger blocking factors = better storage capacity. There is an interrecord gap written on the tape between blocks. If you write more blocks (because they are smaller), you write more gaps, and thus you have less info on the tape. Use these specification as guidelines. Your mileage can vary, but this generally works best (126 is the default) Drive type: 8mm DLT 4mm Use Blkg Factor: 126 126 96 4mm(DAT) tape drives use 96 (recommended for optimum 4mm performance) DLT tape drives, use default of 126 

 

4. What tape device address do I use for my 4mm(DAT) or my 8mm drive? The answer is not generic and requires explanation....so: >>>>>> 4mm Cartridge Storage Capacity* <<<<<<<<<< Tape Lgth Low Density High Density (/dev/rmt/0l) (/dev/rmt/0m, 0h, or 0c) 60 Meters 1.3 Gbyte 3.25 Gbyte* 90 Meters 2.0 Gbyte 5.0 Gbyte* * High density mode uses the data compression capability of the drive. Compression will vary depending on the type of data stored; typical compression is 2.5:1. >>>>>> 8mm Cartridge Storage Capacity and device name to use* <<<<<<<<<< Scaling this down appropriately, for the 14GB and 160m tapes (and 2.3): /dev/rmt/0l - ~3.5GB (uncompressed 8200 mode) /dev/rmt/0m - ~7GB (uncompressed 8500 mode) /dev/rmt/0h - ~7GB (uncompressed 8500 mode) /dev/rmt/0c - 14GB (compressed 8500 mode) Scaling this down appropriately, for the 14GB and 160m tapes (and 2.4): /dev/rmt/0l - ~3.5GB (uncompressed 8200 mode) /dev/rmt/0m - ~7GB (uncompressed 8500 mode) /dev/rmt/0h - 14GB (compressed 8500 mode) /dev/rmt/0c - 14GB (compressed 8500 mode) * For ALL tape devices, YOU DO NOT need to use l,m,h, or "c" to get maximum storage capacity on your tape. The device driver will use the highest capacity mode avail for the tape drive being used. Bottom line, Keep It Simple and suggest /dev/rmt/0 or /dev/rmt/0n (no-rewind) for normal operations. Use the l,m,h or c for portability between respective tape devices. ALSO: See SRDB ID: 13085 and other Sunsolve docs for more current info, specs. 

 

5. Why does my tape drive error? I just installed it. Very often customers have a tendency to take their new tape drive and plug it into their old machines, with varying results. Most commonly the error resulting from a new tape device on an old OS (which does not support this tape device is: ..." data transfer overrun"....

 

  6. What does the "b" do when I specify my tape device as: /dev/rmt/0bn? With the BSD device, when the read operation hits the file mark, it leaves the read head positioned after the file mark, so that the next read gets the data from the next tape file. The SysV device leaves the head before the file mark, so that any subsequent read operations return 0 or -1. You have to explicitly reposition the head to the other side the file mark using 'mt fsf' or the equivalent ioctl() before you can read more data. Another explanation: What this means is that during a read operation, if the last block is encountered and another read is issued, the driver will return an error if the Berkeley flag is not used. Unless it is a EOM mark. Typically, software applications that are looking for information from a tape device will exhibit this behavior (read BudTool). So, the Berkeley device flag says that it's ok to do this. 

 

7. Is it was possible to do an image backup of an entire disk using the dd command? With the standard layout, Solaris continues in the tradition of the Berkeley based operating systems where partition 'c' (slice 2) actually represents all of the blocks on the disk drive. You should not newfs this. The newfs would create a file system that spans the entire disk drive. If you did this after having newfs other slice, you would destroy information on these other slices. The "dd" command can backup the entire disk using slice 2. It looks like this # dd bs=80b if=/dev/rdsk/c0t3d0s2 of=/dev/rmt/0m Where: bs stands for blocksize if stands for input file of stands for output file The choice of block size should be based on the disk geometry. Usually, I use an integer multiple of the track size in sectors. You do have to pay close attention to the maximum allowable block size on the tape. Be aware that the "b" suffix, indicates a 512 byte block (same as the sector size). You should be aware that the backup of the "image" of the disk should only occur while the "file systems" on that disk are offline or "unmounted". If they are mounted, activity on the drive would corrupt your backup. For the disk drive holding the root file system, the only way to get it off-line is to do the backup while booted in single user mode from the cdrom (or other installation media). This is a very serious defect of this technique of image backups. The "ufsdump" utility cannot be used to backup the entire disk. It is designed to backup a single "file system" not a disk drive with multiple file systems. The "dd" utility is just a copy utility that works on images. Of course this should bring up the topic of restorations and verification. To verify an image tape use "dd" and the /dev/null device. # dd bs=80b if=/dev/rmt/0m of=/dev/null The "dd" command will report the number of blocks read from tape and written to the null device. This should match the values reported when creating the image backup. This verifies that the tape is readable, but does not do an integrity check. To restore an image backup you would issue: # dd bs=80b of=/dev/rdsk/c0t3d0s2 if=/dev/rmt/0m This should be done with all drives on the disk off-line (unmounted) just as in the backup.

 

  8. How do I use find and cpio together? See AnswerBook for very clear examples and descriptions of cpio usage and its usability. USING CPIO TO WRITE FILES TO A TAPE. The cpio command, used to create an archive, takes a list of files or path names from standard input and writes to standard output. The output is almost always redirected to a file or to a device. Type: ls | cpio -oc > /dev/rmt/n and press Return. All of the files in the cwd directory are copied to the tape in the drive you specify(n), overwriting any existing files on the tape. The total number of blocks copied is displayed. HOW TO LIST THE FILES ON A TAPE Note -- Listing the table of contents takes as long as it does to read the archive file because the cpio command must process the entire archive. Type: cpio -civt < /dev/rmt/n and press Return. The I option reads in the contents of the tape. The v option displays the output in a format similar to the output from the ls -l command. The t option lists the table of contents for the files on the tape in the tape drive you specify. HOW TO RETRIEVE ALL FILES FROM A TAPE If the archive was created using relative path names, the input files are built as a directory within the current directory. If, however, the archive was created with absolute path names, the same absolute paths are used to re-create the file (just as tar would do). Caution -- Using absolute path names CAN BE dangerous because you will overwrite the original files. Type: cpio -icv < /dev/rmt/n and press Return. All of the files on the tape in the drive you specify are copied to the current directory. HOW TO RETRIEVE A SUBSET OF FILES FROM A TAPE You can reload a subset of the files from the archive by specifying a pattern to match using shell wild card characters enclosed in quotes after the options. Type: cpio -icv "*file" < /dev/rmt/n and press Return. All of the files that match the pattern are copied to the current directory. You can specify multiple patterns, but each must be enclosed in double quotation marks. 

 

9. Can I dump my fs to a remote host? Here's a command that can be used (note, be sure .rhosts on remote host is set up)... % ufsdump 0f - /other | ( rsh -l root "cd ;ufsrestore xvf - " ) In this example, remove the with the actual name of the host and the file system to be copied, just in case this was not obvious. 

 

10. What is a stacker (autoloader) vs a jukebox? An often confused matter is the differences between a stacker, also known as an autoloader, and a jukebox. There are 2 modes of operation for multi-tape loading devices: sequential and random access. Sequential mode does not ask for direction from the host system as to what tape to deliver to the tape drive next. It simply sleeps until the tape in the drive is ejected. At that point the, autoloader (or stacker) will remove tape from the drive, place back in original slot in tray and grab the next sequential tape in the tape tray, then sleep again. The mode described as jukebox, or random access, mode requires 3rd party software (ie networker) to instruct the loading mechanism, which of the tapes in the device to load into the tape drive. It does not do any autoloading INDEPENDENT of the host machines software instruction.


Paid Advertisements: