Solved

How to verify files copied to /dev/fd0?

Posted on 1998-09-20
7
238 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AWS CLI - Issue with name display 2 50
gdb doesn't stop on breakpoint 2 48
linux installs 6 48
Why the Windows 10 computer restart randomly 6 72
One of the most frequently asked questions on EE in the "Windows Installer" zone is how to eliminate self-triggered installation of some product.  The problem occurs when, suddenly, whenever a certain application is launched, or even when a folder i…
If you don't know how to downgrade, my instructions below should be helpful.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

914 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

14 Experts available now in Live!

Get 1:1 Help Now