Page 1 of 1

How to use external hard drive?

Posted: Thu Jan 08, 2015 7:45 am
by skateguy
Hi there folks. I recently purchased a raspberry pi to set-up a personal cloud. I have owncloud installed and working, but it is currently writing cloud data to the OSs sdcard. I am trying to use my seagate external drive as the new data directory for owncloud. I know I have to give permission to the hard drive before being able to use, but whenever I try and give to command it returns an error. I feel like the name is messing me. When I run

Code: Select all

lsblk
the mount id is /media/Seagate Expansion Drive_. If I run

Code: Select all

sudo chown -R www-data:www-data /media/Seagate Expansion Drive_
it will say it is not valid or something like that, Even when running the command with underscores for the spaces. I can't give definite answers because I'm not in front of pi at the moment and it's turned off so no ssh until tomorrow. Any suggestions?

Re: How to use external hard drive?

Posted: Thu Jan 08, 2015 8:15 am
by rpdom
File names with spaces in either need to be enclosed in quotes or have the spaces "escaped" with backslashes (\).

Code: Select all

sudo chown -R www-data:www-data "/media/Seagate Expansion Drive_"
sudo chown -R www-data:www-data /media/Seagate\ Expansion\ Drive_
That will work if your external drive is formatted with a Linux file system, like ext4. If it uses a non-Linux file system like FAT32/VFAT or NTFS, then the permissions will not be changeable like that as they do not support Linux file permissions. You would need to change the entry (or add one) in /etc/fstab.

Re: How to use external hard drive?

Posted: Thu Jan 08, 2015 9:05 am
by skateguy
rpdom wrote:File names with spaces in either need to be enclosed in quotes or have the spaces "escaped" with backslashes (\).

Code: Select all

sudo chown -R www-data:www-data "/media/Seagate Expansion Drive_"
sudo chown -R www-data:www-data /media/Seagate\ Expansion\ Drive_
That will work if your external drive is formatted with a Linux file system, like ext4. If it uses a non-Linux file system like FAT32/VFAT or NTFS, then the permissions will not be changeable like that as they do not support Linux file permissions. You would need to change the entry (or add one) in /etc/fstab.
Thanks so much! I have been running circles trying to figure this out. It is using NTFS file system. Lets hope once I add it to /etc/fstab that owncloud will allow access to it. So once I add it to the fstab I shouldn't have to do any permission entries? If I partitioned the drive into 2 file systems, NTFS and ext4, would I be able to give permissions to the ext4 directory without adding it to the fstab even though it is being managed through the external drive?

Re: How to use external hard drive?

Posted: Thu Jan 08, 2015 9:17 am
by RaTTuS
ext[234] performs much better on linux than NTFS -
but yes if you re- partition1 then no worries

Re: How to use external hard drive?

Posted: Thu Jan 08, 2015 9:28 am
by skateguy
RaTTuS wrote:ext[234] performs much better on linux than NTFS -
but yes if you re- partition1 then no worries
Yes I read that NTFS performs much slower. This is for my friend though who isn't computer savvy. Thats why I was considering partitioning to half NTFS and half ext4, that way it will work on his pi, and he could also copy the files directly to his windows laptop. This hard drive is only going to be used for his cloud storage, so do you think the slow performance of NTFS will matter?

Re: How to use external hard drive?

Posted: Thu Jan 08, 2015 9:30 am
by RaTTuS
if it is only ever be plugged into the RPi then use ext4, if you want to plug it into a windows box also then use ntfs -

Re: How to use external hard drive?

Posted: Thu Jan 08, 2015 9:32 am
by ghans
2 partitions don't make sense since Windows still can't read
whatever is on the ext4 one.

Instead of using chown read up on mount options :

http://askubuntu.com/questions/429848/d ... nt-options

mount options are the same for /etc/fstab and a direct mount
command.


ghans