Genellikle LVM diskleri genişletirken sorun yaşadığınızı biliyoruz, en çok aldığımız destek talepleri arasındadır. Bu yazımızda işinizi kolaylaştırmak için örnek bir genişletme işlemini sizinle paylaşıyoruz.
Sunucumuzun diski 500GB ve bunu 2TB olarak güncelleyeceğiz. Örnek çıktı aşağıdaki gibi, kontrolde 500 GB olduğu gözüküyor ve sanal sunucumuzun diskini, vmware üzerinden 2TB olarak ayarladıktan sonra sunucuyu yeniden başlatıyoruz.
[root@sunucu.com.tr veeam]# fdisk -l Disk /dev/sda: 515.4 GB, 515396075520 bytes, 1006632960 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x000a7393 Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 39845887 18873344 8e Linux LVM /dev/sda3 39845888 1006632959 483393536 83 Linux Disk /dev/mapper/cl-root: 512.3 GB, 512271319040 bytes, 1000529920 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/cl-swap: 2042 MB, 2042626048 bytes, 3989504 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes [root@sunucu.com.tr veeam]# reboot
Sunucumuz yeniden başladı ve diski kontrol ettiğimizde aşağıdaki gibi bir çıktı alıyoruz.
[root@sunucu.com.tr ~]# fdisk -l Disk /dev/sda: 2147.5 GB, 2147483648000 bytes, 4194304000 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x000a7393 Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 39845887 18873344 8e Linux LVM /dev/sda3 39845888 1006632959 483393536 83 Linux Disk /dev/mapper/cl-root: 512.3 GB, 512271319040 bytes, 1000529920 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/cl-swap: 2042 MB, 2042626048 bytes, 3989504 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes [root@sunucu.com.tr ~]#
Eklediğimiz ve boşta olan alan için aşağıdaki şekilde yeni bir partition ekleyelim.
[root@sunucu.com.tr ~]# fdisk /dev/sda Welcome 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): p Disk /dev/sda: 2147.5 GB, 2147483648000 bytes, 4194304000 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x000a7393 Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 39845887 18873344 8e Linux LVM /dev/sda3 39845888 1006632959 483393536 83 Linux Command (m for help): n Partition type: p primary (3 primary, 0 extended, 1 free) e extended Select (default e): p Selected partition 4 First sector (1006632960-4194303999, default 1006632960): Using default value 1006632960 Last sector, +sectors or +size{K,M,G} (1006632960-4194303999, default 4194303999):
Using default value 4194303999 Partition 4 of type Linux and of size 1.5 TiB is set Command (m for help): w The 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 at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. [root@sunucu.com.tr ~]#