Solved

How to verify files copied to /dev/fd0?

Posted on 1998-09-20
7
236 Views
Last Modified: 2013-11-13
I have used Midnight File Manager to copy files to a floppy. The floppy was formatted from Linux with fdformat /dev/fd0H1440. before I formatted the floppy, there was a boot floppy in the drive, which I removed before working with this new floppy. I then copied several files to the /mnt/floppy, but something told me when I exceeded what could possibly fit onto the floppy, that I may not be writing to the floppy. Now, I can go to the floppy and see the files, yet they are not on the actual floppy disk.  I wantto transport these files to my other Linux box. How can I be sure I am writing to the floppy?  These are RedHAt rpm's which I downloaded from RedHats ftp site. Also, what command can I use to compress the files right to the floppy, and possibly span seveeral floppy disks with big files?
0
Comment
Question by:joe_massimino
7 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1638097
verify:   sum
compress: gzip
span several floppyes:  split

0
 
LVL 6

Author Comment

by:joe_massimino
ID: 1638098
This is not a complete answer, please go into more details. Maybe you can tell me what is happening so I can understand it, and give the commands in detailed examples with comment.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1638099
How about using  man  to get docs ;-))

sum      - compute checksum and count the blocks in a file

   sum file
   cp  file /fd_mountpoint
   sum /fd_mountpoint/file

Both sum commands should report the same result.
You may also use wc instead for a more simple check.


gzip      - compress or expand a file

   gzip file      # to compress a file, produces file.gz
   gunzip file.gz # uncompress file.gz, produces file

Don't know what needs to be explained here.


split      - split a file into pieces

   split -b 1400k file

splits your file in pieces of max 1400kbytes size.

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Accepted Solution

by:
JYoungman earned 70 total points
ID: 1638100
You forgot to mount the floppy drive with "mount /mnt/floppy".
Then you can copy files with the regular "cp" command.  If you try to read the data back you'll get the cached version, so unmount /mnt/floppy (which you have to do anyway), then pop the disk out and in again.  Remount the floppy and compare the files (with diff).  Errors are very rare in my experience, so I presonally don't often do this.  If the file is really vital, put a couple of copies on.

RPM files are already compressed, you won't gain anything by compressing them again.

To split files over several floppies, the easiest method is to write a tar qrchive directly to the floppy.  Unmount the floppy and use "tar" to write a multivolume archive:-

tar cfM /dev/fd0 the-list-of-files-to-save

You will be prompted to change disk as appropriate.  Extract these onto another machine with

taf xfM /dev/fd0
0
 

Expert Comment

by:tunct
ID: 1638101
try using msdos-formatted floppies and mtools (mcopy, mformat, mdel, etc.)... you are probably copying to a non-mounted directory (ls -l /mnt/floppy). check whether the floppy led flashes while copying in any case. do the permissions of /dev/fd0xxx  allow writing?

as for multiple floppy archives, make a zipped tar file (tar zcvf blah.tar <files>), then split it into 1440k blocks (split -b 1440k blah.tar blah_tar.). this produces files of size 1440k and having names such as blah_tar.aa. the last argument of split is the prefix used for naming the individual 1440k-files (in the example "blah.tar."). on the target machine, concatenate files using (cat blah_tar.?? >> blah.tar).
0
 
LVL 2

Expert Comment

by:JYoungman
ID: 1638102
Achim, your "sum" command will always succeed, because of the buffering.  You have to provoke a disk-change in order to make that really check the data on the floppy.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1638103
disk-change, umount&mount, know this trap.
Thanks anyway, I always forget to think about it 'cause I seldom use ext2 on floppys.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now