Linux operation and Maintenance system Engineer Series---22

Source: Internet
Author: User

Disk Management---Creating file systems and Mounts

    1. 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---

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.