davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

a noob's question: use an external USB HD for data save/load

Thu Oct 29, 2015 4:42 pm

surely 1 million times asked, but nothing explicite found by search, sorry...

the short question: is here a tutorial about external USB drives, how to setup and prepare and what ever?

the long question, if not:
how can I use an external USB HD for data save/load?
when do I have to plug it to the Pi (before start or ar any time, like for Windows, being auto-detected)?
If not autodetected: what di I have to prepare to get access to the drive (FAT32) and it's folders and files using the file manager?
will it also work for NTFS formatted drives or just for FAT?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

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

Re: a noob's question: use an external USB HD for data save/

Thu Oct 29, 2015 4:54 pm

not a million but yes
yes , depends
mount it and use it
plug it in at any time , if it has been configured right them it will auto mount
sudo mount /dev/sda1 /mount/point
it will work for all types
you really do not want to use ntfs for drives on a linux machine though [it will work but not as well]
if you are going to leave it plugged into your RPi all the time the ext[2|4] will be better [2 for flash systems 4 for real hard disks]
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

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: a noob's question: use an external USB HD for data save/

Thu Oct 29, 2015 5:01 pm

as I'm completely new to Linux:

just plug it to either Pi USB port

then enter on LX terminal
sudo mount /dev/sda1 /mount/point

exactly this way - that's it?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
DougieLawson
Posts: 37128
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: a noob's question: use an external USB HD for data save/

Thu Oct 29, 2015 5:31 pm

davenull wrote:
then enter on LX terminal
sudo mount /dev/sda1 /mount/point
If you're running the GUI it will automount a device with a valid filesystem on it. It should just "show up" in a pcmanfm (file manager) window.

Also you can't assume a device with appear as /dev/sda and the first partition as /dev/sda1. You should always check with dmesg because otherwise you could destroy your data. Also /mount needs to exist and /mount/point under it need to exist before you can mount a device on a mount point. Use /mnt or /media as they are predefined on your Raspbian systems.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: a noob's question: use an external USB HD for data save/

Thu Oct 29, 2015 6:34 pm

so the mount thing was rubbish?

- yes, Im running the GUI.

I already tried to just plug my USB drive to the Pi but I couldn't find a USB drive listed, so what's wrong? where should it be, how is it named?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

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

Re: a noob's question: use an external USB HD for data save/

Thu Oct 29, 2015 6:49 pm

davenull wrote:so the mount thing was rubbish?
Not entirely. It depends if you have an automount program installed. The normal GUI does have one.
I already tried to just plug my USB drive to the Pi but I couldn't find a USB drive listed, so what's wrong? where should it be, how is it named?
Usually it will appear under /media/XXXXXX, where XXXXXX is something that identifies that particular USB drive.

User avatar
DougieLawson
Posts: 37128
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: a noob's question: use an external USB HD for data save/

Thu Oct 29, 2015 6:50 pm

davenull wrote:so the mount thing was rubbish?

- yes, Im running the GUI.

I already tried to just plug my USB drive to the Pi but I couldn't find a USB drive listed, so what's wrong? where should it be, how is it named?
Your post wasn't rubbish, it was just incomplete.

Try this
dmesg | grep sd and you should see something like

Code: Select all

[47279.172819] sd 0:0:0:0: [sda] 4294967160 512-byte logical blocks: (2.19 TB/1.99 TiB)
[47279.173460] sd 0:0:0:0: [sda] Write Protect is off
[47279.173482] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[47279.174019] sd 0:0:0:0: [sda] No Caching mode page found
[47279.174037] sd 0:0:0:0: [sda] Assuming drive cache: write through
[47279.188017] sd 0:0:0:0: Attached scsi generic sg0 type 0
[47307.882630]  sda: sda1 sda2
[47307.885976] sd 0:0:0:0: [sda] Attached SCSI disk
which is what I got when I plugged in my Drobo (which I use for backups).

You can then mount /dev/sda1 (or in my example /dev/sda1 or /dev/sda2) on /mnt or /media
sudo mount /dev/sda1 /mnt
sudo mount /dev/sda2 /media


The automounter uses the disk label or disk UUID to create a subdirectory under /media.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: a noob's question: use an external USB HD for data save/

Thu Oct 29, 2015 7:03 pm

yes, I found it!

media/pi/[drvname]

the rest I didn't understand, but now that it's automatically listed I can save some SD card program files to my USB drive

excellent, thanks a lot!

:)
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

Return to “Raspbian”