LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-23-2009, 08:03 AM   #1
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Rep: Reputation: 18
dump command and Tape Device


Hi,


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?

Last edited by Hi_This_is_Dev; 09-23-2009 at 08:06 AM.
 
Old 09-23-2009, 09:32 AM   #2
JamesChamberlain
Member
 
Registered: Sep 2009
Location: Wirral, UK
Distribution: Red Hat Enterprise Linux / Fedora 11
Posts: 47

Rep: Reputation: 18
I'm confused. Can't you temporarily mount the device to a location and dump to that dir, unmount and then the dump is obviously on the tape?

What device have you plugged in? A tape library?

Has plugging the device in created anything in the /dev dir?
 
Old 09-23-2009, 09:32 AM   #3
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by Hi_This_is_Dev View Post
Hi,


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.
 
Old 09-23-2009, 08:14 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Plug the tape drive in and try

mount

df


one or both should show the drive. fdisk is just for disks.
The udev facility should automatically create a 'device' when you plug in the tape drive.
 
Old 09-25-2009, 04:46 PM   #5
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
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?
 
Old 10-06-2009, 06:07 AM   #6
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
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 ~]#
 
  


Reply

Tags
device, tape



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ultrium 2 - multi-tape error (DUMP: fopen on /dev/tty fails: No such device or addres tbwalter55 Linux - Hardware 2 01-08-2015 08:05 AM
Check tape dump deadlock Linux - Hardware 4 01-09-2008 06:35 AM
installing FreeBSD on Virtual Box error: "Cannot dump. No dump device defined" Valkyrie_of_valhalla *BSD 4 09-06-2007 04:02 AM
Reading the Contents of a Dump Tape kaplan71 Linux - General 2 11-08-2006 02:34 PM
dump restore: not found on tape eddi.b Linux - Newbie 1 02-05-2004 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration