Solved

How to verify files copied to /dev/fd0?

Posted on 1998-09-20
7
240 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Among others, I monitor the Windows Installer zone and Installer zone. I find that many of the questions could be answered much more quickly if a Windows Installer verbose log were submitted with the question.   However, I do not always have t…
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 …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

809 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