Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
04-24-2012, 03:53 AM
|
#1
|
Senior Member
Registered: Apr 2010
Posts: 2,291
|
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.
|
|
|
04-24-2012, 03:58 AM
|
#2
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,620
|
man ls will explain what is displayed
probably you can use tar to read tape (see man tar)
|
|
|
04-24-2012, 04:16 AM
|
#3
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
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.
|
|
|
04-24-2012, 04:17 AM
|
#4
|
Senior Member
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420
|
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/
|
|
1 members found this post helpful.
|
04-24-2012, 04:18 AM
|
#5
|
Senior Member
Registered: Apr 2010
Posts: 2,291
Original Poster
|
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.
|
|
|
04-24-2012, 04:28 AM
|
#6
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
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.
|
|
|
04-24-2012, 04:28 AM
|
#7
|
Senior Member
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420
|
For reading the tape drive using tar -tzf /dev/st0 command, first you have to rewind the tape -
Code:
# mt -f /dev/st0 rewind
|
|
|
04-24-2012, 04:29 AM
|
#8
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,620
|
Quote:
Originally Posted by druuna
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
....
|
|
|
04-24-2012, 04:44 AM
|
#9
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
Quote:
Originally Posted by pan64
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?
Last edited by anon237; 04-24-2012 at 04:46 AM.
|
|
|
04-24-2012, 05:28 AM
|
#10
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,620
|
Quote:
Originally Posted by druuna
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.
|
|
|
04-24-2012, 06:51 AM
|
#11
|
Moderator
Registered: Aug 2002
Posts: 26,895
|
Do you know how or what application was used to create the data on tape?
|
|
|
04-24-2012, 10:56 PM
|
#12
|
Senior Member
Registered: Apr 2010
Posts: 2,291
Original Poster
|
Quote:
Originally Posted by michaelk
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.
|
|
|
04-25-2012, 01:33 AM
|
#13
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,620
|
do you know how long does that backup take? Probably reading the tape will need the same amount of time.
|
|
|
04-25-2012, 06:34 AM
|
#14
|
Moderator
Registered: Aug 2002
Posts: 26,895
|
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
|
|
|
04-26-2012, 09:34 PM
|
#15
|
Senior Member
Registered: Apr 2010
Posts: 2,291
Original Poster
|
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 
Last edited by JJJCR; 04-26-2012 at 10:24 PM.
Reason: update post
|
|
|
All times are GMT -5. The time now is 07:16 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|