 |
Linux Format forums Help, discussion, magazine feedback and more
|
| View previous topic :: View next topic |
| Author |
Message |
andrewt
Joined: Sun Jan 20, 2013 6:20 pm Posts: 4
|
Posted: Tue Jan 22, 2013 12:07 am Post subject: Raspberry Pi as a file server |
|
|
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? |
|
| Back to top |
|
 |
Dutch_Master LXF regular
Joined: Tue Mar 27, 2007 2:49 am Posts: 2353
|
Posted: Tue Jan 22, 2013 12:33 am Post subject: |
|
|
| Post the contents of the file /etc/fstab (use the code tags!) |
|
| Back to top |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 8000 Location: Warrington, UK
|
Posted: Tue Jan 22, 2013 11:03 am Post subject: |
|
|
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. _________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
andrewt
Joined: Sun Jan 20, 2013 6:20 pm Posts: 4
|
Posted: Thu Jan 24, 2013 1:25 pm Post subject: Raspberry Pi as a file server |
|
|
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: |
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: |
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: |
[ 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
|
|
|
| Back to top |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 8000 Location: Warrington, UK
|
Posted: Thu Jan 24, 2013 2:17 pm Post subject: |
|
|
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. _________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
andrewt
Joined: Sun Jan 20, 2013 6:20 pm Posts: 4
|
Posted: Thu Jan 24, 2013 7:14 pm Post subject: Raspberry Pi as a Fileserver |
|
|
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? |
|
| Back to top |
|
 |
andrewt
Joined: Sun Jan 20, 2013 6:20 pm Posts: 4
|
Posted: Sun Feb 03, 2013 1:00 pm Post subject: Fix found for running samba on the Pi |
|
|
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
 |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|