JSP007
Posts: 6
Joined: Mon Feb 16, 2015 8:09 am

Adding a USB drive

Mon Feb 16, 2015 8:20 am

Hello,
Newbie here... I have searched the Forum and the FAQs but did not find an answer.

I want to connect an USB drive (250 Gbyte) to the Pi but I have to format it for Raspbian which I have tried. I can see the disk in File Manager but it does not allow me to put files on it (Permissions).
I have a Mac and can format the drive for MS-DOS Fat, if necessary.

I would like to see a step by step instruction a--z about what to do.

Thank you very much for any pointers in the right direction.

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Adding a USB drive

Mon Feb 16, 2015 10:51 am

if you type
mount
and find in the long list
/dev/sdb1 on /media/MYDRIVE type ntfs (ro ....

do a
sudo apt-get install ntfs-3g
and i just also do a
sudo reboot
mount
i see
/dev/sdb1 on /media/MYDRIVE type fusectl (rw ....

cp AFILE /media/MYDRIVE/ for test

p.s. but first i had a other problem,
drivename was "Iomega HDD"
that " " in the name was not good even for just for read by
ls -la /media/Iomega HDD/ give me a error about Iomega not exist..
so i changed the name ( in win7 drive properties )

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

Re: Adding a USB drive

Mon Feb 16, 2015 10:59 am

Ideally you have the drive formatted for ext4 (for Linux use only).

To change the permissions once it has been mounted, you could "sudo chmod +rwx /mount_pont" where "/mount_pont" is the directory the drive is mounted in (and I have a keyboard that badly needs cleaning - it's usually the "s" key that sticks, not the "i" :( ).

Code: Select all

pi@raspi:~ $ sudo chmod +rwx /media/USB001
Alternatively you could change the ownership of the directory to the user "pi" with "sudo chown pi /mount_point".

Code: Select all

pi@raspi:~ $ sudo chown pi /media/USB001

JSP007
Posts: 6
Joined: Mon Feb 16, 2015 8:09 am

Re: Adding a USB drive

Mon Feb 16, 2015 3:51 pm

Many thanks for the posts that seem to address my question... but they do not help because I cannot see the hard drive.

For a beginner, there must be steps before ["If you see..." ] and those are essential.
Another kind post writes "Ideally..." but again, the world is far from ideal. ;-)
I cannot see my hard drive at all. That is the real problem, I guess.
That is why I think I should format it.

Can I do any formatting on the Pi itself or should I use some other computer? I do not have linux but the inner workings of the Mac OS X is unix.

A recipe a -- z would be greatly appreciated (from "no HDD is seen" to "Now that you see the HDD").

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Adding a USB drive

Mon Feb 16, 2015 6:52 pm

Recently I added a 1TB USB drive which I formatted with ext4.
To do this (from memory) use the following bold commands as root:
sudo su > become root
fdisk -l > will show you all devices on the system

From the list, locate the USB drive. It is likely to be /dev/sda or /dev/sdb.
For the sake of this example, lets assume /dev/sda.
Then proceed to create the partition:
fdisk /dev/sda
n > new partition
p > primary
1 > create /dev/sda1
> Accept the default values for the rest [enter, enter]
w > exit fdisk while writing the operations to the disk.

This gives you a partition with the size of your USB drive. Now all you need to do is format the new partition:

Code: Select all

mke2fs -t ext4 /dev/sda1
Finally you may want to tweak the amount of space reserved for root (5% by default)
This is optional and can be done with tune2fs Please check the details of that command for yourself. 8-)

You will probably find the following link helpful:
http://tldp.org/HOWTO/Partition/fdisk_partitioning.html

/emgi

JSP007
Posts: 6
Joined: Mon Feb 16, 2015 8:09 am

Re: Adding a USB drive

Tue Feb 17, 2015 7:19 pm

Thank you very much, I think this solved my problem. I can see the Hard drive and can copy files into it.
Awesome. I am a very happy customer ;-)

jockbond
Posts: 1
Joined: Tue Apr 21, 2015 2:36 pm
Location: Philippines

Re: Adding a USB drive

Tue Apr 21, 2015 3:56 pm

Exactly what I need to know for my project. The tlpd.org website very good reading.

Can someone recommend best file system to use on my 1TB USB device?

My RPi2 has a 16GB SD installed with Raspbian. This is what I use to prepare the USB device.

The USB device will be full of movie content for OSMC which is installed on an 8GB SD card.
A beginner. Using RPi2 with OSMC. Using same RPi2 with Raspbian to learn LINUX.

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Adding a USB drive

Tue Apr 21, 2015 7:37 pm

If you are only using it with Linux, the best would be ext4 which supports the fastest speeds.
There are 10 types of people: those who understand binary and those who don't.

Return to “Beginners”