You are not logged in.

#1 2009-04-02 17:05:04

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

A very lightweight volume manager

Hello everyone, I've hacked together a simple lightweight volume manager simply because I am using wmii and I did not want to use any gnome-related mounting daemons. It is meant to be short, simple and straight to the point. It works as expected with cdroms/dvds/usb devices/cameras etc. I hope it can be of use to anyone who is in similar needs. Feedback and requests are highly appreciated.

*edit*
To clone the latest development snapshot use hg clone http://code.suckless.org/hg/skvm

http://aur.archlinux.org/packages.php?ID=26195

Last edited by dimigon (2009-05-21 10:34:03)

Offline

#2 2009-04-03 04:53:37

dw
Member
From: Vienna, Austria
Registered: 2006-11-25
Posts: 157

Re: A very lightweight volume manager

hi dimigon.

this is _exactly_ what i've been looking for. i'll try it out and report back later!

thanks for the work you've done!

Offline

#3 2009-04-03 17:23:14

jerryluc
Member
From: Trondheim, Norway
Registered: 2008-05-20
Posts: 95

Re: A very lightweight volume manager

I liked it very much.

Some comments:
- a bit strange that the mount folder sometimes is named by the UID
- very little documentation, deps? version?

made a PKGBUILD(but it's not correct as I don't know the package ver. and deps(including hal and dbus because they are obvious):

pkgname=skvm
pkgver=1
pkgrel=1
pkgdesc="Lightweight volume manager"
arch=(i686 x86_64)
depends=('hal' 'dbus')
source=(http://www.macs.hw.ac.uk/~dp69/skvm.tar.bz2)
md5sums=('c18fcc9ac17df364a2bf29a532afd3ca')
license=('GPL')

build() {
  cd "${srcdir}/${pkgname}"

  make || return 1

  mkdir ${startdir}/pkg/usr/
  mkdir ${startdir}/pkg/usr/bin/

  mkdir ${startdir}/pkg/etc/
  mkdir ${startdir}/pkg/etc/rc.d/

  install -m 755 ${srcdir}/${pkgname}/skvm ${startdir}/pkg/usr/bin/skvm

  install -m 755 ${srcdir}/${pkgname}/skvm_init ${startdir}/pkg/etc/rc.d/skvm_init
}

Offline

#4 2009-04-03 19:11:12

X/ax
Member
From: Oost vlaanderen, Belgium
Registered: 2008-01-13
Posts: 275
Website

Re: A very lightweight volume manager

Brilliant, too brilliant... It works like a charm. However (nagging mode on), I have some stuff I'd like to have mounted according to /etc/fstab. I haven't really tested it, but is that supported? Or would that be too hard? :s


My coding blog (or an attempt at it)
Archer start page (or an attempt at it)

Offline

#5 2009-04-03 20:00:27

s3kt0r
Member
Registered: 2009-01-20
Posts: 208

Re: A very lightweight volume manager

Sorry for askin, do I need to add skvm to daemons in rc.conf? (probably a stupid question)


box1: Arch (linux-3.17-rc5)
box2: Gentoo (linux-3.17-rc5)
wm: subtle

Offline

#6 2009-04-04 01:34:54

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

Re: A very lightweight volume manager

jerryluc wrote:

I liked it very much.

Some comments:
- a bit strange that the mount folder sometimes is named by the UID
- very little documentation, deps? version?

made a PKGBUILD(but it's not correct as I don't know the package ver. and deps(including hal and dbus because they are obvious):

pkgname=skvm
pkgver=1
pkgrel=1
pkgdesc="Lightweight volume manager"
arch=(i686 x86_64)
depends=('hal' 'dbus')
source=(http://www.macs.hw.ac.uk/~dp69/skvm.tar.bz2)
md5sums=('c18fcc9ac17df364a2bf29a532afd3ca')
license=('GPL')

build() {
  cd "${srcdir}/${pkgname}"

  make || return 1

  mkdir ${startdir}/pkg/usr/
  mkdir ${startdir}/pkg/usr/bin/

  mkdir ${startdir}/pkg/etc/
  mkdir ${startdir}/pkg/etc/rc.d/

  install -m 755 ${srcdir}/${pkgname}/skvm ${startdir}/pkg/usr/bin/skvm

  install -m 755 ${srcdir}/${pkgname}/skvm_init ${startdir}/pkg/etc/rc.d/skvm_init
}

Hello! Thanks for the PKGBUILD! To answer your questions, it does use the uuid in case there is a folder with the same name as the usb's label or when the label is blank. This can easily be changed to something more practical. I shall make some documentation and I will post it here as an update.

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

Offline

#7 2009-04-04 01:35:38

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

Re: A very lightweight volume manager

s3kt0r wrote:

Sorry for askin, do I need to add skvm to daemons in rc.conf? (probably a stupid question)

Yes add it at the end of the daemons part in your rc.conf smile Make sure HAL and DBUS are there as well.

Last edited by dimigon (2009-04-04 01:38:03)

Offline

#8 2009-04-04 01:36:41

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

Re: A very lightweight volume manager

X/ax wrote:

Brilliant, too brilliant... It works like a charm. However (nagging mode on), I have some stuff I'd like to have mounted according to /etc/fstab. I haven't really tested it, but is that supported? Or would that be too hard? :s

I've already thought about using /etc/fstab to establish mount points. It is not supported at the moment and no it is not too hard to implement. I will post an update once I've got some time to work on that.

Last edited by dimigon (2009-04-04 01:38:32)

Offline

#9 2009-04-04 05:05:42

s3kt0r
Member
Registered: 2009-01-20
Posts: 208

Re: A very lightweight volume manager

@ dimigon, I thought it would be a nice place for skvm to be. cool Just to be assured big_smile

I used PKGBUILD (thanks jerryluc), all good, going to test period, check back with results later.


box1: Arch (linux-3.17-rc5)
box2: Gentoo (linux-3.17-rc5)
wm: subtle

Offline

#10 2009-04-04 06:03:01

dw
Member
From: Vienna, Austria
Registered: 2006-11-25
Posts: 157

Re: A very lightweight volume manager

hi dimigon.

i just tried your daemon and it is in fact really brilliant. also thanks for providing PKGBUILD to jerryluc!

the only comment so far would be to use something like sdX as mount mounts instead of the uuids, but that's really something that should not be too difficult to change. fstab support would be awesome.

one question, though: is possible to mount LUKS-crypted partitions as well? that would really rock!

keep up the good work!

Offline

#11 2009-04-04 09:16:23

jerryluc
Member
From: Trondheim, Norway
Registered: 2008-05-20
Posts: 95

Re: A very lightweight volume manager

About the naming: +1 for the naming after sdX,

it does use the uuid in case there is a folder with the same name as the usb's label or when the label is blank.

this is probably ok, but it's not working perfect. skvm mounted my external disk "WD \Passport" the first time, but since skvm created that folder the next time it mounted it by uid.

Another thing: skvm did mount my ntfs external disk, but only with read permissions for root.

Offline

#12 2009-04-04 11:56:48

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

Re: A very lightweight volume manager

dw wrote:

hi dimigon.

i just tried your daemon and it is in fact really brilliant. also thanks for providing PKGBUILD to jerryluc!

the only comment so far would be to use something like sdX as mount mounts instead of the uuids, but that's really something that should not be too difficult to change. fstab support would be awesome.

one question, though: is possible to mount LUKS-crypted partitions as well? that would really rock!

keep up the good work!

It is not possible to mount crypted partitions yet, but that can be added quite easily. I'll look into that as well. Fstab support is almost underway.

jerryluc wrote:

About the naming: +1 for the naming after sdX,

it does use the uuid in case there is a folder with the same name as the usb's label or when the label is blank.

this is probably ok, but it's not working perfect. skvm mounted my external disk "WD \Passport" the first time, but since skvm created that folder the next time it mounted it by uid.

Another thing: skvm did mount my ntfs external disk, but only with read permissions for root.

Normally when you insert a device and it mounts it the first time, then if you umount it and remove it, it removes the folder with that name so no further collisions take place. I have not tried any ntfs drives so far, but I usually have a problem when I use mount as well. Ntfs-3g might actually do the trick.

Last edited by dimigon (2009-04-04 12:00:34)

Offline

#13 2009-04-04 12:39:32

neoxic
Member
From: Massachusetts, USA
Registered: 2008-09-18
Posts: 13
Website

Re: A very lightweight volume manager

Awesome app!  I did something similiar with Perl, but I like your idea of using label names.

Any plans on putting this up on github or the like so we can track the development?

Thanks! Great job!

Offline

#14 2009-04-04 12:57:12

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

Re: A very lightweight volume manager

neoxic wrote:

Awesome app!  I did something similiar with Perl, but I like your idea of using label names.

Any plans on putting this up on github or the like so we can track the development?

Thanks! Great job!

Sure, that would be awesome! I will post the details soon.

Last edited by dimigon (2009-04-04 12:57:46)

Offline

#15 2009-04-04 18:39:05

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

Re: A very lightweight volume manager

tried the PKGBUILD but failed with "One or more files did not pass the validity check!" is that md5sum no longer valid? can i have the new one?  thanks, looking forward to this it's just what i've been looking for.

Offline

#16 2009-04-04 19:45:32

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

Re: A very lightweight volume manager

brisbin33 wrote:

tried the PKGBUILD but failed with "One or more files did not pass the validity check!" is that md5sum no longer valid? can i have the new one?  thanks, looking forward to this it's just what i've been looking for.

The md5sum is not valid as I keep updating the original archive. The best way to try it out is to follow the instructions outlined in the README file or change the md5 in the PKGBUILD file. Keep in mind this program is still in development. Once I've settled with a final stable release I am just gonna use AUR to distribute it.

Last edited by dimigon (2009-04-04 19:48:44)

Offline

#17 2009-04-07 18:19:54

gunnihinn
Member
From: Torreón, Mexico
Registered: 2007-10-28
Posts: 81

Re: A very lightweight volume manager

Incredible, this is exactly what I was looking for. Works like a charm.

Offline

#18 2009-04-07 21:44:46

neoxic
Member
From: Massachusetts, USA
Registered: 2008-09-18
Posts: 13
Website

Re: A very lightweight volume manager

Thanks for starting a repo!  Looking great!

Offline

#19 2009-04-15 14:04:39

bubaak
Member
From: Brno, Czech Republic
Registered: 2008-10-29
Posts: 7

Re: A very lightweight volume manager

And here's PKGBUILD for the git version:

# Contributor: Ondrej Martinak <omartinak@gmail.com>

pkgname=skvm-git
pkgver=20090415
pkgrel=1
pkgdesc="Lightweight volume manager"
arch=('i686' 'x86_64')
url="http://github.com/dimigon/skvm/tree/master"
license=('GPL')
depends=('hal' 'dbus')
makedepends=('git')
conflicts=('skvm')
provides=('skvm')

_gitroot="git://github.com/dimigon/skvm.git"
_gitname="skvm"

build() {
    cd ${srcdir}

    msg "Connecting to GIT server..."

    if [ -d $_gitname ]; then
        cd $_gitname && git pull origin
        cd ..
        msg "The local files are updated."
    else
        git clone $_gitroot
    fi

    msg "GIT checkout done or server timeout"
    msg "Starting make..."

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

    make || return 1
    
    mkdir -p ${startdir}/pkg/usr/bin
    mkdir -p ${startdir}/pkg/etc/rc.d

    install -m 755 skvm ${startdir}/pkg/usr/bin/skvm
    install -m 755 init/skvm ${startdir}/pkg/etc/rc.d/skvm
}

Btw thanks for the app, it's pretty cool smile.


ARCH64 | i3
I laugh in the face of kernel errors. -haxit

Offline

#20 2009-04-15 19:31:50

myrkiada
Member
From: Norway
Registered: 2009-04-15
Posts: 74

Re: A very lightweight volume manager

It works just perfect! I no longer have to open Thunar just to mount my external drives. Thank
you so much, I've been looking for something like this ever since I became a xmonad addict. smile


My Configs @ Github

Offline

#21 2009-04-15 23:50:22

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: A very lightweight volume manager

myrkiada wrote:

It works just perfect! I no longer have to open Thunar just to mount my external drives. Thank
you so much, I've been looking for something like this ever since I became a xmonad addict. smile

Of course, "thunar --daemon" would have also worked for you, had you known about it.


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#22 2009-04-16 00:08:22

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

Re: A very lightweight volume manager

[final edit]scratch all that, i'm a liar.. it was a fat16 formatted thumb drive with no LABEL, reformatted fat32 with LABEL and your program worked fine.  in any case, you might like to know if you use your daemon with a fat16 labeless drive you get this...[/edit]

it mounted it to /mnt/backup_monthly where i already had a 320G backup drive mounted.  clobberred some files (but only some), nothing important luckily.  any idea why it would do this?

edit: hmm maybe the thumb drive didn't have a label.  and it's UID seems odd (3B36-6393) is that a fat16 UID?  pcmanfm mounts it to /media/disk when i click on it.  your program for some reason chose to use an existing mountpoint? here's the fstab line for the drive it over-mounted.  maybe it's just a corner case that confused it.

LABEL=320G                      /mnt/backup_monthly     ext3    defaults 0 0

edit2: tried it with a more 'normal' thumb drive, worked great.  i must've messed up that flash drive somehow.  it was my fault, but still seems an odd way to handle the error, to overmount an existing drive.

anyways, really useful program thanks for writing it.

Last edited by brisbin33 (2009-04-16 00:32:40)

Offline

#23 2009-04-16 10:04:20

jerryluc
Member
From: Trondheim, Norway
Registered: 2008-05-20
Posts: 95

Re: A very lightweight volume manager

I like the idea of a lightweight volume manager, but I can't seem to figure out skvm. I have skvm run as a daemon, and it mounts external hdd/flash sticks by label or uuid. But why do I need /usr/bin/skvm for? And you(dimigon) said that it deleted the directory when it was unmounted, is that when you unmount with skvm in some way I haven't figured out?

edit: figured out why I needed /usr/bin/skvm. But still don't get the unmount and deletion of directories part?

Last edited by jerryluc (2009-04-16 10:11:35)

Offline

#24 2009-04-17 11:42:21

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

Re: A very lightweight volume manager

bubaak wrote:

And here's PKGBUILD for the git version:

# Contributor: Ondrej Martinak <omartinak@gmail.com>

pkgname=skvm-git
pkgver=20090415
pkgrel=1
pkgdesc="Lightweight volume manager"
arch=('i686' 'x86_64')
url="http://github.com/dimigon/skvm/tree/master"
license=('GPL')
depends=('hal' 'dbus')
makedepends=('git')
conflicts=('skvm')
provides=('skvm')

_gitroot="git://github.com/dimigon/skvm.git"
_gitname="skvm"

build() {
    cd ${srcdir}

    msg "Connecting to GIT server..."

    if [ -d $_gitname ]; then
        cd $_gitname && git pull origin
        cd ..
        msg "The local files are updated."
    else
        git clone $_gitroot
    fi

    msg "GIT checkout done or server timeout"
    msg "Starting make..."

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

    make || return 1
    
    mkdir -p ${startdir}/pkg/usr/bin
    mkdir -p ${startdir}/pkg/etc/rc.d

    install -m 755 skvm ${startdir}/pkg/usr/bin/skvm
    install -m 755 init/skvm ${startdir}/pkg/etc/rc.d/skvm
}

Btw thanks for the app, it's pretty cool smile.

I've added the PKGBUILD to the repository. Thanks for the contribution.

brisbin33 wrote:

[final edit]scratch all that, i'm a liar.. it was a fat16 formatted thumb drive with no LABEL, reformatted fat32 with LABEL and your program worked fine.  in any case, you might like to know if you use your daemon with a fat16 labeless drive you get this...[/edit]

it mounted it to /mnt/backup_monthly where i already had a 320G backup drive mounted.  clobberred some files (but only some), nothing important luckily.  any idea why it would do this?

edit: hmm maybe the thumb drive didn't have a label.  and it's UID seems odd (3B36-6393) is that a fat16 UID?  pcmanfm mounts it to /media/disk when i click on it.  your program for some reason chose to use an existing mountpoint? here's the fstab line for the drive it over-mounted.  maybe it's just a corner case that confused it.

LABEL=320G                      /mnt/backup_monthly     ext3    defaults 0 0

edit2: tried it with a more 'normal' thumb drive, worked great.  i must've messed up that flash drive somehow.  it was my fault, but still seems an odd way to handle the error, to overmount an existing drive.

anyways, really useful program thanks for writing it.

I will look into that.

jerryluc wrote:

I like the idea of a lightweight volume manager, but I can't seem to figure out skvm. I have skvm run as a daemon, and it mounts external hdd/flash sticks by label or uuid. But why do I need /usr/bin/skvm for? And you(dimigon) said that it deleted the directory when it was unmounted, is that when you unmount with skvm in some way I haven't figured out?

edit: figured out why I needed /usr/bin/skvm. But still don't get the unmount and deletion of directories part?

The latest development snapshot does not use the UUID anymore as a directory name for the mount point, instead it uses the associated device file. When you insert the device, skvm mounts it at some directory, then before you remove the device you unmount it manually like you do using umount(8) and then you remove the device from the computer. When you unplug the device, skvm will delete the mount point (the directory). In the rare case where two devices have the same label and there is an entry in /etc/fstab for that label, then there will be stacked as they will be mounted under the same directory. So when you unplug the last one, the directory will not be removed because it is used by the first device still. When you unplug the first device, it will be removed. Hope its clear now big_smile

Last edited by dimigon (2009-04-17 11:48:20)

Offline

#25 2009-04-17 22:03:47

epsilon
Member
Registered: 2009-04-02
Posts: 75

Re: A very lightweight volume manager

This seems like it will fit what I've been trying do. I'll try it when I get home (posting just so I can be sure to find this later).


mu @ freenode - Last.fm

Offline

Board footer

Powered by FluxBB