- Did you also write with the same block size?
- Did you rewind beforereading?
- Does
mt -f /dev/nst0 status
work?
- Are you chaining
dd
with tar
or just using tar as you wrote? There is a quirk when using tar piping and $TAPE environment variable. see below.
Sometimes you issue a command, it fails, there is no noise from the drive, but the tape is not in "rewound" state anymore. Try implicit rewind before each command.
Do a test with another tape (run the commands immediately after each other:
cd /path/to files
mt -f /dev/nst0 rewind; tar -b 2048 -c -f /dev/nst0 *
mt -f /dev/nst0 rewind; tar -b 2048 -t -f /dev/nst0
Btw if you don't want to pass -f /dev/nst0 all the time add export TAPE=/dev/nst0
in your .bashrc. Keep in mind that if you have this variable tar will prefer the tape drive over stdin/stdout. So this will return "Device or resource busy"
export TAPE=/dev/nst0
mt rewind ; tar -b 128 -c *|dd of=$TAPE bs=64K
... because both dd and tar are trying to open the tape drive. The correct way to pipe tar is by passing -f -
:
mt rewind ; tar -b 128 -c -f - *|dd of=$TAPE bs=64K
Also I'm not sure if this block size will work well. In this document you can read:
A block size no larger than 256 KB (262144 bytes) is strongly
recommended when working with HP-UX and tape or VTL devices.
So try dropping the block size to 256KiB or even 128KiB (That's tar -b 512 or -b 256 respectively).