Disk Management---Creating file systems and Mounts
Creating a file system
Formatting
[Email protected] devices]# MKFS.EXT4/DEV/SDB1
Or
[Email protected] devices]# mkfs-t EXT4/DEV/SDB1
MKFS.EXT4 Options when formatting:
-b--specifying the size of a file system block
-g--specify the size of each block group
-i--specify how many bytes of disk space each I node occupies
-i--Specifies the amount of space occupied by the file system I node
-n--Specifies the number of I nodes, approximate
-l--the label of the specified disk partition
1) Specify the size of the block when formatting
[Email protected] ~]# mkfs.ext4-b 1024/DEV/SDB2
[Email protected] ~]# Dumpe2fs-h/DEV/SDB2 | grep Block
DUMPE2FS 1.41.12 (17-may-2010)
Block count:208844
Block size:1024
Blocks per group:8192
2) label of the specified partition (volume label) when formatting
[Email protected] ~]# mkfs.ext4-l DATA/DEV/SDB2
View the volume label for a partition
[Email protected] ~]# E2LABEL/DEV/SDB2
Data
2. Mounting
Purpose of mounting:
Provides access to the device's interface via mount point
1) Mount command
--View current mount status
[email protected] ~]# mount
/dev/sda2 on/type ext4 (rw)
Proc On/proc type proc (rw)
Sysfs On/sys type SYSFS (rw)
--View the label of the partition when the mount is displayed
[Email protected] ~]# mount-l
2) Mount Mount
Syntax format
Mount [-FNRSVW] [-t vfstype] [-O options] Device dir
Mount Options
async--Asynchronous
sync--Synchronization
atime--Access Time
noatime--do not change access time
auto--Automatic
DEFAULTS--RW, suid, Dev, exec, auto, Nouser, Async,and relatime.
remount--re-mount
Example:
[Email protected] ~]# mount-t ext4-o ro/dev/sdb2/mnt/sdb2
[email protected] ~]# Mount | grep SDB
/DEV/SDB2 on/mnt/sdb2 type Ext4 (RO)
[Email protected] ~]# cd/mnt/sdb2/
[[email protected] sdb2]# ls
Lost+found
[[email protected] sdb2]# Touch ABC
Touch:cannot Touch ' abc ': Read-only File system
[[Email protected] sdb2]# CD
[Email protected] ~]# Mount-o RW,REMOUNT/DEV/SDB2
[Email protected] ~]# cd/mnt/sdb2/
[[email protected] sdb2]# ls
Lost+found
[[email protected] sdb2]# touch a
[[email protected] sdb2]# ls
A lost+found
This article is from the "Empty Valley Orchid" blog, please be sure to keep this source http://2489843.blog.51cto.com/2479843/1671276
Linux Operational Systems Engineer Series---