Mdadm: Difference between revisions
Jump to navigation
Jump to search
(→sgdisk) |
|||
Line 33: | Line 33: | ||
mdadm --readwrite /dev/md127 | mdadm --readwrite /dev/md127 | ||
=sgdisk= | |||
# Whiping partition. | # Whiping partition. | ||
sgdisk -oz /dev/sda | sgdisk -oz /dev/sda | ||
Line 47: | Line 47: | ||
# Information about disk. | # Information about disk. | ||
gdisk -l /dev/sda | gdisk -l /dev/sda | ||
=Create partition to build mirrors on= | |||
sudo gdisk /dev/sdf | |||
n | |||
FD00 | |||
sudo gdisk -l /dev/sdf | |||
Number Start (sector) End (sector) Size Code Name | |||
1 2048 7814037134 3.6 TiB FD00 Linux RAID |
Latest revision as of 19:01, 31 October 2016
Software raid management under linux.
- look at healt of mirror.
mdadm --detail /dev/md127
- reattach device to raid device.
mdadm --manage /dev/md126 --re-add /dev/vdb1
- Add partition to raid device.
mdadm /dev/md127 --add /dev/vdb2
- Remove disk from raid device.
mdadm --manage /dev/md0 --fail /dev/sdc mdadm --manage /dev/md3 --remove /dev/vdd2
- If disk has been part of raid then wipe it.
mdadm --zero-superblock /dev/sdb3
- Create raid device.
mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/sda2 /dev/sdb2
- Create raid1 with one initial disk.
mdadm --create /dev/md1 --level=1 --raid-devices=2 missing /dev/vdd1
Remove raid device.
- Deactivate raid device.
mdadm --stop /dev/md2
- Once deactivated, remove the RAID device itself:
mdadm --remove /dev/md2
- Finally, zero superblocks on all devices that were associated with the particular array:
mdadm --zero-superblock /dev/md2
force sync disks
mdadm --readwrite /dev/md127
sgdisk
- Whiping partition.
sgdisk -oz /dev/sda
- copy non gpt disk layout.
sfdisk -d /dev/vda | sfdisk /dev/vdb
- Copy partition layout.
sgdisk --replicate=/dev/target /dev/source
- Create a new UID
sgdisk -G /dev/target
- Information about disk.
gdisk -l /dev/sda
Create partition to build mirrors on
sudo gdisk /dev/sdf n FD00 sudo gdisk -l /dev/sdf Number Start (sector) End (sector) Size Code Name 1 2048 7814037134 3.6 TiB FD00 Linux RAID