Operating System - HP-UX
1855734 Members
2139 Online
104103 Solutions
New Discussion

tape drive 0 and 0m deleted

 
Chang_6
Regular Advisor

tape drive 0 and 0m deleted

Hi,

The tape I was working was perfectly fine. I was successfully able to put, see and extract files from tape. However, when I tried to put some huge files into it, I ran into the follwoing problem. I then noticed the filesystem / where /dev/rmt exists was 100% full. Then I deleted 0 and 0m using "rm 0" "rm 0m". This reduced the filesystem size back to normal. However, I think it has some undesired consequences.

This was performed prior to deleting 0 & 0m:

# sh backup.sh
a system01.dbf 532496 blocks
a tools01.dbf 26000 blocks
a rbs01.dbf 4179984 blocks


vxfs: mesg 001: vx_nospace - /dev/root file system full (1 block extent)
Tar: end of tape
Tar: to continue, enter device/file name when ready or null string to quit.

User entered a null name for next device file.
# tar tvf /dev/rmt/0m
rw-rw-rw- 104/101 272637952 Aug 4 16:13 2004 system01.dbf
rw-rw-rw- 104/101 13312000 Aug 4 16:13 2004 tools01.dbf
rw-rw-rw- 104/101 2140151808 Aug 4 16:13 2004 rbs01.dbf
Tar: error! blocksize changed
# sh coldbackup.sh
a system01.dbf 532496 blocks


vxfs: mesg 001: vx_nospace - /dev/root file system full (1 block extent)
Tar: end of tape
Tar: to continue, enter device/file name when ready or null string to quit.

User entered a null name for next device file.
#


Deleted 0 and 0m ...


Currently:

# tar -cvf /dev/rmt/0m wtmpreduce.sh
tar: cannot stat wtmpreduce.sh. Not dumped.
# ioscan -fnC tape
Class I H/W Path Driver S/W State H/W Type Description
======================================================================
tape 0 14/0/3.0.0 stape CLAIMED DEVICE HP C5713A
# rmsf -H 14/0/3.0.0
# insf -H 14/0/3.0.0
# insf -e
insf: Installing special files for phmem instance 0 address 0/0/1

< etc .............. >

# mt -f /dev/rmt/0m status
ioctl SIOC_INQUIRY: Not a typewriter
# mt -f /dev/rmt/0 status
ioctl SIOC_INQUIRY: Not a typewriter
# mt -f /dev/rmt/0mn status
ioctl SIOC_INQUIRY: Not a typewriter
# ls -il /dev/rmt/0m
140 -rw-r--r-- 1 root sys 10240 Aug 4 18:27 /dev/rmt/0m
#


23 REPLIES 23
Mel Burslan
Honored Contributor

Re: tape drive 0 and 0m deleted

if you are getting the above output after insf -e command runs, you have a problem because /dev/rmt/0m is not a regular file it should list something like this :

crw-rw-rw- 2 bin bin 205 0x030000 Oct 9 2003 /dev/rmt/0m

i.e., line should start with a letter c and should have a hardware number associated with it.

while you are running this command, something may be trying to force write into /dev/rmt/0m file as it lookslike it is about 10K-byte big from the output.

make sure nothing else is accessing this device before you run insf -e then try removing and recreating it again.
________________________________
UNIX because I majored in cryptology...
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

What are the repercussions? Is the delete fatal? Something like deleting a device file that needs a reload of file, server boot etc ....

I did rm 0 and rm 0m ...
A. Clay Stephenson
Acclaimed Contributor

Re: tape drive 0 and 0m deleted

As I indicated in my last response to your previous question, it really looks like when you thought you were accessing the tape drive you really weren't because your hardware path was incorrect.

Do another rmsf -H xxxxx
Next, do an ls -l /dev/rmt and post that
Next, do an insf -H xxxx.
Now do another ls -l /dev/rmt and post that. That will tell us if you are successful in creating your device nodes.

Your /dev/rmt/0m is currently a regular file NOT a character special device. The name /dev/rmt/0m means absolutely nothing. I could create a tape device node and call it "BillyBubba" and it would work just fine as long as it had the correct major and minor device numbers.

I suspect that all of your previous test that you thought were working were using regular files.
If it ain't broke, I can fix that.
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

Clay

Thanks a million for all the help! As said before I shall give points soon

Here is the result


total 40
-rw-r--r-- 1 root sys 10240 Aug 4 08:35 0
-rw-r--r-- 1 root sys 10240 Aug 4 18:27 0m
-rw-r--r-- 1 root sys 0 Aug 4 18:26 0mn
crw-r--r-- 1 bin bin 205 0xfffffe Nov 23 1999 stape_config
# insf -H 14/0/3.0.0
# ls -l /dev/rmt
total 40
-rw-r--r-- 1 root sys 10240 Aug 4 08:35 0
-rw-r--r-- 1 root sys 10240 Aug 4 18:27 0m
-rw-r--r-- 1 root sys 0 Aug 4 18:26 0mn
crw-r--r-- 1 bin bin 205 0xfffffe Nov 23 1999 stape_config
#

A while ago I created 0 and 0m using vi ...
john kingsley
Honored Contributor

Re: tape drive 0 and 0m deleted

After you run:
insf -e
run:
ioscan -fnC tape
This will list the device files associated with the tape drive. Since this tape drive is Instance(I) 0, the device files should include /dev/rmt/0m,0mn,etc... If you are not seeing any device files, there is something else going on.

You say that the tar command worked for you in the past, but it looks like the device files may not have existed. You should probably go back and check your tapes. If the device files didn't exist, the tapes won't contain the files from when you ran the tar commands.
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

Hi,

I deleted 0 and 0m manually !!! Please read my first message again if you don't mind ...
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

John,

Here's the result

# ioscan -fnC tape
Class I H/W Path Driver S/W State H/W Type Description
======================================================================
tape 0 14/0/3.0.0 stape CLAIMED DEVICE HP C5713A
/dev/rmt/0mb /dev/rmt/c3t0d0BEST /dev/rmt/c3t0d0BESTn /dev/rmt/c3t0d0DDS /dev/rmt/c3t0d0DDSn
/dev/rmt/0mnb /dev/rmt/c3t0d0BESTb /dev/rmt/c3t0d0BESTnb /dev/rmt/c3t0d0DDSb /dev/rmt/c3t0d0DDSnb

0 and 0m doesn't showup. What could be happening?
A. Clay Stephenson
Acclaimed Contributor

Re: tape drive 0 and 0m deleted

/dev/rmt/0mb /dev/rmt/c3t0d0BEST /dev/rmt/c3t0d0BESTn /dev/rmt/c3t0d0DDS /dev/rmt/c3t0d0DDSn
/dev/rmt/0mnb /dev/rmt/c3t0d0BESTb /dev/rmt/c3t0d0BESTnb /dev/rmt/c3t0d0DDSb /dev/rmt/c3t0d0DDSnb

Insf is not creating /dev/rmt/0m because it already exists as a regular file. Rm /dev/rmt/0m before doing an insf. /dev/rmt/0 is not an HP-UX standard device node name; nor is /dev/rmt0 as is common on many UNIX flavors.

You can actually create you own device node the old-fashioned way, via mknod.

Do an ls -l /dev/rmt/c3t0d0BEST
and note the major and minor device numbers for this device. Probably 205 and 0x030000.

rm -f /dev/rmt/0m # get rid of the regular file
mknod /dev/rmt/0m c 205 0x030000
chmod 666 /dev/rmt/0m
ls -l /dev/rmt

You should see that c3t0d0BEST and 0m now have identical major/minor device number tuples. This is the way device nodes were created by real UNIX guys in the good old days before them new-fangled commands came along (which by the way are not always available on all platforms). That's why it's good to know just what those little numbers really do.


If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: tape drive 0 and 0m deleted

Device files, especially for tape drives, can be removed and replaced at any time with no consequences. But first: there must be *no* ordinary files in /dev. This command will find all the mistakes:

find /dev -type f -exec ll {} \;

Remove any and all of those files. You may find them in /dev/rmt, and you might even see something like /dev/null2 or similar. Remove these mistakes.

Here's what happened: you ran a backup command but misspelled the device file name. You probably ran something like this:

tar cvf /dev/rmt/0 /some_big_directory

tar (and cpio and dump and pax, etc) are far too friendly to report your error. You meant to use the trape drive but you specified a non-existent filename, so tar created a simple file and stored everything you asked for into the /dev/rmt directory. tar did a disk-to-disk copy and filled the / filesystem where /dev is located.

Unix commands are a bit unforgiving in these cases. You MUST spell the name of the device file correctly, like /dev/rmt/0m which is definitely not the same as /dev/rmt/om although they look similar. tar will not try to find the tape drive.

Once you have removed the regular files from /dev, you can repair any missing files with the command:

insf -e

It will re-create any missing device files. To see the correct device file names for your tape drive:

ioscan -knfC tape

And to see the characteristics of each device file, use this command:

lssf /dev/rmt/*


Bill Hassell, sysadmin
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

Hi,


How to use the tape now. You are right!

tar -cvf /dev/rmt/0m /var/adm/syslog/syslog.log
a /var/adm/syslog/syslog.log 155764 blocks
/var/adm/syslog/syslog.log: file changed size
# bdf -bi
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol3 524288 132348 367446 26% 2201 97983 2% /

Now How do I send them to tape????

Please suggest
john kingsley
Honored Contributor

Re: tape drive 0 and 0m deleted

Did you run
insf -e -C tape
after you deleted /dev/rmt/0m?

Normally, /dev/rmt/0m is linked to /dev/rmt/c#t#/d#BEST. If you run "ls -li", you would see that these files normally have the same inode.

So, running:
tar -cvf /dev/rmt/C3t0d0BEST
is exactly the same as running:
tar -cvf /dev/rmt/0m

From your earlier posts, it looks like C3t0d0BEST exists. What happens when you run:
tar -cvf /dev/rmt/C3t0d0BEST

If this works, you can always link /dev/rmt/0m to this device file:
ln /dev/rmt/c3t0d0BEST /dev/rmt/0m
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

Hi,

I tried C3t0d0BEST. But it's the same case. Filling up filesystem to 100%. That's probably not going to tape!!!

How to use the tape?
Bill Hassell
Honored Contributor

Re: tape drive 0 and 0m deleted

You wrote:

tar -cvf /dev/rmt/0m /var/adm/syslog/syslog.log
a /var/adm/syslog/syslog.log 155764 blocks
/var/adm/syslog/syslog.log: file changed size
# bdf -bi
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol3 524288 132348 367446 26% 2201 97983 2% /

Now How do I send them to tape????

----

You already stored the syslog.log file onto the tape. Are you asking how to recover the diskspace now that you've copied the syslog file to tape? If yes, just type this command:

cat /dev/null > /var/adm/syslog/syslog.log

then

bdf /var


Bill Hassell, sysadmin
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

Bill,

Firstly, when the filesystem gets I am thinking the file is not going to tape but going to /dev/rmt. That means I am not actually using the tape.

And even by cp /dev/null to syslog, this is not going to help because it is the / that is full.
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

And when it's really going to tape why is the / filesystem getting full???

And the available space in / is 440 MB. This tells clearly that it's definitely not the tape
Bharat Katkar
Honored Contributor

Re: tape drive 0 and 0m deleted

Hi Kumar,
Post following outputs:
1. # ls -al /dev/rmt
2. # ioscan -fn

That should help you give exact steps to follows and resolve the problem quickly.

Regards,
You need to know a lot to actually know how little you know
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

Bharath,

Appreciate the rescue effort.

# ls -al /dev/rmt
total 12
drwxr-xr-x 2 root sys 1024 Aug 5 12:31 .
dr-xr-xr-x 22 bin bin 5120 Aug 5 12:31 ..
crw-rw-rw- 2 bin bin 205 0x030000 Aug 5 12:31 0m
crw-rw-rw- 2 bin bin 205 0x030080 Aug 5 12:31 0mb
crw-rw-rw- 2 bin bin 205 0x030040 Aug 5 12:31 0mn
crw-rw-rw- 2 bin bin 205 0x0300c0 Aug 5 12:31 0mnb
crw-rw-rw- 2 bin bin 205 0x030000 Aug 5 12:31 c3t0d0BEST
crw-rw-rw- 2 bin bin 205 0x030080 Aug 5 12:31 c3t0d0BESTb
crw-rw-rw- 2 bin bin 205 0x030040 Aug 5 12:31 c3t0d0BESTn
crw-rw-rw- 2 bin bin 205 0x0300c0 Aug 5 12:31 c3t0d0BESTnb
crw-rw-rw- 1 bin bin 205 0x030001 Aug 5 12:31 c3t0d0DDS
crw-rw-rw- 1 bin bin 205 0x030081 Aug 5 12:31 c3t0d0DDSb
crw-rw-rw- 1 bin bin 205 0x030041 Aug 5 12:31 c3t0d0DDSn
crw-rw-rw- 1 bin bin 205 0x0300c1 Aug 5 12:31 c3t0d0DDSnb
crw-r--r-- 1 bin bin 205 0xfffffe Nov 23 1999 stape_config

# ioscan -fn | grep -i tape
tape 0 14/0/3.0.0 stape CLAIMED DEVICE HP C5713A
#


Plain ioscan -fn gives a lot of other things. Tape related info is shown above
Bharat Katkar
Honored Contributor

Re: tape drive 0 and 0m deleted

Hi,
Wise decision:

1. # cd /dev/rmt
2. # pwd
/dev/rmt
3. # rm * (be careful)
4. # insf -e
5. # ls -al /dev/rmt ( You see the devices files for Tape)
6. # ioscan -fnC tape ( This should show you the device files in /dev/rmt bound with the Tape device )

And there you are. Then post back the result.

This should work
Regards,
You need to know a lot to actually know how little you know
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

Bharath,

Thank you.

Did all 6 steps above ..


Here's the result

# ls -al /dev/rmt
total 12
drwxr-xr-x 2 root sys 1024 Aug 5 14:48 .
dr-xr-xr-x 22 bin bin 5120 Aug 5 14:48 ..
crw-rw-rw- 2 bin bin 205 0x030000 Aug 5 14:48 0m
crw-rw-rw- 2 bin bin 205 0x030080 Aug 5 14:48 0mb
crw-rw-rw- 2 bin bin 205 0x030040 Aug 5 14:48 0mn
crw-rw-rw- 2 bin bin 205 0x0300c0 Aug 5 14:48 0mnb
crw-rw-rw- 2 bin bin 205 0x030000 Aug 5 14:48 c3t0d0BEST
crw-rw-rw- 2 bin bin 205 0x030080 Aug 5 14:48 c3t0d0BESTb
crw-rw-rw- 2 bin bin 205 0x030040 Aug 5 14:48 c3t0d0BESTn
crw-rw-rw- 2 bin bin 205 0x0300c0 Aug 5 14:48 c3t0d0BESTnb
crw-rw-rw- 1 bin bin 205 0x030001 Aug 5 14:48 c3t0d0DDS
crw-rw-rw- 1 bin bin 205 0x030081 Aug 5 14:48 c3t0d0DDSb
crw-rw-rw- 1 bin bin 205 0x030041 Aug 5 14:48 c3t0d0DDSn
crw-rw-rw- 1 bin bin 205 0x0300c1 Aug 5 14:48 c3t0d0DDSnb
crw-r--r-- 1 bin bin 205 0xfffffe Aug 5 14:48 stape_config
# ioscan -fnC tape
Class I H/W Path Driver S/W State H/W Type Description
======================================================================
tape 0 14/0/3.0.0 stape CLAIMED DEVICE HP C5713A
/dev/rmt/0m /dev/rmt/0mnb /dev/rmt/c3t0d0BESTn /dev/rmt/c3t0d0DDSb
/dev/rmt/0mb /dev/rmt/c3t0d0BEST /dev/rmt/c3t0d0BESTnb /dev/rmt/c3t0d0DDSn
/dev/rmt/0mn /dev/rmt/c3t0d0BESTb /dev/rmt/c3t0d0DDS /dev/rmt/c3t0d0DDSnb
Bill Hassell
Honored Contributor

Re: tape drive 0 and 0m deleted

When you run tar, it does not "move" the file from disk to tape--tar copies the file to the tape. Look at the tape drive when you start the tar command and willsee the lights flash. That means that the file has been copied to tape.

Once the file has been copied to tape, you must remove the contents of the file, but NOT the file itself. Although the syslog file may get re-created if you remove it (depending on how old your software is), the simplest way is to replace the file. So the command:

cat /dev/null > /var/adm/syslog/syslog.log

Does NOT copy a file onto the end of syslog.log, it replaces the entire file with /dev/null--a special file that is zero-length. Once you issue the cat command as shown above, the syslog.log will be zero bytes long and bdf will show you now have more space available.


Bill Hassell, sysadmin
Chang_6
Regular Advisor

Re: tape drive 0 and 0m deleted

Bill,

Appreciate your responses. First of all if I do a cat /dev/null > syslog it will break a truck load of nuisance on me because at this stage everybody is using it. Secondly, I used syslog only as an example. And morover it lies in /var/adm which I am unconcerned about.

At this point, I want to put files in tape
Bill Hassell
Honored Contributor

Re: tape drive 0 and 0m deleted

And just clarify / versus /dev. The / directory is also a mounpoint with many directories underneath. When / is full, the cause can be in many locations. In a previous comment, you ran bdf and it shows that you did not partition your system at all, so /var, /dev and / are all on one single disk (not a good idea). So regardless of where the big file(s) are located, they all cause / to fill up. To see the mountpoint for any location in your computer, use bdf as in:

bdf /dev/rmt
bdf /var

In Unix, when you specify a device file such as /dev/rmt/0m, this is a 'special' file that redirects the output to an I/O device. If you don't spell the name correctly, then there is nothing to redirect the output so the program creates a simple file and stores the data in that file (not what you want to do).

Wathc the lights on your tape drive. Use the mt command to move the tape so you can see that /dev/rmt/0m is indeed a connector to the tape drive, like this:

mt -f /dev/rmt/0m rewind

or

mt -f /dev/rmt/0m fsf


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: tape drive 0 and 0m deleted

OK, I see the goal is to run a script that will backup large .dbf files. Just backup one of your big files as in:

cd /some_directory
tar cvf /dev/rmt/0m system01.dbf

and now the tape will blink for a long time. That means that the file has been copied to the tape. Your script that is being used to save the .dbf files probably has a spelling error for the device file which is why the / directory filled up.


Bill Hassell, sysadmin