Filesystem Formatting and Checking
2009-10-31 16:14
295 查看
Three basic toos are available to manage the filesystem on various partitions:fdisk,mkfs,and fsck.
They can help you configure partitions as well as create,and then check and repair,different filesystems.
fdisk:
The Linux fdisk utility is a lot more versatile than its Microsoft counterpart.But to open it,you need know the device file associated with the hard drive that you want change.Assuming you want to manage the partitions on the first SCSI hard disk,enter /sbin/fdisk /dev/sda.
mkfs:
To format a Linux partition,apply the mkfs command.It allows you to format a partition to a number of different filesystems.
To format a typical partition such as /dev/hda2 to the current Red Hat standard,the thrd extended filesystem,run the following command:
# mkfs -t ext3 /dev/hda2
The mkfs command also serves as a "front-end" ,depending on the filesystem format.For example,if you're formatting a Red Hat standard ext3 filesystem,mkfs by itself automatically calls the mkfs.ext3 command.Therefore,if you're reformatting an ext3 filesystem,the following command is sufficient:
# mkfs /dev/hda2
Be careful with mkfs.First,back up any data on the subject partition and computer.This command erases all data on the specified partition.
fsck:
The fsck command is analogous to the Microsoft chkdsk command.It performs an analysis of the specified filesystem and performs reparis as required.Assume you're having problems with files in the /var directory,which happens to be mounted on /dev/hda7.If you want to run fsck,unmount that filesystem first.In some cases,you may need to go into single-user mode with the init 1 command before you can unmount a filesystem.To unmount,analyze,then remount the filesystem noted in this section,run the following commands:
# umount /var
# fsck -t ext3 /dev/hda7
# mount /dev/hda7 /var
The fsck command also serves as a "front-end",depending on the filesystem format.For example,if you're formatting an ext2 or ext3 filesystem,fsck by itself automatically calls the e2fsck command(which works for bothe filesystems).Therefore, if you're checking an ext3 filesystem,the following command is sufficient:
# fsck /dev/hda7
They can help you configure partitions as well as create,and then check and repair,different filesystems.
fdisk:
The Linux fdisk utility is a lot more versatile than its Microsoft counterpart.But to open it,you need know the device file associated with the hard drive that you want change.Assuming you want to manage the partitions on the first SCSI hard disk,enter /sbin/fdisk /dev/sda.
mkfs:
To format a Linux partition,apply the mkfs command.It allows you to format a partition to a number of different filesystems.
To format a typical partition such as /dev/hda2 to the current Red Hat standard,the thrd extended filesystem,run the following command:
# mkfs -t ext3 /dev/hda2
The mkfs command also serves as a "front-end" ,depending on the filesystem format.For example,if you're formatting a Red Hat standard ext3 filesystem,mkfs by itself automatically calls the mkfs.ext3 command.Therefore,if you're reformatting an ext3 filesystem,the following command is sufficient:
# mkfs /dev/hda2
Be careful with mkfs.First,back up any data on the subject partition and computer.This command erases all data on the specified partition.
fsck:
The fsck command is analogous to the Microsoft chkdsk command.It performs an analysis of the specified filesystem and performs reparis as required.Assume you're having problems with files in the /var directory,which happens to be mounted on /dev/hda7.If you want to run fsck,unmount that filesystem first.In some cases,you may need to go into single-user mode with the init 1 command before you can unmount a filesystem.To unmount,analyze,then remount the filesystem noted in this section,run the following commands:
# umount /var
# fsck -t ext3 /dev/hda7
# mount /dev/hda7 /var
The fsck command also serves as a "front-end",depending on the filesystem format.For example,if you're formatting an ext2 or ext3 filesystem,fsck by itself automatically calls the e2fsck command(which works for bothe filesystems).Therefore, if you're checking an ext3 filesystem,the following command is sufficient:
# fsck /dev/hda7
相关文章推荐
- Method and system for implementing mandatory file access control in native discretionary access control environments
- BI Java 补丁错误处理 :Cannot login to the SAP J2EE Engine using user and password as provided in the Filesystem Secure Store. Enter va
- Node.JS 5.ChildProcessAndFileSystem
- File System Redirector and Sysnative - how to call 64 bit program from 32 bit application
- Linux file system events with C, Python and Ruby
- Indexing and Searching on a Hadoop Distributed File System (如何在HDFS文件上建索引)
- Robbie's Notes on File System Security in Linux (and comparison to Windows NT)
- “System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 错误
- 20080925 busybox and file system
- How to Setup NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu
- 分布式文件系统 and Google File System
- 开机出现checking file system on C或者D E F盘符的解决方法
- Filesystem Enumeration using Redis and Lua
- RAM and ROM File System vs ROM-only File System
- RAM and ROM File System vs ROM-only File System
- [原创]HOW TO USE VERITAS VOLUME MANAGER AND VERITAS FILE SYSTEM
- The Google File System : part5 FAULT TOLERANCE AND DIAGNOSIS
- Checking System Drive Free Space with WMI and PowerShell
- How to Copy Archivelog Files From ASM to Filesystem and vice versa
- How to Setup NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu