part 큰 디스크 구분

창설 작업이 2T보다 큰 구역을 만드는 일반적인 상황에서 우리는 fdisk 도구를 사용하여 구역을 나누는 것을 선택했지만 현재 실제 생산 환경에서 사용하는 디스크 공간이 점점 커지고 TiB급으로 증가했다.자주 사용하는 fdisk라는 도구는 구역에 대한 크기 제한이 있기 때문에 2T 이하의 디스크만 구분할 수 있기 때문에 2T 디스크보다 큰 구역을 그을 때 fdisk는 요구를 만족시킬 수 없다.이때 두 가지 방법이 있는데 하나는 볼륨 관리를 통해 실현하는 것이고 다른 하나는 파티드 도구를 통해 GPT 디스크에 대해 구역별 조작을 실현하는 것이다.여기서 우리는 파티드의 방법을 채택하여 관리를 실현한다.
40T 디스크를 파티셔닝하는 절차는 다음과 같습니다.
[root@test100 ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sda: 1199.0 GB, 1198999470080 bytes, 2341795840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disk label type: gpt
Disk identifier: 9BD5C445-8D38-4490-8A9E-B15E9FBB8BC8


#         Start          End    Size  Type            Name
 1         2048       411647    200M  EFI System      EFI System Partition
 2       411648      2508799      1G  Microsoft basic 
 3      2508800   2341793791    1.1T  Linux LVM       

Disk /dev/sdb: 44000.0 GB, 43999996936192 bytes, 85937494016 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 1048576 bytes


Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes


Disk /dev/mapper/centos-swap: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes


Disk /dev/mapper/centos-home: 1139.7 GB, 1139730808832 bytes, 2226036736 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes

[root@test100 ~]# part
parted     partprobe  partx      
[root@test100 ~]# parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Error: /dev/sdb: unrecognised disk label
Model: AVAGO HW-SAS3508 (scsi)                                            
Disk /dev/sdb: 44.0TB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 
(parted) mklabel gpt                                                      
(parted) p                                                                
Model: AVAGO HW-SAS3508 (scsi)
Disk /dev/sdb: 44.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart primary 0 22T
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? I                                                          
(parted) p                                                                
Model: AVAGO HW-SAS3508 (scsi)
Disk /dev/sdb: 44.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  22.0TB  22.0TB               primary

(parted) mkpart primary 22T -1
(parted) p
Model: AVAGO HW-SAS3508 (scsi)
Disk /dev/sdb: 44.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  22.0TB  22.0TB               primary
 2      22.0TB  44.0TB  22.0TB               primary

(parted) p                                                                
Model: AVAGO HW-SAS3508 (scsi)
Disk /dev/sdb: 44.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  22.0TB  22.0TB               primary
 2      22.0TB  44.0TB  22.0TB               primary

(parted) q                                                                
Information: You may need to update /etc/fstab.

[root@test100 ~]# df                                            
Filesystem               1K-blocks     Used  Available Use% Mounted on
devtmpfs                 133618048        0  133618048   0% /dev
tmpfs                    133633792        0  133633792   0% /dev/shm
tmpfs                    133633792    97472  133536320   1% /run
tmpfs                    133633792        0  133633792   0% /sys/fs/cgroup
/dev/mapper/centos-root   52403200 15015640   37387560  29% /
/dev/sda2                  1038336   151480     886856  15% /boot
/dev/sda1                   204580     9112     195468   5% /boot/efi
/dev/mapper/centos-home 1112474880  2396624 1110078256   1% /home
tmpfs                     26726784       64   26726720   1% /run/user/42
tmpfs                     26726784      576   26726208   1% /run/user/0
[root@test100 ~]# mkfs.ext
mkfs.ext2  mkfs.ext3  mkfs.ext4  
[root@test100 ~]# mkfs.ext4 /dev/sdb
sdb   sdb1  sdb2  
[root@test100 ~]# mkfs.ext4 /dev/sdb1 
mke2fs 1.42.9 (28-Dec-2013)
/dev/sdb1 alignment is offset by 244736 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=64 blocks, Stripe width=256 blocks
335693824 inodes, 5371093744 blocks
268554687 blocks (5.00%) reserved for the super user
First data block=0
163913 block groups
32768 blocks per group, 32768 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 
	2560000000, 3855122432

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done         

[root@test100 ~]# mkfs.ext4 /dev/sdb2 
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=64 blocks, Stripe width=256 blocks
335693824 inodes, 5371092736 blocks
268554636 blocks (5.00%) reserved for the super user
First data block=0
163913 block groups
32768 blocks per group, 32768 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 
	2560000000, 3855122432

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 
done         

[root@test100 ~]# 
[root@test100 ~]# lsblk 
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb               8:16   0   40T  0 disk 
├─sdb2            8:18   0   20T  0 part 
└─sdb1            8:17   0   20T  0 part 
sda               8:0    0  1.1T  0 disk 
├─sda2            8:2    0    1G  0 part /boot
├─sda3            8:3    0  1.1T  0 part 
│ ├─centos-swap 253:1    0    4G  0 lvm  [SWAP]
│ ├─centos-home 253:2    0    1T  0 lvm  /home
│ └─centos-root 253:0    0   50G  0 lvm  /
└─sda1            8:1    0  200M  0 part /boot/efi
[root@test100 ~]# 


참고 자료:https://www.cnblogs.com/wholj/p/10924129.html

좋은 웹페이지 즐겨찾기