The general method for using the Linux File System-general Linux technology-Linux technology and application information. The following is a detailed description. Create a partition on the hard disk: run the fdisk command.
Create a file system on a partition: similar to formatting in Windows.
Mount the file system to the system: after creating a file system in the partition, you can mount the partition to the corresponding directory in the system for use. The mount command can be used to mount a file system. If the system automatically mounts the file system at startup, you must add the corresponding setting lines in the file "/etc/fstab.
Unload File System: For file systems on removable media, use the umount command to perform the unmount operation after use.
Create a File System
Format of the front-end command mkfs
? # Mkfs? T fstype? C partition device name
-T fstype: Specifies the file system type.
-C: check whether there are any bad blocks before creating a file system.
Example
? # Mkfs? T ext3? C/dev/hda2
? # Mke3fs? C/dev/hda2
? # Mkfs? T ext2? C/dev/sda1
? # Mkfs? T vfat? C/dev/hdb2
Mounted File System
Mount Command Format
? # Mount [parameters] [ <分区设备名> ] [ <挂装点> ]
? Common Parameters
? T <文件系统类型> : Specifies the file system type.
-R: Read-Only mounting
? O iocharset = cp936: Enable the mounted device to display the Chinese file name
? O loop: Use a send-back device to mount ISO files and image files
Example
? # Mount? T ext3/dev/sdb1/opt
? # Mount? T vfat/dev/hda6/mnt/win
? # Mount? T vfat? O iocharset = cp936/dev/hda8/mnt/win2
? # Mount
Unload File System
Umount Command Format
? # Umount <partition device name or mounting point>
Example
? # Umount/dev/hda6
? # Umount/dev/sdb1
? # Umount/opt
Use the fuser command
When the file system is in the "busy" status
? Files opened on the file system
? The working directory of a process on this file system
? The cached file on the file system is being used.
Fuser command
? # Fuser [Option] File Name or file system name
? Example
# Fuser? Um/home
# Fuser? Km/home
Use removable storage devices
Floppy Disk
? Mount/mnt/floppy
? Umount/mnt/floppy
CD
? Mount/mnt/cdrom
? Umount/mnt/cdrom
ISO file
? Mount? O loop shrike-i386-disc1.iso/mnt/iso
? Mkisofs-r-o/tmp/myhome. iso/home
? Umount/mnt/iso
USB disk
? Mount-t vfat/dev/sda1/mnt/usb1
? Umount/mnt/usb1
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service