Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

File system, formatting, hanging, manually increasing swap space

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Windows file system: NTFS, FAT32

Linux file system xfs (centos7), ext4 (centos6), ext3, ext2

Centos7 to view the file systems supported by the current system

Mount command

View existing mounted disk partition file system

Format command

Mke2fs command default ext2 format

Mke2fs-t-b 2048 ext4

Mkfs.ext4

Mke2fs parameters:

Mke2fs-b 8192 / dev/sdb1 # 8k block, suitable for storing videos and pictures

Small chunks of mke2fs-b 2048 / dev/sdb1 # 2K suitable for storing a large number of small files

-m reserved space, reserved for the super user

Mke2fs-m 0.1 / dev/sdb1 # can only reserve 0.1

The ratio of inode to blocks is about 1: 4, that is, 1 inode corresponds to 16k of space (the default block is 4k) if you want more inode, use the following command to make 1 inode correspond to 8k of space

Du to view the actual file size

Blkid / dev/sdb1 view formatted unmounted partition file systems (cannot be viewed without mounted mount)

Mount / dev/sdb / mnt/sdb # / mnt/sdb is the mount point through which the partition is read and written

Umount / dev/sdb umount / mnt/sdb unmount Note: you need to exit the mount directory / mnt to unmount the mount point, or use the-l parameter

Default mount options for the mount command:

Rw can read and write

Suid can set suid

Dev /

Exec is runnable

Auto automatic mount

Ordinary nouser users cannot mount it.

Async async (deferred write to disk)

Examples of other parameters and commands for mount:

Mount-o rw / dev/sdb # read and write

Mount-o ro / dev/sdb # read-only

Mount-o remount / dev/sdb # remount

Mount-o remount, ro / dev/sdb

System automatic mount

Configuration file / etc/fstab

Uuid represents the device number of the disk partition, which is unique, followed by the file format. Defaults is the mount mode (default), 0 indicates whether to dump (currently not used, 0 is fine), 0 indicates whether to detect (0 does not detect, 1 is used for root file system detection, 2 is used for other file system detection)

Can be mounted with UUID

Dd if=/dev/zero of=/tmp/newswap bs=1M count=100 # dd is used to copy files from / dev/zero zero to / tmp/newdisk (block size 1m, quantity 100)

Mkswap-f / tmp/newswap # format

Swapon / tmp/newswap # Mount swap

Swapoff / tmp/newswap # Uninstall

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report