A summary of learning about Linux disks and file systems:
- Linux disk and File system Management (1) _ Partition formatting
- Linux disk and File System Management (2) _ File system detection
- Linux disk and File System Management (3) _ Disk Mount Offload
- Linux disk and File System Management (4) _ File System Properties View modifications
- Linux disk and File System Management (5) _ Create swap partition
- Linux disk and File System Management (6) _ Link File ln
exercise: Create a 10G file system with type EXT4, which requires the boot to be automatically mounted to the/mydata directory;
#创建一个10G的逻辑分区 [[email protected] ~]# fdisk /dev/sdawelcome to fdisk ( util-linux 2.23.2). changes will remain in memory only, until you decide to Write them. Be careful before using the write command. command (m for help): nall primary partitions are in useadding logical partition 10First sector (108558336-251658239, default 108558336):  USING DEFAULT VALUE 108558336LAST SECTOR, +SECTORS OR +SIZE{K,M,G} (108558336-251658239, default 251658239): +10gpartition 10 of type linux and of size 10 gib is setcommand (M FOR HELP): wthe partition table has been altered! Calling ioctl () to re-read partition table. WARNING: re-reading the partition table failed with error 16: device or resource busy. The kernel still uses the old table. the new table will be used atthe next reboot or after you run partprobe (8) or kpartx (8) syncing disks. #内核重读分区表信息 [[email protected] ~]# partprobe# Creating a file system Ext4 [[email protected] ~]# mkfs -t ext4 /dev/sda10mke2fs 1.42.9 (28- Dec-2013) filesystem label=os type: linuxblock size=4096 (log=2) Fragment size= 4096 (log=2) stride=0 blocks, stripe width=0 blocks655360 inodes, 2621440 blocks131072 blocks (5.00%) reserved for the super userFirst data block=0maximum filesystem blocks=215167795280 block groups32768 blocks p Er group, 32768 fragments per group8192 inodes per groupsuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): donewriting superblocks and filesystem accounting information: done #编辑/etc /fstab Set Boot [[email protected] ~]# vim /etc/fstab label=homework /mydaTa ext4 defaults 0 0# mount all devices that are not mounted under/etc/fstab [[email protected] ~]# mount -a# Viewing mounted devices [[email protected] ~]# dffilesystem 1k-blocks used available use% mounted on....../dev/sda5 9947976 36976 9382616 1% /home/dev/sda10 10190100 36888 9612540 1% /mydata
If there is any mistake, please correct me!
Thank you!
Linux disk and file system management