Re-name
Shrink
Disk removal & cleanup
https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu-16-04
how-to , except use parted (not fdisk) to gpt-format disk(s) or gdisk.
cheat-sheet
email-alert
create (degraded) raid1, to transfer existing data :: ref_01
Tools
du -sh file_path
du command estimates file_path space usage
The options -sh are (from man du):
-s, --summarize
display only a total for each argument
-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)
sudo fdisk -l
or lsblk
mdadm -E /dev/sd[x,y]
parted /dev/sd(x)
mklabel gpt
print free
mkpart primary 1M 3001GB
This starts the partition at 1M offset giving a 4096 byte alignment. This may or may not be necessary, but won’t hurt if its not.p
#displays partition setupq
#quitsudo mdadm --create --verbose /dev/md0 --level=raid1 --raid-devices=2 /dev/sd(x#) missing
sudo mkfs.ext4 /dev/md0
sudo mkdir -p /storage/share
mount /dev/md0 /mnt/zero
rsync -avhW --progress --no-compress /src/ /dst/
sudo mount /mnt/md0
mdadm --detail --scan --verbose >> /etc/mdadm.conf
/dev/md0 /storage/share auto defaults 0 0
cat /proc/mdstat
sudo blkid /dev/md0
UUID=4a2b3c6d-0ada-4228-8043-7a2f40a13d4a /storage/share auto defaults 0 0
perform 1a through 2f on the old (3tb wd black)
mdadm /dev/md0 --add /dev/sd(y#)
mdadm --detail --scan --verbose >> /etc/mdadm.conf
watch -n1 sudo mdadm --detail /dev/md0
cat /proc/mdstat
sudo mdadm /dev/md0 --fail --remove /dev/sdb1
sudo mdadm --stop md0
wipefs -a /dev/sd(x#)
watch -n1 cat /proc/mdstat
mdadm --grow /dev/md# --size [size+]
mdadm --grow /dev/md# -z max
resize2fs /dev/md#
shrink filesystem: resize2fs to-size
shrink (reshape) raid vol: mdadm –grow
shrink partition by delete/recreation: gdisk
Helps to communicate array purpose/function/intent.
Links the array to /dev/md/newname
, and applies newname
to its listing in yast and elsewhere.
unmount, then stop the array
umount /dev/md#
mdadm --stop /dev/md#
or mdadm --stop --scan
Define & use “newname”
mdadm --assemble /dev/md/newname --name=newname --update=name /dev/sd[xy]#
edit /etc/mdadm.conf; change oldname
to newname
Make persistent across reboots
dracut -f
This is somewhat faster, but forfeits grub-rollbacks (thumbs-down).
System (root) on a raid-0 volume seems to have exposed a limitation of the Dell optiplex 3010 UEFI firmware.
Corresponding efi and boot partitions are expected to be on the same physical disk.
If the root is on soft-raid0, then /boot may need to be on a separate partition, because of firmware limitations similar to that experienced above.
EFI and /boot cannot share a partition because EFI needs to have a ‘FAT’ filesystem, and ‘/boot’ needs a posix compliant filesystem (which ‘FAT’ is NOT).
Config used:
partition | sdX | sdY | raid-0 |
---|---|---|---|
1 | 260M [FAT] /boot/efi | 260M | - |
3 | 500M [XFS] /boot | 500M | - |
4 | 20G -> | 20G -> | [Btrfs] / |
5 | remainder -> | remainder -> | [XFS] /home |
2 | 2G -> | 2G -> | [swap] |