05

August
2009

How to use Slax Drive from other Linuxes

Slax Drive is currently available for Slax and for Windows. There are no official packages for other distros yet, but still it is possible to use it in any distro you like.

Here is a short script for shell to connect the drive in any other Linux:

#!/bin/bash
USRNME=aaa # change this
export PASSWD=bbb # change this
SERVER=$(wget -qO - http://www.slax.org/slax_drive.php?userurl=$USRNME)
mkdir -p /mnt/slaxdrive
mount -t cifs -o username=$USRNME,file_mode=0600,dir_mode=0700,directio \
//$SERVER/$USRNME /mnt/slaxdrive

That's all.
I didn't test it though, so please report your success :)
Thank you

EDIT: I added 'export' keyword at the beginning of password definition line.

User comments
Ivo Georgiev 2009-08-06 08:19

I think it should be something like

echo $PASSWD | mount -t cifs -o username=$USRNME,file_mode=0600,dir_mode=0700,directio \
//$SERVER/$USRNME /mnt/slaxdrive

If you want to use the PASSWD variable :)

Bogdan 2009-08-06 09:16

Doesn't seem to be working for me:

mount: wrong fs type, bad option, bad superblock on //drive.slax.org/bogdan,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


After setting /proc/fs/cifs/cifsFYI to 1 this is what I get in dmesg:
fs/cifs/cifsfs.c: Devname: //drive.slax.org/bogdan flags: 0
fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 4 with uid: 0
fs/cifs/connect.c: Username: bogdan
fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 4) rc = -22
CIFS VFS: cifs_mount failed w/return code = -22


Last but not least I am using kernel 2.6.27.8

Tomas M 2009-08-06 12:16

hm, do you have cifs filesystem compiled in kernel? Also, would you please try '-t smbfs' instead of '-t cifs'?

Regarding PASSWD variable, it is documented in 'man mount.cifs' that you can use variable this way.

ecelis 2009-08-06 15:06

Hi! I've tried to connect to my Slax Drive, from my office network and everything works fine here.

To connect from CentOS 5.3 or Ubuntu 9.04, you can use the "Connect to Server" option in the Gnome Places menu.

Places->Connect to Server... and fill in the following:

Service type: Windows share
Server: drive.slax.org
Share or Folder: YourSlaxDriveUserName

Click Connect button, and wait for the password dialog. You can leave blank the Domain box or leave the default value.

I'll try again on my home network to find why I can't connect to my drive from there.

ecelis 2009-08-06 15:08

Oops!

You must fill only one of Share of Folder, not both.

And don't forget fill in your username, as I missed it from my comment above.

Cheers!!

Tomas M 2009-08-06 20:54

Be warned, do not use direct connection to 'drive.slax.org'. Every username must first check the server domain by calling the http request (see the wget part). This is because in the future, there may be several server machines and you never know what particular machine will store files for your particular username.

Bogdan 2009-08-07 05:50

These are my kernel options:
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
CONFIG_CIFS_WEAK_PW_HASH=y
# CONFIG_CIFS_UPCALL is not set
# CONFIG_CIFS_XATTR is not set
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_EXPERIMENTAL is not set
CONFIG_SMB_FS=m
# CONFIG_SMB_NLS_DEFAULT is not set

I also ran a "modprobe cifs", a "modprobe smbfs", updated to the latest samba and now I get these messages after I hit Ctrl+C because the script is just laying there while dmesg is telling me the socket is created:
CIFS VFS: Error connecting to socket. Aborting operation
CIFS VFS: cifs_mount failed w/return code = -512


By the way, I believe the last line should be like this:
mount -t smbfs -o username=$USRNME,password=$PASSWD,file_mode=0600,dir_mode=0700,directio //$SERVER/$USRNME /mnt/slaxdrive

Tomkonikkara 2009-09-04 03:50

I tried graphical method of connecting in slax 6.1.2 but failed. When I run this script by terminal, some error shows like this:

mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

what may be the reason?