2021-05-17 16:41:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
format_disk() {
|
|
|
|
DISK="$1"
|
|
|
|
name="$2"
|
|
|
|
wipefs -a "$DISK"
|
|
|
|
end_position=$(sgdisk -E $DISK | tail -1)
|
|
|
|
sgdisk -n2:1M:$(( $end_position - (($end_position + 1) % 2048) )) -t2:BF01 $DISK
|
|
|
|
sgdisk -c2:"$name" $DISK
|
|
|
|
fdisk -l $DISK
|
|
|
|
}
|
|
|
|
|
|
|
|
format_disk /dev/sdi freenet1TB
|
|
|
|
format_disk /dev/sdj freenet80GB
|
|
|
|
format_disk /dev/sdk freenet80GB2
|
|
|
|
format_disk /dev/sdm freenet160GB
|
|
|
|
|
|
|
|
zpool create -O mountpoint=/freenet freenetpool freenet160GB freenet80GB freenet80GB2 freenet1TB
|
2021-12-27 17:23:22 +00:00
|
|
|
# zpool add freenetpool freenet100GB
|