Skip to content

Commit

Permalink
spindownall remove ssd nvme disk
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanhao committed Jun 26, 2022
1 parent 29a32e0 commit 9598d34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hdspindown
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if [ -f $LOCKFILE ]; then
fi
if [ ! -f /sbin/hdparm ];then
apt-get -f install hdparm
fi
fi
if [ ! -f $LOGFILE ];then
touch $LOGFILE
fi
fi
touch $LOCKFILE

DATE=`date`
Expand Down
5 changes: 3 additions & 2 deletions spindownall
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
#disks=`ls /dev|grep sd'[a-z]*$'`
disks=`ll /dev/disk/by-id/|grep -v 'part'|grep -v 'SSD'|grep -v 'nvme'|grep -v 'wwn'|awk -F '/' 'NR>1{print "/dev/"$NF}'`
disks=`ls -l /dev/disk/by-id/|grep -v 'part'|grep -v 'SSD'|grep -v 'nvme'|grep -v 'wwn'|awk -F '/' 'NR>1{print $NF}'`
if [ ! -f /usr/bin/hdspindown ];then
cp ./hdspindown /usr/bin/
fi
for i in $disks;
do
hdspindown $i;
echo $i
hdspindown $i
done

0 comments on commit 9598d34

Please sign in to comment.