Disk and file system management

Source: Internet
Author: User


Terminal type:

Console: Console

Pty: Physical terminal (VGA)

Tty #: virtual terminal (VGA)

TTYs #: Serial Terminal

PTS/#: Pseudo Terminal

Shell:


Ln [-S-v] SRC dest



Hard link:

1. Only files can be created and cannot be applied to directories;

2. Cross-file systems are not supported;

3. Creating a hard link increases the number of file links;

Symbolic Link:

1. It can be applied to directories;

2. Cross-file systems are supported;

3. The number of links to linked files is not increased;

4. Its size is the number of characters contained in the specified path;


Du

-S

-H

DF:

Link


DEVICE file:

B: devices that are randomly accessed by block;

C: linear devices are measured in characters;

B: Hard Disk

C: keyboard

/Dev

Master device number (major number)

Device Type

Sub-device number (minor number)

Identifies different devices of the same type


Mknod

Mknod [Option]... name type [major minor]

-M Mode

File Name of the hard disk device:

IDE, ATA: HD

SATA: SD

SCSI: SD

USB: SD

A, B, C,... to distinguish different devices of the same type

IDE:

First ide port: master and slave

/Dev/hda,/dev/HDB

Second ide port: master and slave

/Dev/HDC,/dev/HDD


SDA, SDB, SDC ,...


Hda:

Hda1: the first primary Partition

Hda2:

Hda3:

Hda4:

Hda5: the first logical Partition

Check that the current system recognizes several hard disks:

Fdisk-L [/dev/to/some_device_file]


Manage disk partitions:

Fdisk/dev/SDA

P: displays partitions of the current hardware, including unsaved changes.

N: Create a New partition.

E: extended partition

P: Primary Partition

D: delete a partition.

W: Save and exit

Q: Do not save and exit

T: Modify the partition type.

L:

L: Display All supported types

Partprobe


Disk Management






File System Management

Re-create a file system will damage the original file


Mkfs: Make File System

-T fstype

Mkfs-T ext2 = mkfs. ext2


[[Email protected] ~] # Mkfs-T ext2/dev/sda5

Mke2fs 1.39 (29-may-2006)

Filesystem label =

OS type: Linux

Block size = 4096 (log = 2)

Fragment size = 4096 (log = 2)

245280 inodes, 489974 Blocks

24498 blocks (5.00%) reserved for the Super User

First data block = 0

Maximum filesystem blocks = 503316480

15 block groups

32768 blocks per group, 32768 fragments per group

16352 inodes per group

Superblock backups stored on blocks:

32768,983 04, 163840,229 376, 294912


Writing inode tables: Done

Writing superblocks and filesystem accounting information: Done


This filesystem will be automatically checked every 29 mounts or

180 days, whichever comes first. Use tune2fs-C or-I to override.




Mkfs-T ext3 = mkfs. ext3


[[Email protected] ~] # Mkfs-T ext3/dev/sda7

Mke2fs 1.39 (29-may-2006)

Filesystem label =

OS type: Linux

Block size = 4096 (log = 2)

Fragment size = 4096 (log = 2)

123648 inodes, 246991 Blocks

12349 blocks (5.00%) reserved for the Super User

First data block = 0

Maximum filesystem blocks = 255852544

8 block groups

32768 blocks per group, 32768 fragments per group

15456 inodes per group

Superblock backups stored on blocks:

32768,983 04, 163840,229 376


Writing inode tables: Done

Creating Journal (4096 blocks): Done

Writing superblocks and filesystem accounting information: Done


This filesystem will be automatically checked every 22 mounts or

180 days, whichever comes first. Use tune2fs-C or-I to override.


Dedicated Management of ext files:

Mke2fs

-J: Create an ext3 file system.

-B block_size: Specifies the block size. The default value is 4096. The available value is 1024, 2048, or 4096;

-L label: Specify the volume label of the partition;

-M #: Specify the percentage of blocks reserved for Super Users.

-I #: used to create an inode for the specified size of bytes. The default value is 8192. the value given here should be 2 ^ n times the block size;

-N #: specifies the number of inodes;

-F: Force create a file system;

-E: specify additional file system attributes;



Disk and file system management

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.