Skip to content

Instantly share code, notes, and snippets.

@henriqueutsch
Last active July 31, 2018 04:33
Show Gist options
  • Save henriqueutsch/f43de34f1196e30dfded7aa79f78bb36 to your computer and use it in GitHub Desktop.
Save henriqueutsch/f43de34f1196e30dfded7aa79f78bb36 to your computer and use it in GitHub Desktop.
Mount Driver
#sudo nano /etc/init.d/mountdrivers.sh
if [[ ! -z `mount | grep "on /media/TimeMachine type hfsplus (ro,"` ]]
then
echo "Reparando disco /media/TimeMachine em /dev/sda1"
sudo umount -l /dev/sda1
sudo fsck.hfsplus -drfy /dev/sda1
sudo mount -a
echo `mount | grep "on /media/TimeMachine type hfsplus (rw,"`
else
echo "Drive /media/TimeMachine montado corretamente"
fi
if [[ ! -z `mount | grep "on /media/Backup type hfsplus (ro,"` ]]
then
echo "Reparando disco /media/Backup em /dev/sda2"
sudo umount -l /dev/sda2
sudo fsck.hfsplus -drfy /dev/sda2
sudo mount -a
echo `mount | grep "on /media/Backup type hfsplus (rw,"`
else
echo "Drive /media/Backup montado corretamente"
fi
if [[ ! -z `mount | grep "on /media/Drive5T type hfsplus (ro,"` ]]
then
echo "Reparando disco /media/Drive5T em /dev/sdb2"
sudo umount -l /dev/sdb2
sudo fsck.hfsplus -drfy /dev/sdb2
sudo mount -a
echo `mount | grep "on /media/Drive5T type hfsplus (ro,"`
else
echo "Drive /media/Drive5T montado corretamente"
fi
#sudo chmod +x /etc/init.d/mountdrivers.sh
#sudo crontab -e
[@root](http://twitter.com/root) /etc/init.d/mountdriver.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment