Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Raspberry Pi as a file server

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
andrewt



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

PostPosted: Tue Jan 22, 2013 12:07 am    Post subject: Raspberry Pi as a file server Reply with quote

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
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2430

PostPosted: Tue Jan 22, 2013 12:33 am    Post subject: Reply with quote

Post the contents of the file /etc/fstab (use the code tags!)
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8455
Location: Warrington, UK

PostPosted: Tue Jan 22, 2013 11:03 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
andrewt



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

PostPosted: Thu Jan 24, 2013 1:25 pm    Post subject: Raspberry Pi as a file server Reply with quote

Hello Dutch_Master and nelz. Thank you for your responses Smile

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
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8455
Location: Warrington, UK

PostPosted: Thu Jan 24, 2013 2:17 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
andrewt



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

PostPosted: Thu Jan 24, 2013 7:14 pm    Post subject: Raspberry Pi as a Fileserver Reply with quote

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
View user's profile Send private message
andrewt



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

PostPosted: Sun Feb 03, 2013 1:00 pm    Post subject: Fix found for running samba on the Pi Reply with quote

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

Smile
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
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
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast