Operating System - HP-UX
1833750 Members
2448 Online
110063 Solutions
New Discussion

Re: tar command syays "No such device or address"

 
Amit Kureel
Advisor

tar command syays "No such device or address"

When I try tar command to back-up a filesystem ( e.g. tar -cvf /home/amit ), I am getting an error as follows :
"No such device or address"

I even tried to re-build the device file in /dev/rmt/c#t#dBEST and I can see all the usual files /dev/rmt/0m
/dev/rmt/0mn
/dev/rmt/0mnb
etc.,

Can anybody indicate what could be the error, and how to re-create the device file /dev/rmt/0m that tar refers to by default... because my "mksf" only creates the file /dev/rmt/c#t#dBEST

Thanks in advance....

Amit Kureel
5 REPLIES 5
Sridhar Bhaskarla
Honored Contributor

Re: tar command syays "No such device or address"

Oops -f should be followed by the device

So, you need to use

tar cv /home/amit so that it picks up the default tape drive or

tar cvf /dev/rmt/0m /home/amit

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Christopher McCray_1
Honored Contributor

Re: tar command syays "No such device or address"

Sridhar is correct, you aren't specifying a device or a file to which tar is to send its output. The only time I have seen that you dont have to specify the device is when you are doing a tar xv or xvf bcause then it defaults to /dev/rmt/0m (not all the time)

Regards,
Chris
It wasn't me!!!!
Animesh Chakraborty
Honored Contributor

Re: tar command syays "No such device or address"

hi Amit,
When you use -f option, you need to spacify the device file /dev/rmt/0m.
tar cvf /dev/rmt/0m /home/amit

best of luck

Animesh
Did you take a backup?
John Bolene
Honored Contributor

Re: tar command syays "No such device or address"

tar is one of those funny commands that the output preceeds the input

use tar -cf output input

such as

tar -cf /dev/rmt/0m /opt
or if you want ot put it in a file
tar -cf /tmp/file.out /opt
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Sanjay_6
Honored Contributor

Re: tar command syays "No such device or address"

Hi,

As already advised above, the correct tar format if you use "f" option is
tar cvf destination source
destination can be /dev/rmt/0m or a local file.

Now something else,

when i use the format you've shown above, i get the following errors:
1) tar cvf /home/amit
Note: amit is nonexistent file or directory or an existing file
error: Attempt to create archive of no files. Nothing dumped

2) tar cvf /home/amit
Note: Amit is existing directory under /home
error: tar: usage: tar ....options.... [tapefile] [blocksize] file1 file2 ....

So i was wondering how got the error message "no such device or address" when you typed the tar command in the format mentioned by you.

Thanks