Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: Jean-Philippe Pialasse on January 29, 2007, 06:31:48 PM

Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on January 29, 2007, 06:31:48 PM
Here is a new contrib to manage your usb disks thanks to the server manager.

your disk must already have been partitioned and formated, with a UUID.

wget http://mirror.contribs.org/smeserver/contribs/jppialasse/SME7/usbdisksmanager/smeserver-usbdisksmanager-0.2-0.1.noarch.rpm
or alternate
wget http://www.pialasse.com/RPMS/smeserver-usbdisksmanager-0.2-0.1.noarch.rpm

yum localinstall smeserver-usbdisksmanager-0.2-0.1.noarch.rpm

you will be able to add a mount point for each partition and the contrib will do the mount every time it is plugged. and to auto mount drives when pluged in your media directory.

/!\ firewire can be supported if you have a kernel that allow it (the one from centos is not fully compliant)

JPP

waiting for your informations

/edit/
new release 0.2-0.1
using yum to install
Title: Re: [BETA] usbdisks manager
Post by: cactus on January 29, 2007, 10:53:28 PM
Quote from: "unnilennium"
rpm -Uvh http://www.pialasse.com/RPMS/smeserver-usbdisksmanager-0.1-0.3.noarch.rpm
Please do not use rpm to install as SME Server uses yum by default.[list=1]
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on January 31, 2007, 11:14:49 PM
new release :

wget http://www.pialasse.com/RPMS/smeserver-usbdisksmanager-0.1-0.5.noarch.rpm
yum localinstall smeserver-usbdisksmanager-0.1-0.5.noarch.rpm
Title: [Announce] usbdisks manager
Post by: Franco on February 01, 2007, 04:50:22 AM
Could I use this same contrib to manage firewire disks?  :?
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on February 01, 2007, 01:16:20 PM
As i have no fire wire disk for the moment i have not tested; but you should test.

Tell me if it works, if yes it's perfect, if no i 'll ask you some information to add the support :

what is the result of :
Code: [Select]
/usr/bin/udevinfo -a -p /sys/block/sda
(if the partition you want to manage is /dev/sda1)

I need the first lines like this:

Quote
follow the class device's "device"
  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/host2/target2:0:0/2:0:0:0':
    BUS="scsi"
    ID="2:0:0:0"

this example is from a usb disk
Title: [Announce] usbdisks manager
Post by: Mjohnson on February 03, 2007, 04:53:18 PM
Works great.  Thanks for the contribution.
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on February 04, 2007, 04:29:56 PM
release 0.5

added FireWire support
some littles things corrected
added help page


There's a known issue to add UUID to a disk which has no UUID: it seems impossible through the manager nothing happen. so it is assumed that usb drive are well formatted with you label and UUID set and unique .


wget http://www.pialasse.com/RPMS/smeserver-usbdisksmanager-0.1-0.5.noarch.rpm

yum localinstall smeserver-usbdisksmanager-0.1-0.5.noarch.rpm
Title: [Announce] usbdisks manager
Post by: nitrouze on March 03, 2007, 12:18:44 PM
Hi,

First, merci for the contrib  :wink:

Can I suggest to add mounting options to the db and panel as some specific options might be needed by other contribs (ie suid for apache ...) ?
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on March 03, 2007, 01:14:51 PM
yes this a great idea.
I was planning on making a new release with auto mount for the /media folder as it is often asked. It another good thing you suggest.


Can you explain exactly what option would be needed to you.

JPP
Title: [Announce] usbdisks manager
Post by: nitrouze on March 03, 2007, 02:04:22 PM
As more and more contribs, especially backups ones, are depending on "external drives", what about adding a "mount option" to the panel to set the -o options of mount ...

- The default (no user input) could be "defaults" which should be ok for most of us (even if it's very permissive !)

- Specific needs for mounting could be set there according to mount -o syntax.

Quick exemple:
I'm using backuppc contrib via an usb drive mounted to /opt/backuppc, it needs "suid" option for web interface to work properly, so I add to manually modify your perl script to replace ...

#my $mount=`/bin/mount $dev -t auto $dest -o pamconsole,exec,noauto,managed`;

with ...

my $mount=`/bin/mount $dev -t auto $dest -o defaults`;

but it could preferably be ...

my $mount=`/bin/mount $dev -t auto $dest -o $DEFINED_MOUNT_OPTIONS`;

Another idea could be to use the label of the partition to try to guess its role (identified contrib ?) and its mount options need.
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on March 03, 2007, 02:18:15 PM
what do you think about to guess it by searching the guid and uid of the destination folder and giving to the mount the same uid option ?

+ some personal option thanks to the panel.


JP
Title: [Announce] usbdisks manager
Post by: nitrouze on March 03, 2007, 05:38:55 PM
It seems quite difficult to guess who's owning the share as the uid/guid 's mount point aren't representative enough.

/opt/backuppc being the mount point ...
ls -ld /opt/backuppc/
drwxr-xr-x  9 root root 4096 Mar  2 18:59 /opt/backuppc/
but once drive is mounted ...
ls -ld /opt/backuppc/*
drwxr-xr-x  10 backuppc backuppc  4096 Feb 26 16:00 /opt/backuppc/files

In that case, you won't be able to guess the correct owner. :?

Additionaly, several users might share the same "usb volume" and this is why the suid is so helpfull.

Same problem with fstab, as it has no clue of what params/ownership to give to the partition.

The easiest way is probably the "personal options" within panel/db.
Title: [Announce] usbdisks manager
Post by: okepc on March 05, 2007, 09:39:18 AM
What about a panel addon that you give the option to mount cifs,samba etc. shares over the network?

Would be a nice addon

And call it Smeserver-Mountmanager  8)

Dirk
Title: [Announce] usbdisks manager
Post by: Confucius on March 23, 2007, 01:17:09 AM
Is it maybe usefull to have a "prop" in confusbdisks that is considering quota's? Something like :

QuotaOn|yes

During boot the quota files will be build when they don't exist so that's not a real concern to worry about (AFAIK). Main problem is that it needs to be added to the mount options and now it seems not possible to do this.

I managed to deal with this to manually make a mount in fstab to another location and get quota's active but this is ofcourse not the most dynamic way. And dynamics is what we are looking for I think.

Harro
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on April 08, 2007, 11:41:40 PM
to Nitrouze:

next release will try to support such setting : uid and gid for auto "mount_to"



to okepc:


Yes it would be nice,but at the moment i would like to perfect this tool for removable drive.

to Confucius:

everytime i try to manage quota on a removable drive i just fail can you make me a short but complete how to ?


in a few days a new release ...


JP
Title: [Announce] usbdisks manager
Post by: Confucius on April 09, 2007, 01:13:03 AM
As far as I remember I had more difficulty formatting the disk than hooking it up with quota's.

Current situation :

once mounted using the USB manager
once mounted by adding a different mountpath in /etc/fstab with parameters : usrquota,grpquota

As mentioned earlier; this was enough to make it come back "quotad" after a reboot. Might be that a re-mount could do the trick aswell. Didn't try that 1.

I had trouble to find out how your mounting scheme works for tampering with the options.

Harro
Title: [Announce] usbdisks manager
Post by: Confucius on April 09, 2007, 02:07:33 AM
Wanted to make sure that I gave the right information... failed...

but went on...

Took quota files from the disk, restarted server... resulting in an error during boot. No recreated quota files.

successfull steps:

touch /dev/sda1/aquota.user
touch /dev/sda1/aquota.group

chmod 600 /dev/sda1/aquota.user
chmod 600 /dev/sda1/aquota.group

mount -o remount /dev/sda1

quotacheck -vgum /dev/sda1

Took a while to round it up because of : quotacheck: Checked 3074 directories and 45373 files ... but after that it was back to normal again.

Didn't see the information in the server-manager tho... went on..

quotaoff /dev/sda1
quotacheck /dev/sda1
quotaon /dev/sda1

And back on track, as if nothing ever was demolished...

Hope this might be more usefull...

Another hint: SME can be installed with the option "noquota" when I remember right (too lazy to verify spelling) so your module should also comply with this maybe. When that option has been used it shouldn't ask if the "manager" wants to have quota's on the disk(s). I guess this can be verified by checking for the existence of quota files on the main disk.

Harro
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on April 09, 2007, 11:28:34 PM
And "Voila" ,

smeserver-usbdisksmanager 0.2 is released.

-added support for auto mount of drives inside media directory to the folder auto created

- added how to format my hard drive

- added mount options for the mount to (this will help for some applications).

wget http://mirror.contribs.org/smeserver/contribs/jppialasse/SME7/usbdisksmanager/smeserver-usbdisksmanager-0.2-0.1.noarch.rpm
or alternate
wget http://www.pialasse.com/RPMS/smeserver-usbdisksmanager-0.2-0.1.noarch.rpm

yum localinstall smeserver-usbdisksmanager-0.2-0.1.noarch.rpm

it can help to initialize quota, but i have not enought time to test it

JPP

PS: thanks Confucius for theses informations
Title: [Announce] usbdisks manager
Post by: Confucius on April 10, 2007, 02:16:05 PM
Ehmmmmm JPP..

I think there are a few minor issues that need more inspection:

WARNING in /etc/e-smith/templates//etc/crontab/usbdisks: Use of uninitialized value in string eq at /etc/e-smith/templates//etc/crontab/usbdisks line 19.
WARNING: Template processing succeeded for //etc/crontab: 1 fragment generated warnings
 at /sbin/e-smith/expand-template line 45

Harro
Title: [Announce] usbdisks manager
Post by: Confucius on April 10, 2007, 02:31:11 PM
Looks like you also forgot to put the status on enabled in the configuration or do I make a silly statement now because I never noticed this before ?
Title: [Announce] usbdisks manager
Post by: Confucius on April 10, 2007, 03:38:10 PM
JP,

I would like to think along but you have a lot on french. Would be nice when you put most on english so I can understand it better. Translation does help a little but still some things stay blurry to me.

When you have time, please consider this because I think there is enough potential in this module.

Harro
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on April 10, 2007, 04:50:18 PM
Yes I must advise that the module disable everytime you update this.

I know this is irritating but it is a safe way i thing to avoid bad mounting.

(I irritated the same way when I update the awstats contrib and i need to activate it again)


Sorry for the french in the source code.
And even for a french it might not be of a great utility as it is like a code :)
For the next version i will translate the comments.
Title: [Announce] usbdisks manager
Post by: Confucius on April 10, 2007, 04:54:22 PM
JP,

Another addition. It works pretty perfect this way... BUT.. to get quota's active it's needed (after each mount or reboot) to make clear that quota's should be ON for that specific disk. Maybe you see an option to add the command "quotaon /dev/sdX" when the actual mounting is done (and ofcourse either grpquota or usrquota (or both) is in the options) ?

Now I do that manually and seems to work good. Without that command the quota's show as zero's...

Harro
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on April 10, 2007, 05:40:30 PM
yes it could be transparent to add in the bash script and in teh perl script to execute thsi commande if the mount options contain grpquota or usrquota (or both) .

it is just a regular expression to do.

need to add this next week end.
Title: [Announce] usbdisks manager
Post by: progitto on May 17, 2007, 08:48:49 AM
Thank for this nice contribs!!
I have one question: I want save in a .txt file the list of the files of the removable disk on mount or auto-mount. I suppose that I have to add something like
Code: [Select]
ls [my_mount_position] -lRsh > /home/e-smith/files/ibays/primary/list.txt
in usr/sbin/usbdisks.sh.
The problem is that I can't understand where I have to do this ...  :oops:
Some tips for me?
Thanks
Title: [Announce] usbdisks manager
Post by: Jean-Philippe Pialasse on August 01, 2007, 01:56:18 AM
sorry for the long time before the answer, i guess you have found alone :

I would install it in the usr/sbin/usbdisks.sh.
for every disk that are not known:
after the mount $repertoire  in line 128

if you want this for the mount_to defined disk
after the mount commande line 51

if you want for known disk auto mount iin media:
after the mount line 86

that make me think about a pre / post custom command  for each drives.... to add in the contrib