"Knowledge points"
Linux command: DF fdisk mount/unmount |
"Step 1." View disk Information Fdisk-l
[[email protected]dev]# fdisk-l
disk/dev/vda:4294 MB, 4294967296 bytes
Heads, Sectors/track, 6096 cylinders
Units = Cylinders of 1376 * 704512 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x000dcf96
Device Boot Start End Blocks Id System
/DEV/VDA1 * 2 6097 4193280 Linux
disk/dev/vdb:2147.5 GB, 2147483648000 bytes
Heads, Sectors/track, 4161015 cylinders
Units = Cylinders of 1008 * 516096 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk Identifier:0xb29abbe6
Device Boot Start End Blocks Id System
/DEV/VDB1 1 208052 104858176+ Linux
/DEV/VDB2 208053 2288561 1048576536 -up Linux
2. Add Partition fdisk disk
FDISK/DEV/VDB #在磁盘/DEV/VDB Partition disk
[[email protected]dev]# Fdisk/dev/vdb
Warning:dos-compatible mode is deprecated. It ' s strongly recommended to
Switch off the mode (command ' C ') and change display units to
Sectors (Command ' u ').
Command (M for help): N #添加分区
Command action
E Extended
P Primary partition (1-4)
p #添加主分区
Partition Number (1-4): 3
First Cylinder ( 2288562-4161015, default 2288562):
Using Default value 2288562
Last cylinder, +cylinders or +size{k,m,g} (2288562- 4161015, default 4161015): +50g
Command (M for help): w #写入分区
The partition table has been altered!
Calling IOCTL () to re-read partition table.
Syncing disks.
3. Format the disk
Mkfs.exts4/dev/vdb3
Remarks: Format Partitioning method
MKFS-Supports ext2, ext3 (log), VFAT, Msdos, JFS, ReiserFS, etc. Usage 1:mkfs-t <fstype> <partition> Example: #mkfs-T EXT3/DEV/HDA1 Usage 2:mkfs.<fstype> <partition> Example: #mkfs. vfat/dev/hda2 |
4. Mount Partitions
Mount/dev/vdb3/home
5. Writing/etc/fstab files
The above operation, after the system restarts, the swap file size will be changed back to the original size, we can add the following configuration in the/etc/fstab, so that after the reboot, we just the configuration is still valid. Add the following:
/dev/vdb1/u01 EXT4 Defaults 0 0 /dev/vdb2/data EXT4 Defaults 0 0 /dev/vdb3/home EXT4 Defaults 0 0 /DEV/VDB4 swap swap defaults 0 0 |
Linux Disk partitioning