Raspberry Pi as a file server

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Raspberry Pi as a file server

Postby andrewt » Tue Jan 22, 2013 12:07 am

Help! I'm following the article in LXF160 about setting up my Pi as a fileserver. I'm connecting to two usb drives (via a powered hub), but am getting problems with both.

The older one (a 160 gigabyte Classic SL drive from Freecom) does allow me to change directory to its mount point, but won't allow me to change ownership (responds with 'chown: changing ownership of `/mnt/share1': Operation not permitted')

The newer one (a 750 gigabyte My Passport 0740 from Western Digital) won't allow me change directory to its mount point (responds with ''-bash: cd: share2: Permission denied", but does list the files in attempting to change file ownership list, responding with 'chown: changing ownership of `/mnt/share2': Read-only file system'

... and then when I come to trying to use the smbpasswd command to add a linux user account to samba, I get the response '-bash: smbpasswd: command not found'.

I'm using the Raspian operating system.

Can anyone out there help?
andrewt
 
Posts: 4
Joined: Sun Jan 20, 2013 6:20 pm

Postby Dutch_Master » Tue Jan 22, 2013 12:33 am

Post the contents of the file /etc/fstab (use the code tags!)
Dutch_Master
LXF regular
 
Posts: 2471
Joined: Tue Mar 27, 2007 1:49 am

Postby nelz » Tue Jan 22, 2013 11:03 am

Please post the output from "mount", using code tags as DM asked. I suspect the first is caused by a filesystem that doesn't support permissions, like FAT, while the second sounds like the filesystem is mounted read-only, make an NTFS filesystem mounted using the kernel driver.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Raspberry Pi as a file server

Postby andrewt » Thu Jan 24, 2013 1:25 pm

Hello Dutch_Master and nelz. Thank you for your responses :)

I've posted fstab and mount info below.

I've also posted the bits of the dmesg output from which I got the drive allocations.


Here is the fstab file
Code: Select all
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
/dev/sda1       /mnt/share1     vfat    defaults          0       0
/dev/sdb1       /mnt/share2     ntfs    defaults          0       0
# a swapfile is not a swap partition, so no using swapon|off from here on, use $




... and here is the output from "mount"

Code: Select all
pi@raspberrypi ~ $ mount
/dev/root on / type ext4 (rw,noatime,user_xattr,barrier=1,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=224436k,nr_inodes=56109,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=44900k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=89780k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro)


... and finally, here are the lines from the dmesg output
Code: Select all
[    4.454204] scsi 0:0:0:0: Direct-Access     WD       My Passport 0740 1003 PQ: 0 ANSI: 6
[    4.494805] scsi 0:0:0:1: Enclosure         WD       SES Device       1003 PQ: 0 ANSI: 6
[    4.508750] sd 0:0:0:0: [sda] 1465081856 512-byte logical blocks: (750 GB/698 GiB)
[    4.543868] sd 0:0:0:0: [sda] Write Protect is off
[    4.551173] sd 0:0:0:0: [sda] Mode Sense: 47 00 10 08
[    4.574119] sd 0:0:0:0: [sda] No Caching mode page present
[    4.582102] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    4.625874] sd 0:0:0:0: [sda] No Caching mode page present
[    4.649659] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    4.748419] scsi 1:0:0:0: Direct-Access     WDC WD16 00BB-00GUC0      0000 PQ: 0 ANSI: 0
[    4.794778] sd 1:0:0:0: [sdb] 312581808 512-byte logical blocks: (160 GB/149 GiB)
[    4.832068] sd 1:0:0:0: [sdb] Write Protect is off
[    4.854160] sd 1:0:0:0: [sdb] Mode Sense: 27 00 00 00
[    4.855466] sd 1:0:0:0: [sdb] No Caching mode page present
[    4.877176] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[    4.907060] sd 1:0:0:0: [sdb] No Caching mode page present
[    4.907085] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[    4.930491]  sdb: sdb1
[    4.934944] sd 1:0:0:0: [sdb] No Caching mode page present
[    4.934969] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[    4.934986] sd 1:0:0:0: [sdb] Attached SCSI disk
andrewt
 
Posts: 4
Joined: Sun Jan 20, 2013 6:20 pm

Postby nelz » Thu Jan 24, 2013 2:17 pm

mount shows nothing mounted on /mnt/share[12] but your fstab listing confirms what I suspected about the filesystems. You cannot change ownership on a FAT filesystem, it has no concept of ownership.

The in-kernel NTFS driver only allows reading by default, writing is disabled for a very good reason - it breaks things. The solution is to blacklist the ntfs module and install ntfs-3g, a FUSE filesystem that does support reliable writing.

A better solution, as you are running a Linux file server, is to use proper Linux filesystems like ext4 instead of trying to shoehorn in alien choices. The only reason for using these filesystems would be if you want to be able to unplug the drivers from the file server and connect them directly to a Window box, which rather misses the point of a file server.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Raspberry Pi as a Fileserver

Postby andrewt » Thu Jan 24, 2013 7:14 pm

Thanks again nelz!

I will take your advice and reformat the NTFS one to ext4 once I've found somewhere to copy the files already on that device.

Meanwhile, I've sorted the 'mount' problem (I'd got the VFAT and NTFS formats the wrong way round in fstab, doh!) so I should now be able to share the VFAT drive using samba.

Can you help me with my samba problem too? I've installed the latest verson of samba (sudo apt-get install samba), when I try to run the smbpasswd command that Graham suggests, I get the response '-bash: smbpasswd: command not found'.

Any idea what I'm doing wrong this time?
andrewt
 
Posts: 4
Joined: Sun Jan 20, 2013 6:20 pm

Fix found for running samba on the Pi

Postby andrewt » Sun Feb 03, 2013 1:00 pm

I've found the problem. Using 'sudo aptitude search' I got a listing of the installed packages in my Pi, and compared with the equivalent listing on my (Mint14) netbook. Lo and behold, the obvious difference was that the 'samba-common-bin' package was missing from my Pi.

So, I've done a 'sudo apt-get install samba-common-bin' on my Pi, and I can now run the 'smbpasswd' command.

Thought I'd provide this update, just in case anyone else is having the same difficulties

:)
andrewt
 
Posts: 4
Joined: Sun Jan 20, 2013 6:20 pm


Return to Help!

Who is online

Users browsing this forum: Exabot [Bot] and 0 guests