Friday, May 3, 2013

DISK AND TAPE DRIVE COMMANDS




Partitioning 

cfdisk - Interactive hard disc partition utility for text mode.
fdisk - Launches a menu-driven program that partitions a hard disk.
parted - command line partitioning tool. (parted sometimes complains about boundaries of partitions created with fdisk. parted can format a partitionof type ext2 or fat32 partition while creating it.)

Formatting


mkfs - front-end to various filesystem-creation tools
parted can create a filesystem while partitioning
mkfs.vfat /dev/sde1 to format a fat32 partition sde1
mkfs.ext2 /dev/sde2 to format an ext2 partition sde2

Tuning


tune2fs - command to tune ext2/ext3 filesystems
tune2fs -j /dev/sde2 to convert an ext2 filesystem sde2 to ext3 by adding a journal
tune2fs -L /dev/sde2 bulkdata to set the volume label of sde2 to "bulkdata"
debugfs - Interactive utility to repair the ext2 filesystem on specified drive.
e2fsck- Performs an analysis of the filesystem's integrity and optionally repairs errors.
badblocks - Scans the specified drive for bad blocks.

Using a configured hard drive or tape


df - Displays the amount of disc space used and remaining on all mounted filesystems.
hwinfo - Automatically recognizes all available CD-ROM drives.
mount - Attaches the device to a specified directory, which will serve as the filesystem's mount point.
sync - Flushes the filesystem buffers.
umount - Unmounts the filesystem specified by the device.
du - Displays the amount of disc space used in the current directory.
duchs - Lists the largest directories in human readable format
eject - Ejects the media in the specified drive.

Rescuing


mc (midnight commander) - Command line file manager. Can undelete files in unmounted ext2 filesystems.

Backing-up


partimage - Backs up disk partitions into image files and restores them.

Logical Volume Management

LVM - LVM is an abbreviation for Logical Volume Manager which has been available under Linux for some time; the 2.4 kernel has the original LVM whilst 2.6 has LVM2 although both essentially do the same job. LVM allows one or more physical devices to be treated as a storage pool from which logical drives may be created whose size can altered dynamically. Assuming your file system supports dynamic resizing the upshot of this is you can grow/shrink logical drives (mount points) as your wish. In addition to combining drives in to logical devices you can also control the spread of data amongst devices through the use of striping, however this is often better left to a RAID implementation. LVM works on top of Software-RAID just fine by the way.

No comments:

Post a Comment