Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-16-2005, 09:08 AM   #1
LQ Newbie
Registered: May 2005
Posts: 21

Rep: Reputation: 15
mt command question

Hi all

can you explain to me plz

what the count parameter means in the mt command

after the weof ?

mt -f /dev/st0 weof 1

and after the fsf

mt -f /dev/st0 fsf 1

if its means the index of the file in the tape so the first file wrriten on the tabe what is the count value for it ?

many thanks
Old 06-17-2005, 03:39 AM   #2
Registered: Sep 2004
Location: India
Distribution: Solaris 9, FreeBSD 4.10, Slackware, RedHat, Knoppix,
Posts: 84

Rep: Reputation: 16
well you need it when u store multiple records in the tape drive
each record is ended by an EOF mark
so when u fsf (forward) it by 1, it goes to the beginning of the 2nd mark (incase u r at the first mark)

mt -f /dev/st0 rewind (will bring u to the beginning of the first data set)
mt -f /dev/st0 fsf 1 (will forward u to the beginning of the 2nd data set)

fsf means forward by count

check "man mt" for all the options

also u can do it only if u store multiple record set in the device which is done by setting the no rewind option while writting to it - otherwise it rewinds automatically to the beginning "n" is for no rewind
like in solaris (not sure abt linux ) u do this to stop it from rewinding

/dev/rmt/0mn (m=write with medium density and n = no rewind)
Old 06-17-2005, 04:35 AM   #3
LQ Newbie
Registered: May 2005
Posts: 21

Original Poster
Rep: Reputation: 15
so the count after weof should be always 1 or an index of the current file

i mean after first backup i write
weof 1

after the seconed backup what it should be weof 1 or 2 ?

and when i write the eof should i use st0 or nst0 coz i saw some scripts that use nst0 to write the backup
and st0 to write the EOF ?

another question is about how to know that i reached the end of the tape ? or can i know if the remaining space is enough for the file that i am going to write ?

many thanks
Old 06-17-2005, 06:19 AM   #4
Registered: Sep 2004
Location: India
Distribution: Solaris 9, FreeBSD 4.10, Slackware, RedHat, Knoppix,
Posts: 84

Rep: Reputation: 16

weof is used to write "eof" marks. so if u execute the weof 2 command - it ll write the 2nd eof mark at that location in the device.
st0 is the name of the device
nst0 (i assume) means the device in "no rewind" mode - the one which u wud be using
lets say u have to backup data at the end of each day

monday = u backup the data and that would write 1 eof mark (in a norewind mode)
so at this point of time if u do fsf 1 it ll point to the begiing of the second data (which does not exist yet)
tuesday = u backup data again in a no rewind mode
wed = <repeat>

now lets say u want to restore the data of tuesday
u rewind the tape and do a "fsf 1" and then restore it

checking space can be done using df command (please try and check it)- though i have never done that coz ufsdump itself specifies when the disk is full and loads another tape drive incase of autoloader tape devices



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Command question satimis Linux - Newbie 2 11-24-2004 09:59 AM
who command question Malique Linux - Newbie 2 03-22-2004 03:18 AM
SU command question downinthemine Linux - Newbie 25 07-31-2003 09:21 PM
Command Question Siki Linux - General 3 07-29-2003 04:34 PM
Command Question gauge73 Linux - Newbie 2 02-13-2003 09:18 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:13 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration