LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-28-2003, 03:16 PM   #1
davey
LQ Newbie
 
Registered: Aug 2003
Posts: 3

Rep: Reputation: 0
Angry saving to floppy: overwrote /dev/fd0


Hey Folks:

I was trying to save a file to floppy for the first time. I successfully formatted the disk, wrote a DOS filesystem with /sbin/mkdosfs and mounted the drive. I read somewhere that to save to floppy I would have to issue this command:

cp filename /dev/fd0

I blindly followed this advice, and (as you would expect)overwrote /dev/fd0.

What should I now do? Is there any way for me to retrieve the /dev/fd0 as it once was before the overwrite? Am I screwed? I realize that this is the newbiest of newbie questions. Thanks for any help!!

davey
 
Old 11-28-2003, 03:39 PM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
I don't understand what you think you did. cp file /dev/fd0 will not do anything to to the device /dev/fd0. What you did was you wrote over the bootsector of the floppy. So you can't mount the floppy now without formatting it again.

Basically you just trashed the disk but the drive is OK.
 
Old 11-28-2003, 03:47 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You need to reformat the floppy. That's the only thing that's broken. But don't try the same with a hard disk.

What you did and why it was wrong? /dev/fd0 is your first floppy, yes. But you can't write directly it. The thing is that floppy (it's the same with hard disk) is organized in a special way. First there's a 'header' telling which type of floppy is it etc and then comes the area for files. You can't also write distrectly to it, file area is also organized - into filesystem. Filesystem data tells where which file is places, file names and so on.

To make filesystem accessible the mount command is used. The system scans the media and reads filesystem informations and other special data. When you're copying a file to mounted filesystem, the OS modifies the filesystem structure the right way to make teh new file appear.

One more thing...formatting builds the filesystem structure.

So, the right sequence is:
mount -t msdos /dev/fd0 /mnt/floppy
cp filename /mnt/floppy
 
  


Reply



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
/dev/fd0 gone! I can't mount floppy! robbow52 Debian 7 08-06-2004 04:35 PM
lilo /dev/fd0 alaios Linux - Software 1 07-07-2004 07:17 AM
I have overwritten /dev/fd0! How do I recreate /dev/fd0 to access my floppy? drscott1 Linux - Newbie 2 02-19-2004 12:37 PM
Floppy at /dev/fd0 won't mount Borg Swarm Linux - Hardware 4 01-20-2004 06:48 PM
Problem with /dev/fd0 sonenberk Linux - Hardware 0 09-29-2003 05:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:17 PM.

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