I have literally enough of things not working correctly
Don't know if it's me - a newbie in Linux world, or just being unlucky, however I do have an issue which keeps bothering me so badly, that I am almost going mad with it
Anyway - I do have Raspberry Pi 1 model B (700MHz, 512MB RAM) to which I have a lot of USB hard drives connected through powered USB hubs. I have managed to resolve issues with backpower feed and power issues, my raspberry Pi runs flawleslly in the point of view of stability and being a reliable piece of hardware.
The problem is that from time to time, some of my USB hard drives go into the sleep mode (?), which means that once per week, or once per month, I do have an USB drive which becomes unavailable for the NAS share.
My smb.conf file is more or less like this:
Code: Select all
[Archive]
comment = Archive
path = /media/Archive
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no
Code: Select all
UUID=2298CD8598CD5845 /media/Archive ntfs-3g defaults 0 0
Also ntfs-3g is installed and my samba share works fine, until this particular HDD will decide that "I am tired and I am going to sleep".
I am not 100% sure if Raspberry Pi (debian/linux) is capable of auto-mounting the ntfs drives on a re-connect, I was under impression that Ubuntu does it this way, however I don't know about any official solutions for this.
And now what I have done so far.
All my script files are being held on external HDD called "Intenso" which doesn't go offline because in 99% of time is in use.
Using crontab -e I have scheduled a task which runs every hour.
Script has been set to be executable and checks if directories do exist and if don't, it will run command sudo mount -a and next should send me a text message with a python script file.
Code: Select all
DIRECTORY1=/media/MSI/Karaoke
DIRECTORY2=/media/Archive/Kindle
if [ ! -d "$DIRECTORY1" ]; then
sudo mount -a
sudo python /media/Intenso/Raspberry_Pi/Send_SMS.py 'MSI drive reconnected'
fi
if [ ! -d "$DIRECTORY2" ]; then
sudo mount -a
sudo python /media/Intenso/Raspberry_Pi/Send_SMS.py 'Archive drive reconnected'
fi
a) is there any better way to keep those disks alive? What I mean, anyone know if there is any auto - mounted back feature?
b) anyone could help me out why the script does not work? I have a feeling that I have missed something elementary and the script does not execute the "sudo python /media/Intenso/Raspberry_Pi/Send_SMS.py 'Archive drive reconnected'" part