You are not logged in.

#76 2009-10-03 21:41:10

kenshis
Member
Registered: 2008-12-16
Posts: 52

Re: A very lightweight volume manager

Great utility, but need little dirty hack. I need that skvm would mount device, with  *specific* label box2  on existing /media/box2 directory.
  I need it, because i have big external hard, where i hold all arch packages, but often download packages into internal hard to /media/box2. Then i trow everything to external hard, mount it on /media/box2 and pacman is hapy smile

Offline

#77 2009-10-04 01:08:49

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: A very lightweight volume manager

kenshis wrote:

Great utility, but need little dirty hack. I need that skvm would mount device, with  *specific* label box2  on existing /media/box2 directory.
  I need it, because i have big external hard, where i hold all arch packages, but often download packages into internal hard to /media/box2. Then i trow everything to external hard, mount it on /media/box2 and pacman is hapy smile

Try to use e2label to change the label of your external drive so that skvm can pick up the label and use it as a mount point.

Last edited by dimigon (2009-10-04 01:09:01)

Offline

#78 2009-10-04 10:53:29

kenshis
Member
Registered: 2008-12-16
Posts: 52

Re: A very lightweight volume manager

Sorry, i wasn't clear enough. External hard has label "box2", and it works as it should.
But, because, /media/box2 already exists, (there are stored local arch packages), program creates /media/sdd1. If i delete /media/box2, skvm mounts external hard on /media/box2.

I need that it  *over mount my external hard with specific label box2* on /media/box2, like with simple mount command (but for all others devices, it should work as it works now). I need to add *exception for label "box2"*
Then, when i unmount external hard, on system would remain local arch packages.

Offline

#79 2009-10-04 11:47:27

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: A very lightweight volume manager

kenshis wrote:

Sorry, i wasn't clear enough. External hard has label "box2", and it works as it should.
But, because, /media/box2 already exists, (there are stored local arch packages), program creates /media/sdd1. If i delete /media/box2, skvm mounts external hard on /media/box2.

I need that it  *over mount my external hard with specific label box2* on /media/box2, like with simple mount command (but for all others devices, it should work as it works now). I need to add *exception for label "box2"*
Then, when i unmount external hard, on system would remain local arch packages.

I've hacked together your request. Replace the get_mount_point function in the original skvm code with the one shown below.

static char *
get_mount_point(const char *dev, const char *label)
{
    const char *extra;
    char *mountp, *dev_tmp;
    size_t len;
    struct dirent *dirent;
    DIR *dir;

    /* ** hack begins ** */
    if (!strcmp(label, "box2")) {
        len = strlen("/media/box2") + 1;
        mountp = malloc(len);
        if (!mountp)
            goto err;
        snprintf(mountp, len, "/media/box2");
        return mountp;
    }
    /* ** hack ends ** */

err:
    if (!is_mounted(dev) || !(dev_tmp = strrchr(dev, '/')))
        return NULL;

    ++dev_tmp;
    len = strlen(dev_tmp) + 1 + strlen(BASE_MNT_DIR);
    extra = dev_tmp;
    if (label && strcmp(label, "")) {
        if ((dir = opendir(BASE_MNT_DIR))) {
            dirent = readdir(dir);
            while (dirent) {
                if (!strcmp(dirent->d_name, label))
                    goto out;
                dirent = readdir(dir);
            }
        }

        len = strlen(label) + 1 + strlen(BASE_MNT_DIR);
        extra = label;
    }

out:
    mountp = malloc(len);
    if (mountp)
        snprintf(mountp, len, "%s%s", BASE_MNT_DIR, extra);
    return mountp;
}

Make sure you do not have a rule in /etc/fstab for this particular volume, because subsequent code in skvm will alter the mount point selected at this point. As it stands at the moment when ejecting the volume skvm will try to rmdir the directory, if it is not empty it will create a syslog entry. I am sure that is not a problem to you, but if it is then you can just alter the function device_removed(...) to exclude the call to rmdir.

Last edited by dimigon (2009-10-04 12:07:21)

Offline

#80 2009-10-09 19:14:58

abursuk
Member
From: Ukraine, Sumy
Registered: 2009-09-25
Posts: 1
Website

Re: A very lightweight volume manager

Hello!

I've compiled skvm from AUR(version 0.1), add "skvm" to my rc.conf, then reboted few times, but it did not do anythings.
Before that, i've tryed some other programs for same purposes, but no one couldnot helped.
Help me pls, give some advicec maybe... and sorry for my poor English smile

my mp3 player is recognized as well, but usb flash drive - not...


ADD:
I decide this problem with my own.

Thank you for making so usefull program.:)

Last edited by abursuk (2009-10-09 20:06:30)


Linux in my heart

Offline

#81 2009-10-22 17:54:12

webframp
Member
Registered: 2008-11-15
Posts: 35
Website

Re: A very lightweight volume manager

this is great, skvm is exactly what I've been looking for.

Offline

#82 2009-10-22 21:34:04

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: A very lightweight volume manager

@dimigon:

Just tried skvm because PCManFM and Thunar were giving me some grief and skvm has worked beautifully for all the devices I have accessed so far. Many thanks for all your hard work on this incredibly useful daemon.

PS: I am using emelFM2 to access the mount points and unmount the devices.

Offline

#83 2009-10-22 22:07:53

tvale
Member
From: Portugal
Registered: 2008-12-11
Posts: 175

Re: A very lightweight volume manager

First of all, thanks a lot for your work!

I try to automount with udev/hal, but I have this problem. Unfortunately, your program is not different. The mounted directory under /media is also owned by user and group root. Therefore as a normal user I cannot do anything on it.

Any thoughts?

Offline

#84 2009-10-29 13:07:54

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: A very lightweight volume manager

Nice work! This is really a super volume manager you've made here.

Of course after that kind of start, this message can only contain a feature request smile

And here it comes:
Is it possible to listen for a eject-cd event from the dvd drive and then unmount and eject the disc? This would make it a bit more intuitive to use for cd-/dvd-roms.
Most people reach for the eject button on their dvd drives without even thinking about it wink

I tried looking at the source code, but I'm afraid it's a bit beyond my abilities.


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#85 2009-10-29 15:39:17

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: A very lightweight volume manager

madeye wrote:

Nice work! This is really a super volume manager you've made here.

Of course after that kind of start, this message can only contain a feature request smile

And here it comes:
Is it possible to listen for a eject-cd event from the dvd drive and then unmount and eject the disc? This would make it a bit more intuitive to use for cd-/dvd-roms.
Most people reach for the eject button on their dvd drives without even thinking about it wink

I tried looking at the source code, but I'm afraid it's a bit beyond my abilities.

What if you load the cdrom driver without tray locking?

Offline

#86 2009-10-29 16:00:11

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: A very lightweight volume manager

dimigon wrote:

What if you load the cdrom driver without tray locking?

That would be worth a try. But... Ehm... How do I load it without tray locking? roll


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#87 2009-10-29 16:20:15

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: A very lightweight volume manager

madeye wrote:
dimigon wrote:

What if you load the cdrom driver without tray locking?

That would be worth a try. But... Ehm... How do I load it without tray locking? roll

modinfo cdrom

Offline

#88 2009-10-29 17:25:00

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: A very lightweight volume manager

dimigon wrote:

modinfo cdrom

Running modinfo cdrom gives me the following:

filename:       /lib/modules/2.6.31-ARCH/kernel/drivers/cdrom/cdrom.ko
license:        GPL
depends:        
vermagic:       2.6.31-ARCH SMP preempt mod_unload 
parm:           debug:bool
parm:           autoclose:bool
parm:           autoeject:bool
parm:           lockdoor:bool
parm:           check_media_type:bool
parm:           mrw_format_restart:bool

I then changed my modules.conf file to this:

#
# /etc/modprobe.d/modprobe.conf (for v2.6 kernels)
#
options cdrom lockdoor=false

I restarted the computer, as a modprobe -r was not possible.
It doesn't work though. I am afraid I'm not smart enough to figure out how it's supposed to be done.

Can you give me a hint here?


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#89 2009-10-29 19:17:12

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: A very lightweight volume manager

I did the following and I got it to work.

rmmod sr_mod
rmmod cdrom
modprobe cdrom lockdoor=0
modprobe sr_mod

Last edited by dimigon (2009-10-29 21:30:54)

Offline

#90 2009-10-29 19:45:25

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: A very lightweight volume manager

Thanks! That worked like a charm.
I just had to used lockdoor=0 in modprobe.conf. Figures! I knew I had done something stupid smile


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#91 2009-10-29 20:06:53

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: A very lightweight volume manager

madeye wrote:

Thanks! That worked like a charm.
I just had to used lockdoor=0 in modprobe.conf. Figures! I knew I had done something stupid smile

Good! Nevertheless, keep in mind that ejecting drives that are being worked at is not safe.

Offline

#92 2009-11-14 00:54:38

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: A very lightweight volume manager

sad Don't know what's happened exactly, but after today's pacman -Syu, skvm will only mount VFAT USB flash drives for me as root; users don't have write permission. (ext2/3 formatted devices seem okay however.) Tried tinkering (for example, adding umask and dmask parameters) with the #define DEFAULT_MNT_OPTIONS "noexec,nosuid,nodev,users" in skvm.c to no avail. Another computer, essentially identical but with slightly older versions, still has skvm working with VFAT drives as expected. Hal or dbus upgrades maybe responsible?

However, PCManFM and emelFM2 can mount the drives fine!

Offline

#93 2009-11-14 15:41:51

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: A very lightweight volume manager

ninian wrote:

sad Don't know what's happened exactly, but after today's pacman -Syu, skvm will only mount VFAT USB flash drives for me as root; users don't have write permission. (ext2/3 formatted devices seem okay however.) Tried tinkering (for example, adding umask and dmask parameters) with the #define DEFAULT_MNT_OPTIONS "noexec,nosuid,nodev,users" in skvm.c to no avail. Another computer, essentially identical but with slightly older versions, still has skvm working with VFAT drives as expected. Hal or dbus upgrades maybe responsible?

However, PCManFM and emelFM2 can mount the drives fine!

I've no idea. Mine seems to work okay.

Offline

#94 2009-11-14 17:35:07

shpelda
Member
Registered: 2008-08-07
Posts: 59

Re: A very lightweight volume manager

dimigon, why are you not using http://aur.archlinux.org/packages.php?ID=24244 ?

Offline

#95 2009-11-14 22:44:54

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: A very lightweight volume manager

@dimigon:

Thanks for the email. I'm running 32-bit Arch on 32-bit systems.

Just checked what happens on my Eee PC, which has the older hal 0.5.13-2 and dbus 1.2.14-1:
I load up emelfm2 and look at the /media directory; I plug in my VFAT-formatted USB flash drive and it appears as /media/UDISK, owned by root/root with permissions drwxrwxrwx. Then I successfully create a test file on the drive which shows as owned by root/root, but with permissions -rwxr-xr-x, so therefore I can't delete the file as user!

So, it looks as though there are some odd things happening with VFAT drives even before the latest hal and dbus updates. Curiouser and curiouser; hope I'm not doing something gross ... hmm

PS: It's not just one USB flash drive which is problematic - I have several to test, some brand new.

Offline

#96 2009-11-15 17:54:01

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: A very lightweight volume manager

From playing around with DEFAULT_MNT_OPTIONS in skvm.c, I can get VFAT USB drives writable by user as expected (for example, by adding 'users,umask=111,dmask=00'), but then user can't access the directories below root on ext2 drives. So, it looks as though the problem may be that one set of DEFAULT_MNT_OPTIONS can't satisfy both ext2/3 and VFAT requirements at the same time.

I've found to test things out that you've really got to create and delete directories, sub-directories and files.

Offline

#97 2009-11-16 05:36:17

scire
Member
Registered: 2009-11-16
Posts: 16

Re: A very lightweight volume manager

Hi,
I've been using wmii for quite a while, and ran into your tool here. I installed if from the AUR today, added it to my daemons, and rebooted -- yet it isn't mounting when I plug something in. I have tried several devices (usb drives, sd card, cd, dvd, you name it), but it just isn't mounting anything.
I made sure that the daemon is running, I ensured that hal is working (lshal -m), and also ran skvm -d, and it would appear that it is not receiving any messages (and yes, dbus is running.
Any suggestions?
thanks

Offline

#98 2009-11-16 09:15:45

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: A very lightweight volume manager

scire wrote:

Hi,
I've been using wmii for quite a while, and ran into your tool here. I installed if from the AUR today, added it to my daemons, and rebooted -- yet it isn't mounting when I plug something in. I have tried several devices (usb drives, sd card, cd, dvd, you name it), but it just isn't mounting anything.
I made sure that the daemon is running, I ensured that hal is working (lshal -m), and also ran skvm -d, and it would appear that it is not receiving any messages (and yes, dbus is running.
Any suggestions?
thanks

Are you on a x86_64 system?

Offline

#99 2009-11-17 02:52:26

scire
Member
Registered: 2009-11-16
Posts: 16

Re: A very lightweight volume manager

dimigon wrote:
scire wrote:

Hi,
I've been using wmii for quite a while, and ran into your tool here. I installed if from the AUR today, added it to my daemons, and rebooted -- yet it isn't mounting when I plug something in. I have tried several devices (usb drives, sd card, cd, dvd, you name it), but it just isn't mounting anything.
I made sure that the daemon is running, I ensured that hal is working (lshal -m), and also ran skvm -d, and it would appear that it is not receiving any messages (and yes, dbus is running.
Any suggestions?
thanks

Are you on a x86_64 system?

Yes, I am.

Offline

#100 2009-12-09 08:39:02

lustikus
Member
Registered: 2009-11-10
Posts: 262

Re: A very lightweight volume manager

thank you for this wonderful tool. I used udev automount before but things like deleting the directory when unplugging the usb device never worked for me.

With yout tool everything works.

To the previous poster, I also have x86_64 and had no problem.

You might want to use the latest version from suckless.org (in /tools) as the AUR version is rather old. It contains a PKGBUILD file so installing is very simple:

1. unzip it
2. makepkg -s
3. pacman -U yournewpackagefile.pkg.tar.gz

Offline

Board footer

Powered by FluxBB