vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I want to write and read a small text file (50-200 bytes) to/from the beginning of a tape. Then I use ufsdump and ufsrestore to write and read several partitions of the disk to/from the same tape. e.g. ufsdump 0uf /dev/rmt/0cn /dev ufsrestore rf /dev/rmt/0cn What is the command to write and read the small text file to the beginning of tape? Should I use the cpio command? |
| |||
| In comp.unix.solaris TCMa <ma77777777772000@yahoo.ca> wrote: > I want to write and read a small text file (50-200 bytes) to/from the > beginning of a tape. Then I use ufsdump and ufsrestore to write and > read several partitions of the disk to/from the same tape. > e.g. > ufsdump 0uf /dev/rmt/0cn /dev > ufsrestore rf /dev/rmt/0cn Not without rewinding the tape first, ya don't. > > What is the command to write and read the small text file to the > beginning of tape? tar cvf /dev/rmt/0cn files -am © 2003 |
| |||
| In article <3f5e5ac0$0$25343$c3e8da3@news.astraweb.com>, Anthony Mandic <oi@hotmail.com> wrote: >In comp.unix.solaris TCMa <ma77777777772000@yahoo.ca> wrote: >> I want to write and read a small text file (50-200 bytes) to/from the >> beginning of a tape. Then I use ufsdump and ufsrestore to write and >> read several partitions of the disk to/from the same tape. >> e.g. >> ufsdump 0uf /dev/rmt/0cn /dev >> ufsrestore rf /dev/rmt/0cn > > Not without rewinding the tape first, ya don't. > >> What is the command to write and read the small text file to the >> beginning of tape? > > tar cvf /dev/rmt/0cn files Why use tar? I usually use dd for this sort of thing, but if the file is so small you don't care about controlling the blocksize, cat is perfectly adequate: cat small_text_file >/dev/rmt/0cn Chris Thompson Email: cet1 [at] cam.ac.uk |
| |||
| TCMa wrote: > Why no one mentioned the cpio command? > How is the cpio command compare with the cat, tar or dd command? It's very much like using the "tar" command, especially if you use the "-H ustar" option on the "cpio" command. "cat" or "dd" don't require a temporary file to be created, but they also won't store a filename on the tape, and if someone comes along after you and doesn't know the format of the tape, it could be helpful to have that file in an easily-recognizable format like tar and to have the file named something really obvious like "README". Otherwise, I can imagine someone trying "tar", "ufsrestore", etc. on the first file and finally deciding that "it's some kind of weird garbage" and just ignoring it. :-) - Logan |
| |||
| In article <ccd99f9a.0309091416.5e8fd8c2@posting.google.com >, TCMa <ma77777777772000@yahoo.ca> wrote: >I want to write and read a small text file (50-200 bytes) to/from the >beginning of a tape. Then I use ufsdump and ufsrestore to write and >read several partitions of the disk to/from the same tape. >e.g. >ufsdump 0uf /dev/rmt/0cn /dev >ufsrestore rf /dev/rmt/0cn > >What is the command to write and read the small text file to the >beginning of tape? > >Should I use the cpio command? The cpio command cannot really be recommended since many years. - CPIO is not an extensible format. If you like to extend it, you need to define a new incompatible format. This already has been done twice! The first format (from around 1975) was binary and had massive portability problems after UNIX has been ported to other platforms than the PDP-11. You cannot even autodetect byte oder unless the first file name has an odd number of characters. - The second format from around 1985 but limits UID/GID to 262143 and only allows 18 bits for major/minor. Major/minor is not split which may give problems. The max file size is 8 GB - The third format if from 1989 (SVR4). It entents uid/gid to 32 bits, has split major/minor but limits the file size to 2 GB. So this was a partial step backwards :-( - Most cpio programs have massive problems with hard links because there is no file name based mapping. Instead the detection is based on st_dev and st_ino and some bits are mapped off before archiving. As most cpio implementations do not create virtual mapped inode numbers, 'funny' things happen if there are hard links. - No CPIO format contains the user/group name which gives problems if you need to transport date to systems with diferent id/name mapping. - As the three CPIO formats are completely non interchangeable nothing may be read if the currenly found format is not supported by the extraction program. As a POSIX compliant program only needs to support the second one, you may imagine yourself what happens if you don't know this in advance.... Tar is much more forgiving. -- EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin js@cs.tu-berlin.de (uni) If you don't have iso-8859-1 schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily |
| |||
| In comp.unix.solaris TCMa <ma77777777772000@yahoo.ca> wrote: > I want to write and read a small text file (50-200 bytes) to/from the > beginning of a tape. Then I use ufsdump and ufsrestore to write and > read several partitions of the disk to/from the same tape. > e.g. > ufsdump 0uf /dev/rmt/0cn /dev > ufsrestore rf /dev/rmt/0cn > What is the command to write and read the small text file to the > beginning of tape? It's not entirely clear to me what you intend from your posting, but I wanted to verify that you're not wanting to "write" to the beginning of the tape and then "read" anything after that, correct? Writing to the beginning of the tape will effectively erase the tape. You may already understand that, but I wanted to be certain. -- Darren Dunham ddunham@taos.com Unix System Administrator Taos - The SysAdmin Company Got some Dr Pepper? San Francisco, CA bay area < This line left intentionally blank to confuse you. > |
| |||
| Dans article <ccd99f9a.0309100638.102a0c9b@posting.google.com >, ma77777777772000@yahoo.ca disait... > > Why no one mentioned the cpio command? > How is the cpio command compare with the cat, tar or dd command? cpio doesn't change access time. Tar does. -- Quis, quid, ubi, quibus auxiliis, cur, quomodo, quando? |
| |||
| In article <MPG.19c9aac4912c9a5998ca30@news.free.fr>, Emmanuel Florac <eflorac@imaginet.fr> wrote: >Dans article <ccd99f9a.0309100638.102a0c9b@posting.google.com >, >ma77777777772000@yahoo.ca disait... >> >> Why no one mentioned the cpio command? >> How is the cpio command compare with the cat, tar or dd command? > >cpio doesn't change access time. Tar does. Both is wrong! cpio may me told to reset access time after it did read the file. Cpio may create tar archives and star may also be told to reset the access time. Star may even do this without setting ctime if you are a super user on Solaris. -- EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin js@cs.tu-berlin.de (uni) If you don't have iso-8859-1 schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily |
| ||||
| Dans article <bjo2sk$3cg$1@news.cs.tu-berlin.de>, js@cs.tu-berlin.de disait... > Cpio may create tar archives and star may also be told to reset the > access time. Sure, and GNU tar too. However stock solaris tar can't. > Star may even do this without setting ctime if you are a super user on > Solaris. > star is a fine tool. Last time I checked it didn't support files bigger than 4GB, though. -- Quis, quid, ubi, quibus auxiliis, cur, quomodo, quando? |
| Thread Tools | |
| Display Modes | |
|
|