Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There is Tape device attached to the CPU I am using in the Lab here. Only CD/DVD and Floppy drives are there.
Well, I want to know how to use dump and restore commands. There's an example in the book RH133 on page# 234:
Code:
dump -0u -f /dev/nst1 /home
will do a full backup of /home filesystem onto the tape device nst1.
Here's the ouput of fdisk -l
Code:
[root@localhost ~]# fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 83 Linux
/dev/sda2 1276 2550 10241437+ 83 Linux
/dev/sda3 2551 2741 1534207+ 82 Linux swap / Solaris
/dev/sda4 2742 9729 56131110 5 Extended
/dev/sda5 2742 2864 987966 8e Linux LVM
[root@localhost ~]#
Apparently there is no such device as nst1.
So, how create it? How can we create a (virtual )Tape Device?
Thanks!
P.S.: I think MAKEDEV command can be useful here. Any ideas?
The tape device would not show in the output of fdisk.
It might show in the output of mount if as you say it is attached to your machine.
What you need to do is find out what the actual tape device is called.
dmesg and or mount should tell you this.
Then just substitute the device name for that of your own tape device.
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254
Original Poster
Rep:
Hi All,
Thanks for your posts. I didn't mean any physical tape drive to take backup on. I was following an example from the mentioned book of RHCE. However, I gave this command and it worked:
Code:
-bash-2.05b# ls
bin Mail
-bash-2.05b# dump -0 -f /tmp/backup/bk bin/
DUMP: Date of this level 0 dump: Fri Sep 25 22:29:42 2009
DUMP: Dumping /dev/ubd/0 (/ (dir root/bin)) to /tmp/backup/bk
DUMP: Label: none
DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 135 blocks.
DUMP: Volume 1 started with block 1 at: Fri Sep 25 22:29:42 2009
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: Closing /tmp/backup/bk
DUMP: Volume 1 completed at: Fri Sep 25 22:29:42 2009
DUMP: Volume 1 130 blocks (0.13MB)
DUMP: 130 blocks (0.13MB) on 1 volume(s)
DUMP: finished in less than a second
DUMP: Date of this level 0 dump: Fri Sep 25 22:29:42 2009
DUMP: Date this dump completed: Fri Sep 25 22:29:42 2009
DUMP: Average transfer rate: 0 kB/s
DUMP: DUMP IS DONE
-bash-2.05b# ls /tmp/backup/
bk
-bash-2.05b# file /tmp/backup/bk
/tmp/backup/bk: new-fs dump file (little endian), This dump Fri Sep 25 22:29:42 2009, Previous dump Thu Jan 1 01:00:00 1970, Volume 1, Level zero, type: tape header, Label none, Filesystem / (dir root/bin), Device /dev/ubd/0, Host host-6-14.linuxzoo.net, Flags 3
-bash-2.05b# ls
bin Mail
-bash-2.05b# rm -fr bin/
-bash-2.05b# ls
Mail
And here is how I could restore the backedup directory:
Code:
-bash-2.05b# ls
Mail
-bash-2.05b# restore -rf /tmp/backup/bk
-bash-2.05b# ll
total 328
drwx------ 2 root root 4096 Sep 15 14:49 Mail
-rw------- 1 root root 320608 Sep 25 22:38 restoresymtable
drwxr-xr-x 3 root root 4096 Sep 15 15:37 root-bash-2.05b# ls -R root
root:
bin
root/bin:
hello HelloC.c MemStat.sh
-bash-2.05b#
Note 1# I am not sure why the underlines directories have been created and the restored bin directory has been placed in the root directory here?
Note# 2: How can I specify a path in the restore command line to create a directry while restoring?
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254
Original Poster
Rep:
Code:
[root@localhost ~]# dump -0 -f backup work/
DUMP: Date of this level 0 dump: Tue Oct 6 16:34:06 2009
DUMP: Dumping /dev/sda1 (/ (dir root/work)) to backup
DUMP: Label: /
DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 1290 blocks.
DUMP: Volume 1 started with block 1 at: Tue Oct 6 16:34:06 2009
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: Closing backup
DUMP: Volume 1 completed at: Tue Oct 6 16:34:06 2009
DUMP: Volume 1 1320 blocks (1.29MB)
DUMP: 1320 blocks (1.29MB) on 1 volume(s)
DUMP: finished in less than a second
DUMP: Date of this level 0 dump: Tue Oct 6 16:34:06 2009
DUMP: Date this dump completed: Tue Oct 6 16:34:06 2009
DUMP: Average transfer rate: 0 kB/s
DUMP: DUMP IS DONE
[root@localhost ~]# ls
anaconda-ks.cfg back_work hi_1.gz install.log.syslog sudeep
back_home Desktop home Restored_data work
backup hi install.log restoresymtable
Restoring now...
Code:
[root@localhost ~]# restore -rf backup
./lost+found: (inode 11) not found on tape
./sys: (inode 4177921) not found on tape
./proc: (inode 1305601) not found on tape
./.autofsck: (inode 97921) not found on tape
./var: (inode 522241) not found on tape
./tmp: (inode 130561) not found on tape
./dev: (inode 3720961) not found on tape
./etc: (inode 4341121) not found on tape
./root/install.log: (inode 1403522) not found on tape
./root/install.log.syslog: (inode 1403523) not found on tape
./root/anaconda-ks.cfg: (inode 1403529) not found on tape
./root/.bash_logout: (inode 1403524) not found on tape
./root/.bash_profile: (inode 1403525) not found on tape
./root/.bashrc: (inode 1403526) not found on tape
./root/.cshrc: (inode 1403527) not found on tape
./root/.tcshrc: (inode 1403528) not found on tape
./root/.gconf: (inode 1403530) not found on tape
./root/.gconfd: (inode 1403531) not found on tape
./root/.gnome2: (inode 1403533) not found on tape
./root/.xsession-errors: (inode 1403532) not found on tape
./root/.dmrc: (inode 1403535) not found on tape
./root/.gnome2_private: (inode 1403536) not found on tape
./root/.redhat: (inode 1403554) not found on tape
./root/.nautilus: (inode 1403556) not found on tape
./root/.swp: (inode 1403638) not found on tape
./root/.ICEauthority: (inode 1403539) not found on tape
./root/.gtkrc-1.2-gnome2: (inode 1403545) not found on tape
./root/Desktop: (inode 1403557) not found on tape
./root/.gnome: (inode 1403558) not found on tape
./root/.metacity: (inode 1403561) not found on tape
./root/.eggcups: (inode 1403564) not found on tape
./root/.Trash: (inode 1403565) not found on tape
./root/.gstreamer-0.10: (inode 1403569) not found on tape
./root/.bash_history: (inode 1403574) not found on tape
./root/.mozilla: (inode 1403592) not found on tape
./root/.config: (inode 1403681) not found on tape
./root/sudeep: (inode 1403698) not found on tape
./root/.recently-used.xbel: (inode 1403717) not found on tape
./root/.thumbnails: (inode 1403642) not found on tape
./root/.recently-used: (inode 1403703) not found on tape
./root/.sane: (inode 1403725) not found on tape
./root/.local: (inode 1403728) not found on tape
./root/hi: (inode 1403806) not found on tape
./root/.viminfo: (inode 1403800) not found on tape
./root/home: (inode 1403811) not found on tape
./root/hi_1.gz: (inode 1403808) not found on tape
./root/back_home: (inode 1403793) not found on tape
./root/back_work: (inode 1403839) not found on tape
./root/restoresymtable: (inode 1403739) not found on tape
./root/Restored_data: (inode 1436192) not found on tape
./selinux: (inode 195841) not found on tape
./lib: (inode 1501441) not found on tape
./usr: (inode 2154241) not found on tape
./bin: (inode 913921) not found on tape
./boot: (inode 1534081) not found on tape
./home: (inode 489601) not found on tape
./media: (inode 3002881) not found on tape
./mnt: (inode 4373761) not found on tape
./opt: (inode 4830721) not found on tape
./sbin: (inode 3916801) not found on tape
./srv: (inode 1697281) not found on tape
./misc: (inode 391681) not found on tape
./tftpboot: (inode 3884161) not found on tape
./net: (inode 4308481) not found on tape
./shared: (inode 3525121) not found on tape
./.bash_history: (inode 97922) not found on tape
./rhome: (inode 4569601) not found on tape
./Screenshot.png: (inode 97923) not found on tape
./z_etc: (inode 97924) not found on tape
./e: (inode 97928) not found on tape
./tar_info: (inode 97926) not found on tape
./info.gz: (inode 97927) not found on tape
./tar_etc.gz: (inode 97925) not found on tape
[root@localhost ~]#
Why so many errors are there?
However, the restore is also perfectly done:
Code:
[root@localhost ~]# ls
anaconda-ks.cfg backup Desktop hi_1.gz install.log Restored_data root work
back_home back_work hi home install.log.syslog restoresymtable sudeep
[root@localhost ~]# ls -R root
root:
work
root/work:
c d e f
[root@localhost ~]#
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.