Browse Source

Update syno_hdd_db.sh

v3.5.96
- Added option to set writemostly for your internal HDDs so DSM will normally read from your faster internal SSD(s).
    - It can automatically set DSM to read from your internal SSDs.
    - Or you can tell the script which internal drive(s) DSM should read from.
pull/325/head
Dave Russell 1 year ago
committed by GitHub
parent
commit
d874f14153
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      syno_hdd_db.sh

8
syno_hdd_db.sh

@ -1727,14 +1727,14 @@ set_writemostly(){
if [[ $ssd == "yes" ]]; then if [[ $ssd == "yes" ]]; then
# Get array of internal drives # Get array of internal drives
readarray -t internal_drives < <(synodisk --enum -t internal | grep 'Disk path') readarray -t internal_drives < <(synodisk --enum -t internal | grep 'Disk path' | cut -d"/" -f3)
if [[ $ssd_restore == "yes" ]]; then if [[ $ssd_restore == "yes" ]]; then
# Restore all internal drives to just in_sync # Restore all internal drives to just in_sync
echo -e "\nRestoring internal drive's state:" echo -e "\nRestoring internal drive's state:"
for idrive in "${internal_drives[@]}"; do for idrive in "${internal_drives[@]}"; do
#if ! grep -q "write_mostly"; then #if ! grep -q "write_mostly"; then
set_writemostly -writemostly "$(basename -- "$idrive")" set_writemostly -writemostly "$idrive"
#fi #fi
done done
@ -1743,7 +1743,7 @@ if [[ $ssd == "yes" ]]; then
echo -e "\nSetting slow internal HDDs state to write_mostly:" echo -e "\nSetting slow internal HDDs state to write_mostly:"
for idrive in "${internal_drives[@]}"; do for idrive in "${internal_drives[@]}"; do
if [[ ! ${ssds_writemostly[*]} =~ $idrive ]]; then if [[ ! ${ssds_writemostly[*]} =~ $idrive ]]; then
set_writemostly writemostly "$(basename -- "$idrive")" set_writemostly writemostly "$idrive"
fi fi
done done
@ -1769,7 +1769,7 @@ if [[ $ssd == "yes" ]]; then
# There are internal SSDs and HDDs # There are internal SSDs and HDDs
echo -e "\nSetting internal HDDs state to write_mostly:" echo -e "\nSetting internal HDDs state to write_mostly:"
for idrive in "${internal_hdds[@]}"; do for idrive in "${internal_hdds[@]}"; do
set_writemostly writemostly "$(basename -- "$idrive")" set_writemostly writemostly "$idrive"
done done
fi fi
fi fi

Loading…
Cancel
Save