Comments on: Windows Baggage: Failing to comprehend ‘network drives’ in GNU/Linux http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/ free software, free culture, free association Thu, 24 Jul 2008 05:24:29 +0000 http://wordpress.org/?v=2.0.11 by: Scott Carpenter http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3379 Tue, 04 Dec 2007 01:13:10 +0000 http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3379 Thanks, Bob. I haven't started using fstab yet for stuff. I have some scripts to mount and unmount the two disks on the slug. The credentials file is encrypted with encfs, so I need to have that mounted first, and I want to be the one supplying the password there. This works pretty good, although I'll eventually want to monkey around with fstab. Thanks, Bob. I haven’t started using fstab yet for stuff. I have some scripts to mount and unmount the two disks on the slug. The credentials file is encrypted with encfs, so I need to have that mounted first, and I want to be the one supplying the password there. This works pretty good, although I’ll eventually want to monkey around with fstab.

]]>
by: Bob http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3373 Sun, 02 Dec 2007 19:08:59 +0000 http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3373 If you're trying to mount your Slug upon every boot, then you should just use an entry in <b>/etc/fstab</b>. <code>//192.168.1.50/slug /media/slug cifs uid=scott,gid=scott,credentials=/root/.smbcredentials</code> and in the <b>/root/.smbcredentials</b> file would be your username and password on the slug: <b>username=scott password=secret</b> (or, you could just put them directly into the fstab line, but then everyone could see them). However, a better way, I think is to not mount it automatically upon every boot. This way, you can control who mounts what if there is more than one person using your machine. Or, even if there isn't, you can have easy control of the mount/umount. Here's what I do on my Ubuntu 7.10 machine. In /etc/fstab, I have: <code>//192.168.1.xxx/bob /media/slug cifs user,noauto,credentials=/home/bob/.smbcredentials</code> That line will mount the slug to /media/slug (which, being under /media will also automatically give me a desktop icon). However, the 'noauto' attribute means it won't actually mount until I tell it to. The 'user' attribute means any user can mount it (as opposed to just root), and whatever is mounted will automatically be owned by the mounter. The credentials file is simply the basic 'username=bob', 'password=secret' stuff for logging onto the slug. And, since it's in my /home/bob directory, which is mod 700, it isn't readable by anyone else. So, basically, upon boot, that fstab entry is read and makes everything ready to boot the slug, but leaves it in standby because of the 'noauto' attribute. Then, I have an icon I created on my top panel that simply runs the command '<b>mount /media/slug</b>' when I click it, which mounts the slug (allowed by the 'user' attribute in the fstab) and puts an drive icon on the desktop. I can later unmount it whenever I want by simply right-clicking and selecting 'unmount' (again allowed by the 'user' attribute). Bob If you’re trying to mount your Slug upon every boot, then you should just use an entry in /etc/fstab.

//192.168.1.50/slug /media/slug cifs uid=scott,gid=scott,credentials=/root/.smbcredentials

and in the /root/.smbcredentials file would be your username and password on the slug:
username=scott
password=secret

(or, you could just put them directly into the fstab line, but then everyone could see them).

However, a better way, I think is to not mount it automatically upon every boot. This way, you can control who mounts what if there is more than one person using your machine. Or, even if there isn’t, you can have easy control of the mount/umount.

Here’s what I do on my Ubuntu 7.10 machine.
In /etc/fstab, I have:
//192.168.1.xxx/bob /media/slug cifs user,noauto,credentials=/home/bob/.smbcredentials

That line will mount the slug to /media/slug (which, being under /media will also automatically give me a desktop icon). However, the ‘noauto’ attribute means it won’t actually mount until I tell it to. The ‘user’ attribute means any user can mount it (as opposed to just root), and whatever is mounted will automatically be owned by the mounter. The credentials file is simply the basic ‘username=bob’, ‘password=secret’ stuff for logging onto the slug. And, since it’s in my /home/bob directory, which is mod 700, it isn’t readable by anyone else.

So, basically, upon boot, that fstab entry is read and makes everything ready to boot the slug, but leaves it in standby because of the ‘noauto’ attribute.

Then, I have an icon I created on my top panel that simply runs the command ‘mount /media/slug‘ when I click it, which mounts the slug (allowed by the ‘user’ attribute in the fstab) and puts an drive icon on the desktop. I can later unmount it whenever I want by simply right-clicking and selecting ‘unmount’ (again allowed by the ‘user’ attribute).

Bob

]]>
by: Scott Carpenter http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3372 Sat, 01 Dec 2007 15:05:06 +0000 http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3372 Hi, Steve. Thanks for visiting and commenting. Hi, Steve. Thanks for visiting and commenting.

]]>
by: Steve http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3371 Fri, 30 Nov 2007 17:21:39 +0000 http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3371 Hey guys - Ran up against this same problem very recently in SuSE 10.3 - and agree with the solution, but just make sure you dont miss ANY of the arguments: uid,gid,username,password, and of course, lfs is a good habit to get into ;) I noticed that for some reason, cifs is now requiring the password to be passed, on the command line, rather than asking for it after the fact. This of course sucks, if someone is watching over your shoulder while you are having to do one of those 'real-quick-fix-hack-mounts' to test something... grrr.. maybe a bug in the new cifs driver? anyway - just my 2c - I figured this is worthy of mention, since I personally am not using cred files, and Im sure theres gonna be a nube that runs up against it sooner than later that has no idea _about_ credential files. Steve Hey guys -

Ran up against this same problem very recently in SuSE 10.3 - and agree with the solution, but just make sure you dont miss ANY of the arguments:

uid,gid,username,password, and of course, lfs is a good habit to get into ;)

I noticed that for some reason, cifs is now requiring the password to be passed, on the command line, rather than asking for it after the fact.

This of course sucks, if someone is watching over your shoulder while you are having to do one of those ‘real-quick-fix-hack-mounts’ to test something… grrr.. maybe a bug in the new cifs driver?

anyway - just my 2c - I figured this is worthy of mention, since I personally am not using cred files, and Im sure theres gonna be a nube that runs up against it sooner than later that has no idea _about_ credential files.

Steve

]]>
by: Chris Smith http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3160 Fri, 31 Aug 2007 23:47:39 +0000 http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-3160 Thank you, too, Mario. Had to recompile the kernel to get the drivers. Will it speak nfs or only cifs? Guess we'll find out. Thank you, too, Mario. Had to recompile the kernel to get the drivers. Will it speak nfs or only cifs? Guess we’ll find out.

]]>
by: Scott Carpenter http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-990 Sat, 27 Jan 2007 15:15:58 +0000 http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-990 Thank you, Mario, for taking the time to give such detailed advice. As a first step, I tried this: <code>mount -t cifs -o uid=scarpent,gid=scarpent,username=admin "//192.168.1.50/DISK 1" /home/scarpent/nslu_test</code> I was able to mount it, but still with the odd permissions. I wonder if this is something specific to the Linksys device? (That's also why there is the space in the share name -- I didn't choose that and don't know if I can change it. All I have to work with is a limited administrative web page for the NSLU2.) I appreciate your other advice also -- this is the kind of stuff I'll want to do once I get the permissions worked out. Thank you, Mario, for taking the time to give such detailed advice.

As a first step, I tried this:

mount -t cifs -o uid=scarpent,gid=scarpent,username=admin "//192.168.1.50/DISK 1" /home/scarpent/nslu_test

I was able to mount it, but still with the odd permissions. I wonder if this is something specific to the Linksys device?

(That’s also why there is the space in the share name — I didn’t choose that and don’t know if I can change it. All I have to work with is a limited administrative web page for the NSLU2.)

I appreciate your other advice also — this is the kind of stuff I’ll want to do once I get the permissions worked out.

]]>
by: Mario Stargard http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-984 Fri, 26 Jan 2007 21:40:38 +0000 http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-984 You need to pass in uid= and gid= to set the permissions of who will own the files and directories in the mounted filesystem. You can also pass in file mode information to set up read/write information. I find the automounter to be very useful on this front since it allows regular users to mount the filesystem simply by trying to access it. Another handy trick is to put the credentials into a separate file. For example, I might create a file in my home directory called .auth which looks like this: <code> username=mario password=password4me domain=happyplace </code> Then I could mount the filesystem like: <code> mount -t cifs -o credentials=/home/mario/.auth "//192.168.1.50/DISK 1" /home/scarpent/nslu_test </code> But then everything will be owned by root, which is not much use to me. If mario's uid=502, and gid=502, then I could do this: <code> mount -t cifs -o uid=mario,gid=mario,credentials=/home/mario/.auth "//192.168.1.50/DISK 1" /home/scarpent/nslu_test </code> which would make the files read/writable by mario and members of the group mario. To automate all of this, put it into automount. First, make sure you have autofs installed. On Fedora systems you type: <code> rpm -qf /etc/auto.master </code> You should get an answer like <code> autofs-4.1.4-26 </code> Then you need an entry in /etc/auto.master: <code> /mnt/smb /etc/auto.cifs </code> This tells the automounter that anything under /mnt/smb will be handled by it. Now the /etc/auto.cifs file should contain a line like: <code> nslu_test -fstype=cifs,uid=mario,gid=mario,credentials=/home/mario/.auth,file_mode=0740,dir_mode=0750 :"//192.168.1.50/DISK 1" </code> This all needs to be on a single line. I'm not sure how the space will work out. I usually avoid share names with spaces. Try it with and without the quotes. Finally, start the autofs daemon if it isn't already running. In Fedora, this is <code> service autofs start </code> To make it always start, type <code> chkconfig autofs on </code> Now if you browse to /mnt/smb/nslu_test, you should see your files and be able to write to the directory. After about 5 minutes of not using the filesystem, the automounter will unmount it. Mario Stargard Unix Administrator You need to pass in uid= and gid= to set the permissions of who will own the files and directories in the mounted filesystem. You can also pass in file mode information to set up read/write information. I find the automounter to be very useful on this front since it allows regular users to mount the filesystem simply by trying to access it. Another handy trick is to put the credentials into a separate file.

For example, I might create a file in my home directory called .auth which looks like this:


username=mario
password=password4me
domain=happyplace

Then I could mount the filesystem like:

mount -t cifs -o credentials=/home/mario/.auth "//192.168.1.50/DISK 1" /home/scarpent/nslu_test

But then everything will be owned by root, which is not much use to me. If mario’s uid=502, and gid=502, then I could do this:

mount -t cifs -o uid=mario,gid=mario,credentials=/home/mario/.auth "//192.168.1.50/DISK 1" /home/scarpent/nslu_test

which would make the files read/writable by mario and members of the group mario.

To automate all of this, put it into automount. First, make sure you have autofs installed. On Fedora systems you type:

rpm -qf /etc/auto.master

You should get an answer like

autofs-4.1.4-26

Then you need an entry in /etc/auto.master:

/mnt/smb /etc/auto.cifs

This tells the automounter that anything under /mnt/smb will be handled by it. Now the /etc/auto.cifs file should contain a line like:

nslu_test -fstype=cifs,uid=mario,gid=mario,credentials=/home/mario/.auth,file_mode=0740,dir_mode=0750 :"//192.168.1.50/DISK 1"

This all needs to be on a single line. I’m not sure how the space will work out. I usually avoid share names with spaces. Try it with and without the quotes. Finally, start the autofs daemon if it isn’t already running. In Fedora, this is

service autofs start

To make it always start, type

chkconfig autofs on

Now if you browse to /mnt/smb/nslu_test, you should see your files and be able to write to the directory. After about 5 minutes of not using the filesystem, the automounter will unmount it.

Mario Stargard
Unix Administrator

]]>
by: Scott Carpenter http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-888 Tue, 09 Jan 2007 21:14:37 +0000 http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-888 Hi, James. Thank you for the suggestion -- tried that out on Ubuntu with the same result. (Same in Fedora also.) Hi, James. Thank you for the suggestion — tried that out on Ubuntu with the same result. (Same in Fedora also.)

]]>
by: James Linden http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-887 Tue, 09 Jan 2007 19:48:30 +0000 http://www.movingtofreedom.org/2007/01/08/windows-baggage-failing-to-comprehend-network-drives-in-gnu-linux/#comment-887 Could it be as simple as mounting as a read/write device? <code>mount -t cifs -o rw,username=admin "//192.168.1.50/DISK 1" /home/scarpent/nslu_test</code> Could it be as simple as mounting as a read/write device?

mount -t cifs -o rw,username=admin "//192.168.1.50/DISK 1" /home/scarpent/nslu_test

]]>