Direct Access Tools and Miscellaneous Utilities

In addition to mounting a removable disk onto the Linux filesystem structure, you can perform other actions or access the disk in other ways. One of the most important of these is to use the mtools package, which lets you access a removable disk with commands modeled after DOS commands. For example, mdir a: shows a directory listing on the floppy disk, and mcopy filename a: copies a file called filename to the floppy disk. As a general rule, the mtools commands work like DOS commands of the same name, but the mtools counterpart commands prepend an m to the command names. The mtools package can be a very convenient

Part II

way to access a floppy disk quickly, but it doesn't provide access to the disk from other programs. If you want to directly read or write a file using, say, a word processor, you must mount the disk in a conventional way. More information on mtools is available from the project's Web page, http://mtools.linux.lu/.

The hfsutils package is similar to mtools, but provides access to HFS disks. This package includes a program called xhfs that provides a GUI interface to let you copy files back and forth, as shown in Figure 6.4. You can learn more at http://www.mars.org/home/rob/proi/hfs/.

Figure 6.4

The xhfs utility lets you copy files to and from Macintosh disks using a GUI environment.

Figure 6.4

The xhfs utility lets you copy files to and from Macintosh disks using a GUI environment.

In addition to these specialized tools for accessing specific filesystems, you can use a number of standard Linux tools to manipulate disks in a variety of ways:

• mkfs The mkfs command creates a filesystem on a disk or partition. In actuality, mkfs simply calls another program, depending upon the filesystem type you specify with the -t option; for instance, mkfs calls mke2fs if you type mkfs -t ext2 /dev/hdc4, to create an ext2 filesystem on an EIDE removable disk. Most Linux systems come with mke2fs and mkdosfs (to create a FAT filesystem), but others are available as well.

• fsck This command checks a filesystem for integrity. As with mkfs, fsck relies on other programs to do most of the work. Of most interest, e2fsck checks an ext2 filesystem, but there's also a dosfsck to check DOS filesystems, and others for more exotic filesystems.

Chapter 6

• tune2fs This program lets you adjust ext2fs parameters after the filesystem has been 6

created. For instance, you can adjust an existing partition so that it has a smaller or larger R

reserved space area. M

• fdisk If you decide to use your removable disks as hard disks, with partitions, you § might need to use Linux's fdisk utility to create or modify partitions. You can use Linux's fdisk to change a partition type code to 0x83 ("Linux native") on a disk that's preformatted for FAT, for example.

Check the man pages for the appropriate utility to learn more about these tools.

Was this article helpful?

0 0
The Ultimate Computer Repair Guide

The Ultimate Computer Repair Guide

Read how to maintain and repair any desktop and laptop computer. This Ebook has articles with photos and videos that show detailed step by step pc repair and maintenance procedures. There are many links to online videos that explain how you can build, maintain, speed up, clean, and repair your computer yourself. Put the money that you were going to pay the PC Tech in your own pocket.

Get My Free Ebook


Post a comment