Skip to content

Instantly share code, notes, and snippets.

@gseldon
Last active April 4, 2021 14:06
Show Gist options
  • Save gseldon/4c69f554478261ffd7db13fa46402de7 to your computer and use it in GitHub Desktop.
Save gseldon/4c69f554478261ffd7db13fa46402de7 to your computer and use it in GitHub Desktop.
Linux. Disk. Расширение диска
#Сбор информации
fdisk -l (дисковые разделы)
pvdisplay
lvdisplay
#Расширяем раздел
fdisk /dev/sda
p (list partitions)
d (delete partition)
2 (2 is for second partition. /dev/sda2 for example)
n (add new partition)
p (primary)
...
t (меняем тип на LVM)dffd0
2
8e
w (write to disk and exit)
Система должна увидеть изменения
partprobe (requesting that the operating system re-read the partition table)
или echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan
если не помогло, то перезагрузка ОС
Расширяем physical volume
pvresize /dev/sda2
Расширяем logical volume и ФС на нем
lvresize -r -l +100%FREE /dev/vg_main/root
resize2fs /dev/vg_???????/lv_root
Статья http://ryandoyle.net/posts/expanding-a-lvm-partition-to-fill-remaining-drive-space/
===================================================================================================
#Добавление раздела более 2Тб
yum install parted
#смотрим что как
lsblk
#выбираем диск
parted /dev/sdb
print
#делаем метку gpt
mklabel gpt
#ед изм в Гб
unit GB
#создаем раздел
mkpart primary 0GB 5420GB
# смотрим и выходим
print
quit
#формат в ext4
mkfs.ext4 /dev/sdb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment