New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Auto mount drive on connect & and spindown on iddle

Got problems with your B2 or B3? Share and get helped!
Post Reply
janeks
Posts: 78
Joined: 15 Sep 2008, 02:02

Auto mount drive on connect & and spindown on iddle

Post by janeks »

Hi!

I have USB external hard drive that before I have Bubba was connected to my Win desktop PC. Now I connected them to Bubba without problem by using Admin Web interface.
But of course I would like to do that on reboot. So I found descriptions about automount.
But I would like to make it so that outomount also happens when I disk hardware is connected. In my case that disk is enough noisy - so I would like to switch them off and then switch back without touching admin web interface.
Probably another economich solution could be spin down on inactivity - is it possible on USB disks?
Last edited by janeks on 28 Sep 2008, 13:43, edited 1 time in total.
janeks
Posts: 78
Joined: 15 Sep 2008, 02:02

Post by janeks »

Found myself:

First make directory where your usb drive will be mounted. I made usb_h in /home/storage/extern
Give apropriate permissions by chmod.
Find your USB volume label:

Code: Select all

ls /dev/disk/by-label -lah
Add into /etc/fstab (f.ex. nano /etc/fstab) follwing line:

Code: Select all

LABEL=your_label   /home/storage/extern/usb_h      your_disktype    auto    0       0
But it works only for boot time, when HD is disconected or switched off then it does not automount.
andersos
Posts: 46
Joined: 18 Apr 2008, 04:23

Post by andersos »

you can use usbmount or ivman for automounting.
janeks
Posts: 78
Joined: 15 Sep 2008, 02:02

Post by janeks »

I am more looking now for some way how to auto spin down after some time that external USB HD. Then I could leave them untouched.
andersos
Posts: 46
Joined: 18 Apr 2008, 04:23

Post by andersos »

hdparm may be able to spin it down.
janeks
Posts: 78
Joined: 15 Sep 2008, 02:02

Post by janeks »

hdparm may be able to spin it down
Allready tried - unsuccesfuly.
:?
Gave some kind of incompatibility error.

Also tried one spindown utility - accepts command, but no result.

Now I am trying spindown from:
http://code.google.com/p/spindown/

But I hooked on makeing when got following problem:
make: g++: Command not found

But I have GCC...
janeks
Posts: 78
Joined: 15 Sep 2008, 02:02

How to correctly give permissions for attached USB drive

Post by janeks »

Hi!

How to correctly give permissions for attached USB drive?

Is it fstab, mount point or disk (/dev/sdb1)?

I tried permision commands on mount point but nothing happens when disk is mounted.

Now mu usb disk is readonly, but I would like also write access.

Thanks in advance!
janeks
Posts: 78
Joined: 15 Sep 2008, 02:02

Post by janeks »

Found already:
For my disk vfat in fstab there should be umask=000, f.ex.:
LABEL=your_label /home/storage/extern/usb_h your_disktype auto,umask=000 0 0
andersos
Posts: 46
Joined: 18 Apr 2008, 04:23

Post by andersos »

Yes. Spinning down usb disk can be hard. But there are disks that can be configured to spin down after f.ex. 15 minutes idleness. F.ex. Maxtor OneTouch 4 disks.
janeks
Posts: 78
Joined: 15 Sep 2008, 02:02

Spindown solved

Post by janeks »

Solved by using Spindown daemon from:
http://code.google.com/p/spindown/

Also from there I learn correct command for spinning down (at least for my Buffalo drive station external disk):

Code: Select all

 sg_start --stop /dev/sdb1
Note: This is good only for external HD, that you don't use frequently. Too often spindowns/ups will short life of your HD.
jcw
Posts: 12
Joined: 19 Aug 2007, 14:31

Post by jcw »

Thanks!

FWIW, I recently tried enabling the auto-spindown built into the kernel driver, but couldn't get it to work. Whereas "sg_start 0 /dev/sdb" works fine to spin down. Spin-up is automatic, i.e. on first access to the drive. Great.

Using just the sg_start command, you could even simply add a periodic crontab entry to spin disks down, e.g. at night.

-jcw
Post Reply