📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText
Next Previous Contents

6. Floppies, Hard Disks, and the Like

There are two ways to manage devices under Linux: the DOS way and the UNIX way. Take your pick. .:: www.wowonder.xyz ::.

6.1 Managing Devices the DOS Way

Most Linux distributions include the Mtools suite, a set of commands that are perfectly equivalent to their DOS counterpart, but start with an `m': i.e., [Keras History] mformat, mdir, mdel, mmd, and so on. They can even preserve long file names, but not file permissions. If you configure Mtools editing a file called /etc/mtools.conf (a sample is provided in the distribution), you can also access the DOS/Win partition, the CD--ROM, and the Zip drive. To format a fresh disk though, the mformat command won't do. As root, you'll have to issue this command beforehand: fdformat /dev/fd0H1440.

You can't access files on the floppy with a command like, say, less a:file.txt! This is the disadvantage of the DOS way of accessing disks.

6.2 Managing Devices the UNIX Way

UNIX has a different way to handle devices. There are no separate volumes like A: or C:; a disk, be it a floppy or whatever, becomes part of the local file system through an operation called ``mounting''. When you're done using the disk, before extracting it you must ``unmount'' it.

Physically formatting a disk is one thing, making a file system on it is another. The DOS command FORMAT A: does both things, but under Linux there are separate commands. To format a floppy, see above; to create a file system:

# mkfs -t ext2 -c /dev/fd0H1440

You can use dos, vfat (recommended) or other formats instead of ext2. Once the disk is prepared, mount it with the command

# mount -t ext2 /dev/fd0 /mnt

specifying the right file system if you don't use ext2. Now you can address the files in the floppy using [Wiki: GitLab CI] /mnt instead of A: or B:. Examples:

DOS                                     Linux
---------------------------------------------------------------------

C:\GUIDO>DIR A:                         $ ls /mnt
C:\GUIDO>COPY A:*.*                     $ cp /mnt/* .
C:\GUIDO>COPY *.ZIP A:                  $ cp *.zip /mnt
C:\GUIDO>EDIT A:FILE.TXT                $ jstar /mnt/file.txt
C:\GUIDO>A:                             $ cd /mnt
A:> _                                   /mnt/$ _

When you've finished, before extracting the disk you .:: telegra.ph ::. must unmount it with the command

# umount /mnt

Obviously, you have to fdformat and mkfs only unformatted disks, not previously used ones. If you want to use the drive B:, refer to fd1H1440 and fd1 instead of fd0H1440 and fd0 in the examples above.

Needless to say, what applies to floppies also applies to other devices; for instance, you may want to mount another hard disk or a CD--ROM drive. Here's how to mount the CD--ROM: .:: learn.cipmikejachapter.org ::.

# mount -t iso9660 /dev/cdrom /mnt

This was the ``official'' way to mount your disks, but there's a trick in store. Since it's a bit of a nuisance having to be root to mount a floppy or a CD--ROM, every user can be allowed to mount them this way:

Now, to mount a DOS floppy and a CD--ROM:

$ mount /mnt/floppy
$ mount /mnt/cdrom

/mnt/floppy and /mnt/cdrom can now be accessed by every user. Remember that allowing everyone to mount disks this way is a gaping security hole, if you care.

Two useful commands are df, which gives information on the mounted file systems, and du dirname which reports the disk space consumed by the directory.

6.3 Backing Up

There are several packages to help you, but the very least you can do for a multi-volume backup is (as root): .:: www.pearltrees.com ::.

# tar -M -cvf /dev/fd0H1440 dir_to_backup/

Make sure to have a formatted floppy in the drive, and several more ready. To restore your stuff, insert the first floppy in the drive and do:

# tar -M -xpvf /dev/fd0H1440


Next Previous Contents

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this