Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Mint ] disabling USB external drive spin off
New Posts  All Forums:Forum Nav:

[Mint ] disabling USB external drive spin off - Page 2

post #11 of 12
Since the power down is managed by hardware you could write a small user space script to keep the drive alive.

For example:
Code:
#!/bin/sh
while true; do
touch /path/to/mountpoint/nosleep
sync
rm /path/to/mountpoint/nosleep
sync
sleep 5m
done
Replace the mountpoint and sleep time with appropriate values. Something just shy of the spindown time is best to extend the life of the disk and lower the risk of file system corruptuon. The sync commands are there so the writes don't get saved to memory and never actually put on the drive. This will use 0bytes of free space since the write will occur in the MFT of the ntfs partition. Simply save it somewhere as keepalive.sh and chmod +x it. After doing that you have several options for running it. You can add it to your session as a startup application, add it as a systemd service, add it as a udev rule and have a second definition to kill it. The last is probably the best but also most difficult to implement. Note that without directing the log output this will fill some log with error messages when the disk isn't plugged in. I wrote it on a cellphone too so it might not be 100% correct either.
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
post #12 of 12
Thread Starter 
thanks, this looks useful smile.gif
The Creature
(15 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k Asus P8Z68 V-Pro Sapphire HD 7950 OC Boost 16Gb Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
OCZ Vertex3 6Gb/s + 2Tb Seagate GoFlex none Corsair H80 Linux LTS 64bit 
MonitorKeyboardPowerCase
Samsung SyncMaster BX2450 CoolerMaster Quickfire TK Corsair AX850 80+ Gold Corsair 600T Modded 
MouseMouse PadAudio
Steelseries Xai Steelseries HD E-Mu Tracker Pre USB 
  hide details  
Reply
The Creature
(15 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k Asus P8Z68 V-Pro Sapphire HD 7950 OC Boost 16Gb Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
OCZ Vertex3 6Gb/s + 2Tb Seagate GoFlex none Corsair H80 Linux LTS 64bit 
MonitorKeyboardPowerCase
Samsung SyncMaster BX2450 CoolerMaster Quickfire TK Corsair AX850 80+ Gold Corsair 600T Modded 
MouseMouse PadAudio
Steelseries Xai Steelseries HD E-Mu Tracker Pre USB 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Mint ] disabling USB external drive spin off