Настройка DRBD с двумя жесткими дисками
Создание раздела диска
Создание раздела диска с MBR-разметкой
Для создания раздела диска с MBR-разметкой необходимо выполнить следующие действия:
-
на каждом головном сервере выполнить команду:
sudo fdisk <DISK_2>где <DISK_2> — наименование второго диска (например, /dev/sdb)
-
ввести следующие значения:
-
в Command ввести n, нажать Enter, чтобы создать новый раздел
-
в Select нажать Enter, чтобы установить тип primary
-
в Partition number нажать Enter, чтобы задать номер раздела по умолчанию
-
в First sector нажать Enter, чтобы задать значение первой секции по умолчанию
-
в Last sector нажать Enter, чтобы задать значение последней секции по умолчанию
-
в Command ввести w, чтобы записать внесенные изменения
Пример вывода команды:
admin@ivcs-main:~$ sudo fdisk /dev/sdb Welcome to fdisk (util-linux 2.36.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x3121c27e. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): Using default response p. Partition number (1-4, default 1): First sector (2048-10485759, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-10485759, default 10485759): Created a new partition 1 of type 'Linux' and of size 5 GiB. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. -
Создание раздела диска с GPT-разметкой
Для создания раздела диска с GPT-разметкой необходимо выполнить следующие действия:
-
на каждом головном сервере выполнить команду:
sudo gdisk <DISK_2>где <DISK_2> — наименование второго диска (например, /dev/sdb)
-
ввести следующие значения:
-
в Command выбрать n, нажать Enter, чтобы создать новый раздел
-
в Partition number нажать Enter, чтобы задать номер раздела по умолчанию
-
в First sector нажать Enter, чтобы задать значение первой секции по умолчанию
-
в Last sector нажать Enter, чтобы задать значение последней секции по умолчанию
-
в Hex code or GUID нажать Enter, чтобы задать значение типа раздела файловой системы по умолчанию
-
в Command ввести w, чтобы записать внесенные изменения
-
в Do you want to proceed? ввести y, чтобы сохранить изменения
Пример вывода команды:
admin@ivcs-main:~$ sudo gdisk /dev/sdb GPT fdisk (gdisk) version 1.0.6 Warning: Partition table header claims that the size of partition table entries is 0 bytes, but this program supports only 128-byte entries. Adjusting accordingly, but partition table may be garbage. Warning: Partition table header claims that the size of partition table entries is 0 bytes, but this program supports only 128-byte entries. Adjusting accordingly, but partition table may be garbage. Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries in memory. Command (? for help): n Partition number (1-128, default 1): First sector (34-20971486, default = 2048) or {+-}size{KMGTP}: Last sector (2048-20971486, default = 20971486) or {+-}size{KMGTP}: Current type is 8300 (Linux filesystem) Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'Linux filesystem' Command (? for help): w Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/sdb. The operation has completed successfully.При выводе команды возможно появление предупреждения, которое можно проигнорировать:
Warning: Partition table header claims that the size of partition table entries is 0 bytes, but this program supports only 128-byte entries.
Adjusting accordingly, but partition table may be garbage. -