Understanding of file storage and disk management

Understanding of file storage and disk management

First, the management of disk partitions;

1. What is the disk, what is a file system?
In order to meet the system is low on disk occurs, should be added to increase the disk storage space;
if the disk compared to real estate, then the partition is every room, every room is a file system renovation program (computer room, classroom);
file system: a way to manage and organize files on an external storage device
2. the disk partition type;
primary partition: the equivalent windows of the C drive, the storage system;
extended partition: a concept is, in fact, can not see;
logical partition: the partition will store data on the extended partition, and the like can be used to swap area;

3. Partition process;
a.fdisk -l disk device ## to view the system
b.fdisk disk device ## starts the partition name
c n-## by the new partition.
D P according to the new primary partition ##, e is extended partition. l logical partition
e numbered sequentially input;.
. F default start position of carriage return;
. G end position, a manual input size + 5G, the size can be arbitrary, if the disk is used directly enter all of the space;
HW save exit, q exit without saving;
i.partx -a device name ## re-read the partition table
j.mkfs -t file system type format partitions ## partition name
k.mount partition device mount point name system ## mounted to the partition directory

Second, the file management system;

1. File system: methods and data structures of the file on the host disk or clear partition;
Configuration system partition;
the mkfs -t ext4 partition device name for the file system is formatted partition ## ext4 format
mount hanging partition device name contained ## point mount system
configuration swap;
the mkswap partition device name for the file system is formatted partition ## swap format Note: you need to specify the type of the partition 82 partition
swapon partition device name swap partition opening ##
free -m ## View memory information system

Third, the mount;

1. Mount the partition into the system;
temporary mount; mount command
syntax: mount / dev / sdb1 / benet ## mount point must exist
permanently mounted;
vi / etc / fstab ## boot load this file
/ dev / sdb1 / Benet ext4 Defaults 0 0
2. mount swap into the system;
temporary mount;
syntax: swapon partition device name ## open swap partition
permanent mount;
vi / etc / fstab ## boot load this file
/ dev / sdb1 0 0 Defaults the swap the swap
3. Mount iso image file to the system;
temporary mount;
syntax: mount -o loop mount point location of the image file
permanently mounted;
VI / etc / fstab boot load this file ##
iso storage location Defaults mount point ISO9660, Loop 0 0
4. unloading;
syntax: umount mount point

Fourth, the expansion;

  1. When the hard disk size is greater than 2T, it is necessary to change the format of the GPT partition;
    partitioning the parted:
    [LWH the root @ ~] # the parted / dev / SDB
    (the parted) mklabel GPT
    (the parted) Print
    the Model: the VMware, the VMware the Virtual S (SCSI )
    Disk / dev / sdb: 21.5GB
    Sector size (the Logical / PHYSICAL): 512B / 512B
    Partition the Table: gpt

Number Start End Size File system Name 标志
(parted) mkpart primary 0 5GB
忽略/Ignore/放弃/Cancel? i
(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name 标志
1 17.4kB 5000MB 5000MB primary
(parted) quit
[root@lwh ~]# mkfs -t ext4 /dev/sdb1
[root@lwh ~]# mount /dev/sdb1 /benet/
[root@lwh ~]# ls /benet/

  1. linux u disk loading system;
    NTFS format disk u:
    compiler installation package ntfs-3g;
    Mount -t ntfs-3g / dev / sdb1 / Benet
    FAT32 format disk u:
    Mount -t vfat / dev / sdb1 / Benet

Guess you like

Origin blog.51cto.com/13528668/2422215