LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   crw format (https://www.linuxquestions.org/questions/linux-newbie-8/crw-format-941442/)

JJJCR 04-24-2012 03:53 AM

crw format
 
hi guys, i tried to issue a command ls -l /dev/st0

and it has this output:

crw-rw---- 1 root disk 9, 0 Feb 4 17:34 /dev/st0

what is crw-rw? and how do i read the contents of the tape?

please help. thanks in advance.

pan64 04-24-2012 03:58 AM

man ls will explain what is displayed
probably you can use tar to read tape (see man tar)

druuna 04-24-2012 04:16 AM

Hi,

The ls man page does explain the read, write and execute parts, but does not mention file types (crw-rw-).

Have a look here: Unix file types and possibly this: Device file

Hope this helps.

Satyaveer Arya 04-24-2012 04:17 AM

Quote:

crw-rw---- 1 root disk 9, 0 Feb 4 17:34 /dev/st0
c represents a character special file. In this /de/st0 has this permission, user and group classes have the read and write permissions and others class do not have any permission.

This is the dat tape drive you're using. Checkout this link to use the dat tape drive - http://www.cyberciti.biz/faq/linux-t...command-howto/

JJJCR 04-24-2012 04:18 AM

hi, thanks for your reply.

had issued this commands to read the tape but still not able to read the contents.

xyz:/media # tar -tzf /dev/st0

gzip: stdin: not in gzip format
tar: Child died with signal 13
tar: Error exit delayed from previous errors

==========

xyz:/media # tar -tf /dev/st0

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Error exit delayed from previous errors
xyz:/media #

any ideas? please help.

druuna 04-24-2012 04:28 AM

Hi,

I don't have any experience using tar to extract from tape, but I do know that the f option tells tar to use a file. /dev/st0 isn't a file and you do need to get rid of the f option.

Have a look here: Using tar (most examples use the f option, scroll halfway down the page).

Hope this helps.

Satyaveer Arya 04-24-2012 04:28 AM

For reading the tape drive using tar -tzf /dev/st0 command, first you have to rewind the tape -

Code:

# mt -f /dev/st0 rewind

pan64 04-24-2012 04:29 AM

Quote:

Originally Posted by druuna (Post 4661488)
Hi,

The ls man page does explain the read, write and execute parts, but does not mention file types (crw-rw-).

Hope this helps.

sorry, I do not know which man did you try, I found it in the man page:
The first character can be one of the following:

d The entry is a directory.

D The entry is a door.

l The entry is a symbolic link.

b The entry is a block special file.

c The entry is a character special file.

p The entry is a FIFO (or "named pipe") special
....

druuna 04-24-2012 04:44 AM

Hi,
Quote:

Originally Posted by pan64 (Post 4661497)
sorry, I do not know which man did you try, I found it in the man page:

Both the man page on LFS and on RHEL 6 don't mention this. An on-line search also comes up with multiple ls man pages that do not mention this information (haven't found one that does).

Which man page are you using?

EDIT: Don't you mean: info ls instead of man ls?

pan64 04-24-2012 05:28 AM

Quote:

Originally Posted by druuna (Post 4661508)
Hi,
Both the man page on LFS and on RHEL 6 don't mention this. An on-line search also comes up with multiple ls man pages that do not mention this information (haven't found one that does).

Which man page are you using?

EDIT: Don't you mean: info ls instead of man ls?

What a surprise: it is man ls on solaris 5.10 sparc.

michaelk 04-24-2012 06:51 AM

Do you know how or what application was used to create the data on tape?

JJJCR 04-24-2012 10:56 PM

Quote:

Originally Posted by michaelk (Post 4661588)
Do you know how or what application was used to create the data on tape?

hi michael, thanks for asking. Yes you're right I should have check what application was used to create and I realize it already.
This command was used to create:


0 3 * * 1-5 find /home/mybackupfolder -depth | cpio --create --format=crc > /dev/st0

but i had tried to read the tape using this command:

cpio -civt < /dev/st0

i'm using putty to connect to the server but putty does nothing for about a minute so i suppose it's not working.
so i just press ctrl + c, to terminate the command.

Do i need to have more patience to wait or it could be that the tape is not working already?

Thanks for any advice.

pan64 04-25-2012 01:33 AM

do you know how long does that backup take? Probably reading the tape will need the same amount of time.

michaelk 04-25-2012 06:34 AM

Have you previously Read/write to the tape drive successfully?
What is the output of the command
mt -f /dev/st0 status

Also try:
cpio -civ -F /dev/st0

JJJCR 04-26-2012 09:34 PM

hi guys, i change the crontab from cpio to tar tar -czf command to create the backup, i'm able to read the file using this command: tar -tzf /dev/st0

this is the output:

comp-12:~ # tar -tzf /dev/st0
mybackupfolder/
mybackupfolder/diff/
mybackupfolder/diff/F20120330T150006Z.zip
mybackupfolder/diff/I20120419T150008Z.1.zip
mybackupfolder/diff/F20120413T150000Z.1.zip
mybackupfolder/diff/F20120413T150000Z.2.zip
mybackupfolder/diff/F20120413T150000Z.3.zip
mybackupfolder/diff/F20120413T150000Z.4.zip
mybackupfolder/diff/F20120413T150000Z.5.zip
mybackupfolder/diff/F20120413T150000Z.6.zip
mybackupfolder/diff/F20120413T150000Z.7.zip

thanks for all the help :)


All times are GMT -5. The time now is 05:03 PM.