mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-27 23:14:04 +00:00
changing disk type check
update code with case statement...
This commit is contained in:
parent
a032f5c9c9
commit
e03f33c4c8
|
@ -64,12 +64,23 @@ if [ ! -f /var/lib/mynode/.expanded_rootfs ]; then
|
|||
X86_ROOT_PARTITION="$(mount | grep ' / ' | cut -d ' ' -f1)"
|
||||
X86_DEVICE="$(lsblk -no pkname $X86_ROOT_PARTITION)"
|
||||
X86_DEVICE_PATH="/dev/$X86_DEVICE"
|
||||
case "$X86_DEVICE" in
|
||||
sd* | hd* | vd*)
|
||||
# SATA
|
||||
X86_PARTITION_NUMBER=$(cat /proc/partitions | grep -c "${X86_DEVICE}[0-9]")
|
||||
;;
|
||||
nvme*)
|
||||
# NVMe
|
||||
X86_PARTITION_NUMBER=$(cat /proc/partitions | grep -c "${X86_DEVICE}p[0-9]")
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ $X86_DEVICE = "sda" ]; then
|
||||
# SATA
|
||||
X86_PARTITION_NUMBER=$(cat /proc/partitions | grep -c "${X86_DEVICE}[0-9]")
|
||||
|
||||
else
|
||||
# NVMe
|
||||
X86_PARTITION_NUMBER=$(cat /proc/partitions | grep -c "${X86_DEVICE}p[0-9]")
|
||||
|
||||
fi
|
||||
X86_FDISK_TYPE=$(fdisk -l "$X86_DEVICE_PATH" | grep "Disklabel")
|
||||
echo "Root Partition: $X86_ROOT_PARTITION"
|
||||
|
|
Loading…
Reference in New Issue
Block a user