You are not logged in.

#51 2009-05-30 11:34:45

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

Re: A very lightweight volume manager

Hello, at the moment skvm starts as a daemon and waits for events to act on. If you have a volume already plugged in and skvm starts, it will not get the event to mount it. I am not sure, but do other volume managers mount volumes on boot? It could be possible to implement such a feature by having skvm scan through /dev trying to find newly inserted devices but that sounds like a hack to me. I am going to look into it, there might be a better way of handling such a scenario. Another way of forcing a mount at boot-time is to have a rule in /etc/fstab. In that case, if you ever had to pull out and plug in the volume, skvm would use the fstab entry prior to mounting it.

*edit*
A means of doing it is to go and look inside /dev/disk/by-uuid and for each uuid (via ls -laF or similar) check if is mounted, if not try to mount it.

I am still not sure how elegant this approach is.

Last edited by dimigon (2009-05-30 20:35:01)

Offline

#52 2009-06-05 19:09:13

prol
Member
Registered: 2008-03-27
Posts: 75

Re: A very lightweight volume manager

I installed skvm, but after it mounts, i can change anything as a normal user. Why is it accessible only to root?

Offline

#53 2009-06-05 19:40:01

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

Re: A very lightweight volume manager

prol wrote:

I installed skvm, but after it mounts, i can change anything as a normal user. Why is it accessible only to root?

Hello, I presume you meant to say "can't change anything". If you look at the top of the source file, you will see the default flags. Now you can edit that to make sure you have read/write access to the device. If not, you can still add an exception for the current device in /etc/fstab.

Offline

#54 2009-06-06 00:41:05

prol
Member
Registered: 2008-03-27
Posts: 75

Re: A very lightweight volume manager

sorry abt that stupid mistake, GOTTA PROOFREAD, anyways according to the arch wiki i need to add this : user,rw,umask=111,dmask=00 to get write access to fat32 drives and then it WORKED and lastly i just wanna thank you for such great program, been waiting for this for years. THANK YOU smile

Offline

#55 2009-06-07 12:10:20

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: A very lightweight volume manager

to make the mounted volumes writable for non-root users, how you edited it and installed it? via the PKGBUILD? or you did the make && make install thing?


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#56 2009-06-07 16:29:37

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: A very lightweight volume manager

i dunno if this is the easiest way, but i did the following:

download and extract the tarball

edit PKGBUILD like so

build() {
    cd ${srcdir}
    
    msg "Connecting to mercurial server..."
    
    if [ -d $_hgname ]; then
        cd $_hgname && hg pull
        cd ..
        msg "The local files are updated."
    else
        hg clone $_hgroot
    fi
    
    msg "Mercurial checkout done or server timeout."
    msg "Starting make..."
    
        vim ./skvm/skvm.c # adjust editor as needed

    rm -rf $_hgname-build
    cp -r $_hgname $_hgname-build
    cd $_hgname-build

then, when you makepkg it'll stop and let you edit skvm.c for mount options before building the package like normal

then just install it.

Offline

#57 2009-06-07 16:39:08

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: A very lightweight volume manager

wow, thanks a lot! smile


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#58 2009-06-07 19:33:27

Robertek
Member
From: Czech Republic
Registered: 2007-06-02
Posts: 165
Website

Re: A very lightweight volume manager

Only for information, this is my volume manager script and works pretty fine:) It is just an udev rule.

robert-eee:/etc/udev/rules.d [2012]# cat 10-automount.rules 
KERNEL=="sd[c-z]", NAME="%k", SYMLINK+="usb-%k", GROUP="users", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[c-z][0-9]", SYMLINK+="usb-%k", GROUP="users", NAME="%k"
ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/etc/udev/scripts/mount-usb mount %k", OPTIONS="last_rule"
ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/etc/udev/scripts/mount-usb umount %k", OPTIONS="last_rule"#
robert-eee:/etc/udev/rules.d [2012]# cat /etc/udev/scripts/mount-usb 
#!/bin/sh


DIR=/media
DEVICE=$2
LABEL=`/lib/udev/vol_id -L /dev/$DEVICE`
FS=`/lib/udev/vol_id -t /dev/$DEVICE`


mount_device () {
    if [ "$LABEL" == "" ];
      then
      mkdir -p $DIR/usb-$DEVICE
      case $FS in 
        vfat)    /bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/$DEVICE $DIR/usb-$DEVICE
        ;; 
        *)    /bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/$DEVICE $DIR/usb-$DEVICE
        ;;
      esac
    else
      mkdir -p $DIR/$LABEL
      echo $LABEL >$DIR/.$DEVICE
      case $FS in 
        vfat)    /bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/$DEVICE $DIR/$LABEL
        ;; 
        *)    /bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/$DEVICE $DIR/$LABEL
        ;;
      esac
    fi
}

umount_device () {
    if [ -e $DIR/usb-$DEVICE ];
      then
      umount -l $DIR/usb-$DEVICE
      rmdir $DIR/usb-$DEVICE;
    else
      ULABEL=`cat $DIR/.$DEVICE`
      umount -l $DIR/$ULABEL
      rmdir $DIR/$ULABEL
      rm $DIR/.$DEVICE;
    fi
}

case $1 in 
  mount) mount_device
  ;;
  umount) umount_device
  ;;
  *) echo "Usage: mount-usb mount/umount sdxY"
esac

This works symply by mounting new device when inserted, in /media and umount when removed (and remove the dir)

It check the partition if it has label and if not mount as /media/usb-sdxX
if it has a label it mounts that in /media/label and to remember the device, creates /media/.device that contain label name (to remove the dir after remove)

Consider the udev rule for available devices (look that I use sdc-sdx, because sda and sdb is hdd on my computer)

If you want to mount some other special device elsewhere you can check my real 10-automount.rules

robert-eee:/etc/udev/rules.d [2013]# cat 10-automount.rules         
KERNEL=="sd[c-z]", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ST96812A", SYMLINK+="storage", OWNER="robert", GROUP="users", OPTIONS="last_rule"
KERNEL=="sd[c-z]", NAME="%k", SYMLINK+="usb-%k", GROUP="users", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[c-z][0-9]", SYMLINK+="usb-%k", GROUP="users", NAME="%k"
ACTION=="add", KERNEL=="sd[c-z][0-9]", ATTRS{vendor}=="ST96812A", SYMLINK+="storage", RUN+="/bin/mount -t ext3 -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/%k /home/robert/storage", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/etc/udev/scripts/mount-usb mount %k", OPTIONS="last_rule"
ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/etc/udev/scripts/mount-usb umount %k", OPTIONS="last_rule"

So if someone want really easy and lightweight volume manager check this.

PS: with udevadm you can check device info.

Last edited by Robertek (2009-06-07 19:37:14)

Offline

#59 2009-06-13 21:34:08

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: A very lightweight volume manager

Nearly a week later, but anyway... smile

Rebertek - this thread is about skvm. Your script is related, but deserves it's own thread. You can link to this one if you like.

Offline

#60 2009-06-21 05:11:57

sfauzia
Member
Registered: 2009-01-11
Posts: 88

Re: A very lightweight volume manager

dimigon wrote:

Hello, at the moment skvm starts as a daemon and waits for events to act on. If you have a volume already plugged in and skvm starts, it will not get the event to mount it. I am not sure, but do other volume managers mount volumes on boot? It could be possible to implement such a feature by having skvm scan through /dev trying to find newly inserted devices but that sounds like a hack to me. I am going to look into it, there might be a better way of handling such a scenario. Another way of forcing a mount at boot-time is to have a rule in /etc/fstab. In that case, if you ever had to pull out and plug in the volume, skvm would use the fstab entry prior to mounting it.

*edit*
A means of doing it is to go and look inside /dev/disk/by-uuid and for each uuid (via ls -laF or similar) check if is mounted, if not try to mount it.

I am still not sure how elegant this approach is.

I just upgraded skvm, and while the fstab entry is now properly deleted after rebooting, I have to pull out and plug in my SD card again before skvm can mount it. I wouldn't mind a hack that wouldn't sacrifice functionality.

Offline

#61 2009-06-21 12:55:53

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

Re: A very lightweight volume manager

sfauzia wrote:
dimigon wrote:

Hello, at the moment skvm starts as a daemon and waits for events to act on. If you have a volume already plugged in and skvm starts, it will not get the event to mount it. I am not sure, but do other volume managers mount volumes on boot? It could be possible to implement such a feature by having skvm scan through /dev trying to find newly inserted devices but that sounds like a hack to me. I am going to look into it, there might be a better way of handling such a scenario. Another way of forcing a mount at boot-time is to have a rule in /etc/fstab. In that case, if you ever had to pull out and plug in the volume, skvm would use the fstab entry prior to mounting it.

*edit*
A means of doing it is to go and look inside /dev/disk/by-uuid and for each uuid (via ls -laF or similar) check if is mounted, if not try to mount it.

I am still not sure how elegant this approach is.

I just upgraded skvm, and while the fstab entry is now properly deleted after rebooting, I have to pull out and plug in my SD card again before skvm can mount it. I wouldn't mind a hack that wouldn't sacrifice functionality.

Hello, skvm can properly delete the fstab entry on reboot in the latest development tip. As I mentioned in the previous post, the best way to easily handle devices that you want to be mounted on boot is via /etc/fstab or whatnot. There are a couple of hacks that could be performed by skvm mainly those outlined in the previous post. Another issue with skvm is that it uses the 'users' flag when it mounts a volume, making it possible for other users on the system to unmount the volume. There are ways to fix that, mainly using pmount in conjunction with a reliable mechanism to identify which user actually plugged in the device (consider only physical access perhaps?). I'd be glad if anyone could submit such a patch.

Last edited by dimigon (2009-06-21 12:59:51)

Offline

#62 2009-06-22 17:45:01

sfauzia
Member
Registered: 2009-01-11
Posts: 88

Re: A very lightweight volume manager

dimigon wrote:

Hello, skvm can properly delete the fstab entry on reboot in the latest development tip. As I mentioned in the previous post, the best way to easily handle devices that you want to be mounted on boot is via /etc/fstab or whatnot. There are a couple of hacks that could be performed by skvm mainly those outlined in the previous post. Another issue with skvm is that it uses the 'users' flag when it mounts a volume, making it possible for other users on the system to unmount the volume. There are ways to fix that, mainly using pmount in conjunction with a reliable mechanism to identify which user actually plugged in the device (consider only physical access perhaps?). I'd be glad if anyone could submit such a patch.

That's exactly what I was thinking--I was about to edit my post to mention that I'm using pmount now for my SD card, and I'm mounting it on boot (of X) with a line in my .xinitrc. It's quite easy to use pmount when it's only for one device. This also lessens the burden on skvm to mount devices that are plugged in at boot.

Offline

#63 2009-06-29 15:01:38

eDio
Member
From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Re: A very lightweight volume manager

When I mount my usb flash with fat32 filesystem through this manager, I get "?" signs instead of cyrillic file names.
Can it be fixed?

TNX

Offline

#64 2009-06-29 19:36:51

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

Re: A very lightweight volume manager

eDio wrote:

When I mount my usb flash with fat32 filesystem through this manager, I get "?" signs instead of cyrillic file names.
Can it be fixed?

TNX

I doubt this is an skvm issue. Check the mount options, look for utf8 or the like.

Look into this http://mybookworld.wikidot.com/forum/t- … at-problem

Last edited by dimigon (2009-06-29 19:40:12)

Offline

#65 2009-06-30 05:50:28

eDio
Member
From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Re: A very lightweight volume manager

But where should I change the mount options for skvm?
Sorry for asking, maybe, such stupid things, but I can't find any info on this nor in readme, nor in man skvm page.

Offline

#66 2009-06-30 07:52:16

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

Re: A very lightweight volume manager

eDio wrote:

But where should I change the mount options for skvm?
Sorry for asking, maybe, such stupid things, but I can't find any info on this nor in readme, nor in man skvm page.

As it happens, skvm is only configurable through its source file. So open skvm.c in your favourite editor and change the DEFAULT_MNT_OPTIONS define. That should make it tick. Then recompile the source code. If you still want to use a pkgbuild, just include vim skvm.c or so in the pkgbuild right before the compilation takes place.

Offline

#67 2009-06-30 14:46:26

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: A very lightweight volume manager

thanks dimigon.  excellently small and useful app.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#68 2009-08-27 05:33:11

freeblue
Member
From: France
Registered: 2009-07-21
Posts: 10

Re: A very lightweight volume manager

hi, because i don't know where to post bug for skvm, i fill this thread.
skvm is exactly what i was looking for, thanks too much to the author. after using it a bit, the only issue i met is when was playing with an old Red Hat Enterprise 4 cd, which label is

RHEL_4 i386

. the mount point is automatically created in fstab, but skvm doesn't like the name and it can't mount the cd because wasn't able to create a directory with this name in /media.
i have stoped skvm daemon, the gave a try with pcmanmf: it works with pcmanfm.
i only wanted to report this.......
thanks again for this great tool.

Offline

#69 2009-08-29 20:59:08

gladstone
Member
Registered: 2009-01-03
Posts: 74

Re: A very lightweight volume manager

dimigon wrote:

As it happens, skvm is only configurable through its source file. So open skvm.c in your favourite editor and change the DEFAULT_MNT_OPTIONS define. That should make it tick. Then recompile the source code. If you still want to use a pkgbuild, just include vim skvm.c or so in the pkgbuild right before the compilation takes place.

Forgive my naivety, but what exactly do I add to allow non-root read/write?

Offline

#70 2009-09-08 12:59:56

zowki
Member
From: Trapped in The Matrix
Registered: 2008-11-27
Posts: 582
Website

Re: A very lightweight volume manager

You have to modify the source code to do that. There is no option to set user permissions unless you do it manually.


How's my programming? Call 1-800-DEV-NULL

Offline

#71 2009-09-08 18:21:37

gladstone
Member
Registered: 2009-01-03
Posts: 74

Re: A very lightweight volume manager

I just change the line:

#define DEFAULT_MNT_OPTIONS "noexec,nosuid,nodev,users"

to

#define DEFAULT_MNT_OPTIONS "noexec,nosuid,nodev,users,rw"

correct?

Offline

#72 2009-09-09 00:40:20

N30N
Member
Registered: 2007-04-08
Posts: 273

Re: A very lightweight volume manager

Dimigon thanks for this!

skvm seem to have a issue mounting one of my DVD's:

% ls -l /media
dr--r--r--  3 4294967295 4294967295    88 2005-06-21 20:39 disk

It only happens with the one disk so I don't really care but if I can provide any info that'll help track down the problem/bug just let me know.

Also are there plans to support UUID/label fstab rules (I don't think rules is the correct term, but I'm sure you'll know what i mean)?

Offline

#73 2009-09-14 19:48:35

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

Re: A very lightweight volume manager

N30N wrote:

Dimigon thanks for this!

skvm seem to have a issue mounting one of my DVD's:

% ls -l /media
dr--r--r--  3 4294967295 4294967295    88 2005-06-21 20:39 disk

It only happens with the one disk so I don't really care but if I can provide any info that'll help track down the problem/bug just let me know.

Also are there plans to support UUID/label fstab rules (I don't think rules is the correct term, but I'm sure you'll know what i mean)?

skvm does support that, grep the code (-i) for 'uuid' and 'label'.

Last edited by dimigon (2009-09-14 19:49:49)

Offline

#74 2009-09-14 19:51:28

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

Re: A very lightweight volume manager

freeblue wrote:

hi, because i don't know where to post bug for skvm, i fill this thread.
skvm is exactly what i was looking for, thanks too much to the author. after using it a bit, the only issue i met is when was playing with an old Red Hat Enterprise 4 cd, which label is

RHEL_4 i386

. the mount point is automatically created in fstab, but skvm doesn't like the name and it can't mount the cd because wasn't able to create a directory with this name in /media.
i have stoped skvm daemon, the gave a try with pcmanmf: it works with pcmanfm.
i only wanted to report this.......
thanks again for this great tool.

I'll make sure it works and I will commit it as soon as I've got some spare time.

Offline

#75 2009-09-14 21:11:50

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: A very lightweight volume manager

Today I gave skvm a try, it's really a neat little app and I would love to use it! But right now it's not possible for me, because it's a little bit strange. Let me describe:

First, I have an entry in fstab for my external drive and the micro sd card for my sandisk sansa

# 1500GB
UUID=8a60b3b7-50bc-48a7-b3ba-aa0f13f32156 /mnt/1500GB xfs rw,user,noauto 0 0
# 16GB Micro SD Karte
UUID=6536-3936 /mnt/16GB vfat rw,user,noauto,flush,shortname=mixed,uid=1000,utf8,umask=077

I made these entries a while ago, because I had other options set (umask and such specific stuff).

What I want to say here is, that these entries aren't recognized by skvm. I'm not completely sure, if it's even intended, but I think I read here, that fstab is being supported. Is it because of the uuid?

The other thing is the options. As you can see, for vfat and xfs (or any other linux fs) there are different options to be set. I don't exactly know if they are all needed, but I DEFINITELY need shortname=mixed for vfat. Am I right in saying, that skvm only supports one global line of options, no matter what's the filesystem? What would xfs do with a shortname=mixed?

And what also happens with skvm mounting a vfat drive is, that I cannot access it, it's owned by root:root and I'm not able to change this.

Last edited by Army (2009-09-14 21:13:17)

Offline

Board footer

Powered by FluxBB