Linux Disk partitioning

Source: Internet
Author: User
Tags uuid

[Email protected] ~]# part
Parted Partprobe Partx
[Email protected] ~]# parted
Anaconda-ks.cfg. cache/initial-setup-ks.cfg
. bash_history. config/. TCSHRC
. bash_logout. CSHRC. Xauthority
. Bash_profile g3308l
. BASHRC G3308L.1
[Email protected] ~]# parted/dev/sdb Mklabel GPT
GPT is changed to disk format
Warning: The existing disk label On/dev/sdb'll is destroyed and all data on this
Disk would be lost. Want to continue?
Is/yes/no/no? Yes
Info: Need to Update/etc/fstab.

[Email protected] ~]#
[Email protected] ~]# PARTED/DEV/SDB Print
Model:dell PERC H330 ADP (SCSI)
disk/dev/sdb:490gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Disk Flags:

Number Start End Size File system Name Flag

[Email protected] ~]#
[Email protected] ~]#
[Email protected] ~]# Parted/dev/sdb Mkpart primary EXT4 1 50G
Mkprat Create
Info: Need to Update/etc/fstab.

[Email protected] ~]# PARTED/DEV/SDB Print
Model:dell PERC H330 ADP (SCSI)
disk/dev/sdb:490gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Disk Flags:

Number Start End Size File system Name Flag
1 1049kB 50.0GB 50.0GB Primary

[Email protected] ~]# parted/dev/sdb Mkpart primary EXT4 50G 220G
Info: Need to Update/etc/fstab.

[Email protected] ~]# PARTED/DEV/SDB Print
Model:dell PERC H330 ADP (SCSI)
disk/dev/sdb:490gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Disk Flags:

Number Start End Size File system Name Flag
1 1049kB 50.0GB 50.0GB Primary
2 50.0GB 220GB 170GB Primary

[Email protected] ~]# parted/dev/sdb Mkpart primary EXT4 220G 400G
Info: Need to Update/etc/fstab.

[Email protected] ~]# PARTED/DEV/SDB Print
Model:dell PERC H330 ADP (SCSI)
disk/dev/sdb:490gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Disk Flags:

Number Start End Size File system Name Flag
1 1049kB 50.0GB 50.0GB Primary
2 50.0GB 220GB 170GB Primary
3 220GB 400GB 180GB Primary

[Email protected] ~]# parted/dev/sdb Mkpart primary EXT4 400G 450G
Info: Need to Update/etc/fstab.

[Email protected] ~]# PARTED/DEV/SDB Print
Model:dell PERC H330 ADP (SCSI)
disk/dev/sdb:490gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Disk Flags:

Number Start End Size File system Name Flag
1 1049kB 50.0GB 50.0GB Primary
2 50.0GB 220GB 170GB Primary
3 220GB 400GB 180GB Primary
4 400GB 450GB 50.0GB Primary

[Email protected] ~]# parted/dev/sdb Mkpart primary EXT4 450G 490.4G
Info: Need to Update/etc/fstab.

[Email protected] ~]#
[Email protected] ~]# PARTED/DEV/SDB Print
Model:dell PERC H330 ADP (SCSI)
disk/dev/sdb:490gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Disk Flags:

Number Start End Size File system Name Flag
1 1049kB 50.0GB 50.0GB Primary
2 50.0GB 220GB 170GB Primary
3 220GB 400GB 180GB Primary
4 400GB 450GB 50.0GB Primary
5 450GB 490GB 40.4GB Primary
[Email protected] ~]#
[Email protected] ~]# MKF
Mkfifo mkfs mkfs.ext2 Mkfs.fat mkfs.vfat
Mkfontdir mkfs.btrfs mkfs.ext3 Mkfs.minix mkfs.xfs
Mkfontscale Mkfs.cramfs MKFS.EXT4 Mkfs.msdos
[Email protected] ~]# Mkfs.ext
Mkfs.ext2 Mkfs.ext3 MKFS.EXT4
[Email protected] ~]# MKFS.EXT4/DEV/SDB1
MKE2FS 1.42.9 (28-dec-2013)
File System label =
OS Type:linux
Block size =4096 (log=2)
Chunked size =4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3055616 inodes, 12206848 blocks
610342 blocks (5.00%) reserved for the Super user
First block of data =0
Maximum filesystem blocks=2160066560
373 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Allocating group tables: complete
Writing Inode table: complete
Creating Journal (32768 blocks): complete
Writing Superblocks and FileSystem accounting information: Complete

[Email protected] ~]# MKFS.EXT4/DEV/SDB2
MKE2FS 1.42.9 (28-dec-2013)
File System label =
OS Type:linux
Block size =4096 (log=2)
Chunked size =4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
10379264 inodes, 41503744 blocks
2075187 blocks (5.00%) reserved for the Super user
First block of data =0
Maximum filesystem blocks=2189426688
1267 Block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: complete
Writing Inode table: complete
Creating Journal (32768 blocks): complete
Writing Superblocks and FileSystem accounting information: Complete

[Email protected] ~]# MKFS.EXT4/DEV/SDB3
MKE2FS 1.42.9 (28-dec-2013)
File System label =
OS Type:linux
Block size =4096 (log=2)
Chunked size =4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
10993664 inodes, 43945472 blocks
2197273 blocks (5.00%) reserved for the Super user
First block of data =0
Maximum filesystem blocks=2191523840
1342 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: complete
Writing Inode table: complete
Creating Journal (32768 blocks): complete
Writing Superblocks and FileSystem accounting information: Complete

[Email protected] ~]# MKFS.EXT4/DEV/SDB4
MKE2FS 1.42.9 (28-dec-2013)
File System label =
OS Type:linux
Block size =4096 (log=2)
Chunked size =4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3055616 inodes, 12206848 blocks
610342 blocks (5.00%) reserved for the Super user
First block of data =0
Maximum filesystem blocks=2160066560
373 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Allocating group tables: complete
Writing Inode table: complete
Creating Journal (32768 blocks): complete
Writing Superblocks and FileSystem accounting information: Complete

[Email protected] ~]# MKFS.EXT4/DEV/SDB5
MKE2FS 1.42.9 (28-dec-2013)
File System label =
OS Type:linux
Block size =4096 (log=2)
Chunked size =4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
2469152 inodes, 9870848 blocks
493542 blocks (5.00%) reserved for the Super user
First block of data =0
Maximum filesystem blocks=2157969408
302 Block Groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624

Allocating group tables: complete
Writing Inode table: complete
Creating Journal (32768 blocks): complete
Writing Superblocks and FileSystem accounting information: Complete
[Email protected] ~]#
[Email protected] ~]# fdisk-l
Usage:
fdisk [options] < disk > Change partition table
fdisk [Options]-l < disk > list partition table
Fdisk-s < partitioning > Given partition size (number of blocks)

Options:
-B < size > sector size (512, 1024, 2048, or 4096)
-c[=< mode;] Compatibility mode: "DOS" or "Nondos" (default)
-H Print this help text
-u[=< units;] Display units: "Cylinders" (cylinder) or "sectors" (sector, default)
-V Print Program version
-C < number > specified number of cylinders
-H < number > specified head number
-S < number > Specify the number of sectors per track

[Email protected] ~]# fdisk-l

Disk/dev/sda:108.4 GB, 108447924224 bytes, 211,812,352 sectors
Units = Sector of 1 * bytes
Sector size (logical/Physical): 512 Bytes/512 bytes
I/o size (min/best): 512 Bytes/512 bytes
Disk label Type: dos
Disk identifier: 0X000F1E5E

Device Boot Start End Blocks Id System
/DEV/SDA1 * 2048 1026047 512000 Linux
/dev/sda2 1026048 211812351 105393152 8e Linux LVM
Warning:fdisk GPT support are currently new, and therefore in an experimental phase. Use at your own discretion.

Disk/dev/sdb:490.4 GB, 490431578112 bytes, 957,874,176 sectors
Units = Sector of 1 * bytes
Sector size (logical/Physical): 512 Bytes/512 bytes
I/o size (min/best): 512 Bytes/512 bytes
Disk label type: GPT
Disk IDENTIFIER:B191B484-44AF-438D-938F-11D274A49EB4

Start End Size Type Name

1 2048 97656831 46.6G Microsoft Basic Primary
2 97656832 429686783 158.3G Microsoft Basic Primary
3 429686784 781250559 167.7G Microsoft Basic Primary
4 781250560 878905343 46.6G Microsoft Basic Primary
5 878905344 957872127 37.7G Microsoft Basic Primary

Disk/dev/mapper/centos-root:53.7 GB, 53687091200 bytes, 104.8576 million sectors
Units = Sector of 1 * bytes
Sector size (logical/Physical): 512 Bytes/512 bytes
I/o size (min/best): 512 Bytes/512 bytes

Disk/dev/mapper/centos-swap:8321 MB, 8321499136 bytes, 16,252,928 sectors
Units = Sector of 1 * bytes
Sector size (logical/Physical): 512 Bytes/512 bytes
I/o size (min/best): 512 Bytes/512 bytes

Disk/dev/mapper/centos-home:45.8 GB, 45843742720 bytes, 89,538,560 sectors
Units = Sector of 1 * bytes
Sector size (logical/Physical): 512 Bytes/512 bytes
I/o size (min/best): 512 Bytes/512 bytes

Create multiple directory mounts (sibling directories)!
[[Email protected] ~] #mkdir-P/{data,data_db,data_mm,data_zk,data-bak}
[Email protected]/]#
Mount
[Email protected]/]# Mount/dev/sdb1/data
[Email protected]/]# mount/dev/sdb2/data_db
[Email protected]/]# mount/dev/sdb3/data_mm
[Email protected]/]# MOUNT/DEV/SDB4/DATA_ZK
[Email protected]/]# Mount/dev/sdb5/data_bak
[Email protected]/]# df-h
File system capacity has been used with available% mount points
/dev/mapper/centos-root 50G 4.2G 46G 9%/
Devtmpfs 7.7G 0 7.7G 0%/dev
Tmpfs 7.7G 0 7.7G 0%/dev/shm
Tmpfs 7.7G 35M 7.6G 1%/run
Tmpfs 7.7G 0 7.7G 0%/sys/fs/cgroup
/dev/mapper/centos-home 43G 38M 43G 1%/Home
/DEV/SDA1 497M 207M 290M 42%/boot
Tmpfs 1.6G 12K 1.6G 1%/run/user/42
Tmpfs 1.6G 0 1.6G 0%/run/user/0
/DEV/SDB1 46G 53M 44G 1%/data
/DEV/SDB2 156G 61M 148G 1%/data_db
/DEV/SDB3 165G 61M 157G 1%/data_mm
/DEV/SDB4 46G 53M 44G 1%/DATA_ZK
/DEV/SDB5 37G 49M 35G 1%/data_bak
[Email protected]/]#
Add power-on self-start
[Email protected]/]# Vi/etc/fstab
#

/etc/fstabcreated by Anaconda on Thu 10 21:49:38 2018

#

Accessible filesystems, by reference, is maintained under '/dev/disk ' See Mans Pages Fstab (5), Findfs (8), mount (8) and/or B Lkid (8) for more info

#
/DEV/MAPPER/CENTOS-ROOT/XFS Defaults 0 0
Uuid=b1d9e140-abb0-4d5c-b79e-fdd0ef5b5c3d/boot XFS Defaults 0 0
/dev/mapper/centos-home/home XFS Defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
~
~

#

/etc/fstabcreated by Anaconda on Thu 10 21:49:38 2018

#

Accessible filesystems, by reference, is maintained under '/dev/disk ' See Mans Pages Fstab (5), Findfs (8), mount (8) and/or B Lkid (8) for more info

#
/DEV/MAPPER/CENTOS-ROOT/XFS Defaults 0 0
Uuid=b1d9e140-abb0-4d5c-b79e-fdd0ef5b5c3d/boot XFS Defaults 0 0
/dev/mapper/centos-home/home XFS Defaults 0 0
/DEV/SDB3 on/data_mm type EXT4 (rw,relatime,seclabel,data=ordered)
"/etc/fstab" 17L, 916C written
[Email protected]/]#
[Email protected]/]# df-h
File system capacity has been used with available% mount points
/dev/mapper/centos-root 50G 4.2G 46G 9%/
Devtmpfs 7.7G 0 7.7G 0%/dev
Tmpfs 7.7G 0 7.7G 0%/dev/shm
Tmpfs 7.7G 35M 7.6G 1%/run
Tmpfs 7.7G 0 7.7G 0%/sys/fs/cgroup
/dev/mapper/centos-home 43G 38M 43G 1%/Home
/DEV/SDA1 497M 207M 290M 42%/boot
Tmpfs 1.6G 12K 1.6G 1%/run/user/42
Tmpfs 1.6G 0 1.6G 0%/run/user/0
/DEV/SDB1 46G 53M 44G 1%/data
/DEV/SDB2 156G 61M 148G 1%/data_db
/DEV/SDB3 165G 61M 157G 1%/data_mm
/DEV/SDB4 46G 53M 44G 1%/DATA_ZK
/DEV/SDB5 37G 49M 35G 1%/data_bak
[Email protected]/]#
[Email protected]/]# PARTED/DEV/SDB Print
Model:dell PERC H330 ADP (SCSI)
disk/dev/sdb:490gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Disk Flags:

Number Start End Size File system Name Flag
1 1049kB 50.0GB 50.0GB EXT4 Primary
2 50.0GB 220GB 170GB EXT4 Primary
3 220GB 400GB 180GB EXT4 Primary
4 400GB 450GB 50.0GB EXT4 Primary
5 450GB 490GB 40.4GB EXT4 Primary

Linux Disk partitioning

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.