Linux Disk Format GPT

Öncelikle disklerimizi bir görelim;

[[email protected] ~]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdf           8:80   0    3T  0 disk
└─sdf1        8:81   0    2T  0 part
sdd           8:48   0    1T  0 disk
└─sdd1        8:49   0 1024G  0 part
sdb           8:16   0    1T  0 disk
└─sdb1        8:17   0 1024G  0 part
sr0          11:0    1 1024M  0 rom
sde           8:64   0    1T  0 disk
└─sde1        8:65   0 1024G  0 part
sdc           8:32   0    1T  0 disk
└─sdc1        8:33   0 1024G  0 part
sda           8:0    0  100G  0 disk
├─sda2        8:2    0   99G  0 part
│ ├─ol-swap 252:1    0   10G  0 lvm  [SWAP]
│ ├─ol-home 252:2    0   39G  0 lvm  /home
│ └─ol-root 252:0    0   50G  0 lvm  /
└─sda1        8:1    0    1G  0 part /boot

/dev/sdf diski görüldüğü üzere 3TB toplam boyutu var ancak formatından dolayı max 2TB adresleyebiliyor. Tekrar formatlayarak 3TB tek parça bir disk partition yapmak istiyoruz, öncelikle mevcut partitionu kaldıralım.

# fdisk /dev/sdf
Command (m for help): d
Selected partition 1
Partition 1 is deleted

Command (m for help): w
The partition table has been altered!

# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdf           8:80   0    3T  0 disk
sdd           8:48   0    1T  0 disk
└─sdd1        8:49   0 1024G  0 part
sdb           8:16   0    1T  0 disk
└─sdb1        8:17   0 1024G  0 part
sr0          11:0    1 1024M  0 rom
sde           8:64   0    1T  0 disk
└─sde1        8:65   0 1024G  0 part
sdc           8:32   0    1T  0 disk
└─sdc1        8:33   0 1024G  0 part
sda           8:0    0  100G  0 disk
├─sda2        8:2    0   99G  0 part
│ ├─ol-swap 252:1    0   10G  0 lvm  [SWAP]
│ ├─ol-home 252:2    0   39G  0 lvm  /home
│ └─ol-root 252:0    0   50G  0 lvm  /
└─sda1        8:1    0    1G  0 part /boot

GPT olarak formatlayalım

# parted /dev/sdf
GNU Parted 3.1
Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
# parted /dev/sdf
GNU Parted 3.1
Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
Warning: The existing disk label on /dev/sdf will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
(parted) unit TB
(parted) mkpart primary 0.00TB 3.00TB
(parted) quit
Information: You may need to update /etc/fstab.

Tekrar kontrol edelim, aşağıda 3TB tek parça olarak adreslediğini, görüyoruz

# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdf           8:80   0    3T  0 disk
└─sdf1        8:81   0    3T  0 part
sdd           8:48   0    1T  0 disk
└─sdd1        8:49   0 1024G  0 part
sdb           8:16   0    1T  0 disk
└─sdb1        8:17   0 1024G  0 part
sr0          11:0    1 1024M  0 rom
sde           8:64   0    1T  0 disk
└─sde1        8:65   0 1024G  0 part
sdc           8:32   0    1T  0 disk
└─sdc1        8:33   0 1024G  0 part
sda           8:0    0  100G  0 disk
├─sda2        8:2    0   99G  0 part
│ ├─ol-swap 252:1    0   10G  0 lvm  [SWAP]
│ ├─ol-home 252:2    0   39G  0 lvm  /home
│ └─ol-root 252:0    0   50G  0 lvm  /
└─sda1        8:1    0    1G  0 part /boot

Şimdi ilgili partitionu formatlayalım ve mount edelim

# mkfs.ext4 /dev/sdf1
# mkdir -p /backup
# blkid
/dev/mapper/ol-root: UUID="bb84b7c9-bd57-412f-a946-933882b25235" TYPE="xfs"
/dev/sda2: UUID="SSMtvr-OP5c-AbVx-T6EM-Iz4A-kQpg-2iQU4k" TYPE="LVM2_member"
/dev/sda1: UUID="54ae7114-f255-4867-a3ac-7aacf26b409d" TYPE="xfs"
/dev/mapper/ol-swap: UUID="6da6db9d-ec62-40ab-af98-fd81cc57e4a6" TYPE="swap"
/dev/mapper/ol-home: UUID="050b0a16-c7b6-408e-aba8-4d08e62af778" TYPE="xfs"
/dev/sdb1: LABEL="DISK1" TYPE="oracleasm"
/dev/sdc1: LABEL="DISK2" TYPE="oracleasm"
/dev/sdd1: LABEL="DISK3" TYPE="oracleasm"
/dev/sde1: LABEL="DISK4" TYPE="oracleasm"
/dev/sdf1: UUID="04fcb75a-08b2-43f7-9418-820b67d6f218" TYPE="ext4" PARTLABEL="primary" PARTUUID="406024d0-c801-455c-ad92-5138aa9e8963"

/dev/sdf1 UUID sini kopyalıyoruz ve /etc/fstab üzerinde mount satırını oluşturuyoruz.

UUID="04fcb75a-08b2-43f7-9418-820b67d6f218"  /backup    ext4    defaults        1       2

mount yapalım

# mount -a
# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs              16G     0   16G   0% /dev
tmpfs                 16G  637M   15G   4% /dev/shm
tmpfs                 16G  202M   16G   2% /run
tmpfs                 16G     0   16G   0% /sys/fs/cgroup
/dev/mapper/ol-root   50G   25G   26G  49% /
/dev/mapper/ol-home   39G   37M   39G   1% /home
/dev/sda1           1014M  325M  690M  32% /boot
tmpfs                3.2G   44K  3.2G   1% /run/user/1000
tmpfs                3.2G     0  3.2G   0% /run/user/0
/dev/sdf1            3.0T   72M  2.9T   1% /backup