Previous Next Table of Contents

4. Linux's handling of filesystems, disks and drives

-------------------------------------------------------------------------------

4.1 How can I get Linux to work with my large disk?

If your disk is an IDE or EIDE drive, you should read the file /usr/src/linux/drivers/block/README.ide (part of the Linux kernel source code). This README contains many helpful hints about IDE drives. Many modern IDE controllers do translation between `physical' cylinders/heads/sectors and `logical' ones.

SCSI disks are accessed by linear block numbers. The BIOS invents some `logical' cylinder/head/sector fiction to support DOS.

DOS will usually not be able to access partitions which extend beyond 1024 logical cylinders, and will make booting a Linux kernel from such partitions using LILO problematic at best.

You can still use such partitions for Linux or other operating systems that access the controller directly.

It's recommend that you create at least one Linux partition entirely under the 1024-logical-cylinder limit, and boot from that. The other partitions will then be okay.

-------------------------------------------------------------------------------

4.2 How can I undelete files?

In general, this is very hard to do on Unices because of their multitasking nature. Undelete functionality for the ext2fs is being worked on, but don't hold your breath.

There are a number of packages available which instead provide new commands for deleting and copying which move deleted files into a `wastebasket' directory. The files can be recovered until cleaned out automatically by background processing.

Alternatively, you can search the raw disk device which holds the filesystem in question. This is hard work, and you will need to be root to do this. If you still must undelete a file, take a look at Aaron Crane's Undeletion mini-HOWTO.

-------------------------------------------------------------------------------

4.3 Is there a defragmenter for ext2fs etc.?

Yes. There is defrag, a Linux filesystem defragmenter for ext2, minix and old-style ext filesystems. It is available at sunsite.unc.edu/pub/Linux/system/filesystems/defrag-0.70.tar.gz.

Users of the ext2 filesystem can probably do without defrag, because ext2 contains extra code to keep fragmentation reduced even in very full filesystems.

-------------------------------------------------------------------------------

4.4 How do I format and create a filesystem on a floppy?

To format a 3.5-inch, high density floppy:

$ fdformat /dev/fd0H1440
$ mkfs -t ext2 -m 0 /dev/fd0H1440 1440
For a 5.25 inch floppy, use fd0h1200 and 1200 as appropriate. For the `B' drive use fd1 instead of fd0.

The -m 0 option tells mkfs.ext2 not to reserve any space on the disk for the superuser -- usually the last 10% is reserved for root.

The first command performs a low-level format. The second creates an empty filesystem. You can mount the floppy like a hard disk partition and simply cp and