Skip to content

Commit

Permalink
Merge pull request #164 from 007revad/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
007revad committed Jul 3, 2024
2 parents 06dd8f1 + 588b27a commit d3a470d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 44 deletions.
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v2.0.28
- v2 and later are for DSM 7 only.
- For DSM 6 use v1 without the auto update option.
- Added Patriot vendor id.
- Now enables m2 volume support before creating the storage pool to hopefully prevent Issue #163
- Added better error checking to hopefully prevent Issue #163

v2.0.27
- v2 and later are for DSM 7 only.
- For DSM 6 use v1 without the auto update option.
Expand Down
90 changes: 46 additions & 44 deletions syno_create_m2_volume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# mdisk array contains list of selected nvme#n#


scriptver="v2.0.27"
scriptver="v2.0.28"
script=Synology_M2_volume
repo="007revad/Synology_M2_volume"
scriptname=syno_create_m2_volume
Expand Down Expand Up @@ -780,49 +780,6 @@ read -r answer
if [[ ${answer,,} != "yes" ]]; then exit; fi


#--------------------------------------------------------------------
# Create storage pool on selected M.2 drives

# Single volume storage pool (DSM 6 style pool on md#)
# synostgpool --create -t single -l basic /dev/nvme0n1
# synostgpool --create -t single -l raid5 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1

# Multiple volume storage pool (DSM 7 style pool on vg#)
# synostgpool --create -l basic /dev/nvme0n1
# synostgpool --create -l raid5 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1


partargs=( )
for i in "${mdisk[@]}"; do
:
partargs+=(
/dev/"${i}"
)
done

if [[ $pooltype == "single" ]]; then
# Unset existing arguments
while [[ $1 ]]; do shift; done
# Set -t single arguments
set -- "$@" "-t"
set -- "$@" "single"
fi


echo -e "\nStarting creation of the storage pool."
if [[ $drivecheck != "yes" ]]; then
if ! synostgpool --create "$@" -l "$raidtype" "${partargs[@]}"; then
echo "$? synostgpool failed to create storage pool!"
exit 1
fi
else
if ! synostgpool --create "$@" -l "$raidtype" -c "${partargs[@]}"; then
echo "$? synostgpool failed to create storage pool!"
exit 1
fi
fi


#--------------------------------------------------------------------
# Enable m2 volume support - DSM 7.1 and later only

Expand Down Expand Up @@ -904,6 +861,51 @@ if [[ $raidtype == "raid_f1" ]]; then
fi


#--------------------------------------------------------------------
# Create storage pool on selected M.2 drives

# Single volume storage pool (DSM 6 style pool on md#)
# synostgpool --create -t single -l basic /dev/nvme0n1
# synostgpool --create -t single -l raid5 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1

# Multiple volume storage pool (DSM 7 style pool on vg#)
# synostgpool --create -l basic /dev/nvme0n1
# synostgpool --create -l raid5 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1


partargs=( )
for i in "${mdisk[@]}"; do
:
partargs+=(
/dev/"${i}"
)
done

if [[ $pooltype == "single" ]]; then
# Unset existing arguments
while [[ $1 ]]; do shift; done
# Set -t single arguments
set -- "$@" "-t"
set -- "$@" "single"
fi


echo -e "\nStarting creation of the storage pool."
if [[ $drivecheck != "yes" ]]; then
synostgpool --create "$@" -l "$raidtype" "${partargs[@]}"
if [[ $? -gt "0" ]]; then
echo "$? synostgpool failed to create storage pool!"
exit 1
fi
else
synostgpool --create "$@" -l "$raidtype" -c "${partargs[@]}"
if [[ $? -gt "0" ]]; then
echo "$? synostgpool failed to create storage pool!"
exit 1
fi
fi


#--------------------------------------------------------------------
# Notify of remaining steps

Expand Down

0 comments on commit d3a470d

Please sign in to comment.