Linux file system

Source: Internet
Author: User

File system Popular is the way files are organized on disk
Linux supports multiple file systems: ext3 ext4 ZFS iso9660 msdos NFS, etc.
Super Block Superblock I node inode data blocks data Block directories directory block
Disk partition Create file system (format) Mount
Primary partition extended partition logical partition
Fdisk-l
FDISK/DEV/SDB---N---p---1----cylinder start 1----End---w #分区完成
Mkfs-t EXT4/DEV/SDB1 #格式化分区
MOUNT/DEV/SDB1 Newdisk #挂载到newDisk目录
Mount to see if the mount was successful
df-h | grep sdb1 #查看可用空间
Set up boot automatically mount/etc/fstab
echo "/dev/sab1/root/newdisk ext4 default 0 0" >>/etc/fstab
Fsck and Badblocks
Linux logical volumes are devices created using logical volume groups to manage LVM
Physical volume PV is a hard disk partition such as/DEV/SDA1
The physical volume group VG is a collection of multiple PV
Logical volume LV A logical disk that is separated from the House volume group
In layman's terms, multiple physical hard disks are partitioned into a large hard disk, and multiple logical hard disks are divided from this large hard drive.
Experimental process: The virtual machine First add a piece of 1G hard disk/DEV/SDC, divided into 3 partitions/DEV/SDC1/DEV/SDC2/DEV/SDC3 the current partition ID of 83 needs to be changed to 8e after creation, indicating that the partition is a special partition for logical volume management,
FDISK/DEV/SDC----T-----1-----L----8e----w
Create partitions 2 and 3 with PVCREATE/DEV/SDC1 partition 1 as PV
When finished, use Pvscan to view all physical volumes of the system or use Pvdisplay
There's a PV. Then you can create the volume group VG.
Vgcreate TESTVG/DEV/SDC1/DEV/SDC2/DEV/SDC3
Vgscan Vgdisplay
Expansion Volume Group Vgextend
If you find that you need to expand the capacity of your TESTVG during use, you can use Vgextend
Vgextend TESTVG/DEV/SDC4/DEV/SDC5
With the volume group VG, you can create a logical volume LV.
When you create a LV, you need to define the size of the logical volume, the name, and the space of the VG volume group that the logical volume uses.
Lvcreate-l 100m-n Lv_name Vg_name
Lvdisplay
Create a file system and mount it
We created the logical volumes, but we are not ready to use them, we need to create the file system and mount it.

Linux file system

Related Article

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.