Previous Page | Next Page

  1. Introduction
  2. About Linux
  3. Installation and getting started
  4. Logging in and out
  5. Basic Linux Commands
  6. Linux Files and File Permissions
  7. Linux Directory Structure
  8. Finding Files
  9. Linux Help
  10. Setting Time
  11. Devices
  12. Tips
  13. Accessing Other Filesystems
  14. Accessing Removable Media
  15. Making and Managing Filesystems
  16. Emergency Filesystems and Procedures
  17. LILO and Runlevels
  18. Init
  19. Environment, Shell Selection, and Startu
  20. Linux Kernel
  21. Package Installation and Printing
  22. Configuration, Logging and CRON
  23. Keys and Terminal Configuration
  24. Sound Configuration
  25. Managing Users
  26. Passwords
  27. Process Control
  28. Configuration and Diagnostic Tools
  29. Overall Configuration
  30. Using PAM
  31. Basic Network Setup
  32. Tools and Terms
  33. Novell and Printing
  34. Inetd Services
  35. Xinetd Services
  36. Other Network Services
  37. FTP and Telnet
  38. Samba
  39. Identd (auth)
  40. X Configuration
  41. X Use
  42. Using X Remotely
  43. X Documentation
  44. DNS
  45. DHCP and BOOTP
  46. Apache
  47. NFS
  48. PPP
  49. Mail
  50. Routing
  51. IP Masquerading
  52. Proxy Servers and ipchains
  53. UUCP
  54. News
  55. NIS
  56. Network Security
  57. Secure Shell
  58. Text Processing
  59. Shell Programming
  60. Emacs
  61. VI
  62. Recommended Reading
  63. Credits

Making and Managing Linux Filesystems

Programs used to manage filesystems

  • badblocks(8) - Search a device for badblocks. The command "badblocks /dev/hda" will search the first partition of the first IDE hard drive for badblocks.
  • cfdisk(8) - A partition table manipulator used to create or delete disk partitions.
  • dosfsck(8) - Used to check a msdos filesystem.
  • dumpe2fs(8) - Lists the superblock and blocks group information on the device listed. Use with a command like "dumpe2fs /dev/hda2". The filesystem on the device must be a Linux filesystem for this to work.
  • fdformat(8) - Performs s lowlevel format on a floppy disk. Ex: "fdformat /dev/fd0H1440".
  • fdisk(8) - Used to add or remove partitions on a disk device. It modifies the partition table entries.
  • fsck(8) - Used to check and/or repair a Linux filesystem. This should only be used on systems that are not mounted.
  • hdparm(8) - Used to get or set the hard disk parameters.
  • mkdosfs(8) - Used to create a msdos filesystem.
  • mke2fs(8) - Create a Linux native filesystem which is called a second extended filesystem. This creates the current version of the Linux filesystem.
  • mkfs(8) - Used to make a Linux filesystem on a device. The command "mkfs /dev/hdb1" will create a Linux filesystem on the first partition of the second IDE drive.
  • mkswap(8) - Creates a Linux swap area on a device.
  • mount(8) - Used to mount a filesystem. It supports many types of filesystems.
  • stat(1u) - Used to print out inode information on a file. Usage: stat filename
  • swapoff(8) - Used to de-activate a swap partition.
  • swapon(8) - Used to activate a swap partition.
  • tune2fs(8) - Used to adjust filesystem parameters that are tunable on a Linux second extended filesystem. The filesystem must not be mounted write when this operation is performed. Can adjust maximum mount counts between filesystem checks, the time between filesystem checks, the amount of reserved blocks, and other parameters.
  • umount(8) - Unmount a filesystem.

Making a Filesystem

Making a swap partition

type "mkswap -c /dev/hda3 10336"

The -c has swap check for bad blocks. The 10336 is the size of the partition in blocks, about 10M. The system enables swap partitions at boot time, but if installing a new system you can type "swapon /dev/hda3" to enable it immediately.

Making an ext2 file system on a floppy

  1. fdformat /dev/fd0H1440
  2. mkfs -t ext2 -c /dev/fd0H1440

Other file systems:
A normal hard drive can have many types of filesystems on it. To create an ext2 file system, type "mke2fs -c /dev/hda2 82080" to create an 82 meg filesystem. Note: mkfs is a front end to many file system types including ext2, minux, and msdos.

Checking a Filesystem

fsck - Used to check and repair a filesystem.
fsck is a front end to a filesystem type specific fsck.ext2, fsck.minix, and fsck.msdos.
Syntax: fsck -t type device

Ex: fsck -t ext2 /dev/hda3