User avatar
skateguy
Posts: 6
Joined: Sun Dec 28, 2014 4:42 pm
Location: Raleigh NC, US

How to use external hard drive?

Thu Jan 08, 2015 7:45 am

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?

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to use external hard drive?

Thu Jan 08, 2015 8:15 am

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.

User avatar
skateguy
Posts: 6
Joined: Sun Dec 28, 2014 4:42 pm
Location: Raleigh NC, US

Re: How to use external hard drive?

Thu Jan 08, 2015 9:05 am

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?

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: How to use external hard drive?

Thu Jan 08, 2015 9:17 am

ext[234] performs much better on linux than NTFS -
but yes if you re- partition1 then no worries
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
skateguy
Posts: 6
Joined: Sun Dec 28, 2014 4:42 pm
Location: Raleigh NC, US

Re: How to use external hard drive?

Thu Jan 08, 2015 9:28 am

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?

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: How to use external hard drive?

Thu Jan 08, 2015 9:30 am

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 -
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: How to use external hard drive?

Thu Jan 08, 2015 9:32 am

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
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “Troubleshooting”