mindwave
Posts: 36
Joined: Mon Aug 29, 2011 5:24 pm
Contact: Website

mounting USB 1TB drive

Wed Dec 27, 2017 2:05 am

OK, 1st off i have been using linux as my sole OS for about 10 years, I have several HUGE holes in my education the majority of which revolve around users rights and external hard drives. Im hoping you can help what SHOULD be a simple issue?

Not trying to reinvent the RASPI based wheel so Im following: http://www.instructables.com/id/Raspber ... -MiniDLNA/

because the other 2 NAS drives I have both use dlna and it seems pretty bullet proof.

using these instructions however some things are not exact: for example when I get to STEP 3 and run fdisk -l I get something SIMILAR but not exact to whats in his screenshot
RASPI1.jpg
RASPI1.jpg (43.23 KiB) Viewed 3383 times
BUT where he has :

/dev/sda1 2048 1TB etc.......

I dont have anything.

HOWEVER, in one case I did try this with 2 USB drives plugged in, the 1TB I want to use, and a 3TB passport, that Im using to move files from one pc to the RASPI.

again: sudo fdisk -l

displays EVERYTHING for the passport like the example in the screenshot, INCLUDING the part at the bottom thaT SAYS||: //dev/sda1 etc......

for the PASSPORT,

but in reference to the 1TB drive I want to USE its only showing the 1 line in the top of the display : /dev/sda 1000.0 GB etc.....

so I TRY and insert the line into the /etc/fstab just like it says.

BEFORE I change anything my fstab looks like this:

proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that


AFTER I insert the line as I THINK it should read, it reads like THIS:


proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
/dev/sdb /media/HDD1 vfat defaults 0 2


FYI the directory that I created in his STEP 4 where he says to use: sudo mkdir /media/HDD

I instead used: sudo mkdir /media/HDD1


so then I reboot and it freezes, and this is whats on the screen:
RASPI1.jpg
RASPI1.jpg (43.23 KiB) Viewed 3383 times
no matter what I do I cant boot, cant get to desktop or cli. so I cant pull the logs

I take the sd card out of the RASPI re edit the fstab back to normal and its all working well

dont know if iots required, but I DID install ntfs-3g

additionally despite having read several books on the subject SAMBA eludes me as well :(

I run the endoscopy Application as well as the Applications that serve 10,000 people a day at the largest healthcare facilioty in our area.

but THIS, THIS has ALWAYS sent me spinning in circles............................

any and all assistance would be appreciated.
Attachments
RASPI3.jpg
RASPI3.jpg (179.22 KiB) Viewed 3383 times

smm
Posts: 23
Joined: Thu May 19, 2016 12:05 pm
Location: OF78wb

Re: mounting USB 1TB drive

Wed Dec 27, 2017 9:33 am

You edited your fstab as follows: -

Code: Select all

proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
/dev/sdb /media/HDD1 vfat defaults 0 2
But you say your disk shows up as: -
but in reference to the 1TB drive I want to USE its only showing the 1 line in the top of the display : /dev/sda 1000.0 GB etc.....
Shouldn'y your fstab be: -
/dev/sda /media/HDD1 vfat defaults 0 2

Maybe?

User avatar
DougieLawson
Posts: 39806
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: mounting USB 1TB drive

Wed Dec 27, 2017 10:56 am

There's a fatal flaw. You can't have a 1TB FAT32 drive. It needs to be EXFAT, NTFS or ext2,ext3 or ext4.

If it's only ever going to be used with your RPi then re-format as ext4.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

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

Re: mounting USB 1TB drive

Wed Dec 27, 2017 11:22 am

DougieLawson wrote:
Wed Dec 27, 2017 10:56 am
There's a fatal flaw. You can't have a 1TB FAT32 drive.
FAT32 with LBA (type 0x0c) has a maximum volume size of 2TB.

User avatar
thagrol
Posts: 3508
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: mounting USB 1TB drive

Wed Dec 27, 2017 1:00 pm

Some stuff to try:

Does

Code: Select all

lsusb
show your 1TB drive?

What does

Code: Select all

ls /dev/sd*
show with the drive connected?

You'd normally mount a partition not an entire drive so "/dev/sda1" rather than "/dev/sda" but:

Mounting USB drives by device node (/dev/sd??) is unreliable as the node can change across boots especially if drives are added or removed. Mounting by UUID is more reliable, you can get that by

Code: Select all

sudo blkid

To avoid the boot hang, try adding "nofail" to the mount options for the drive.
Arguing with strangers on the internet since 1993.

mindwave
Posts: 36
Joined: Mon Aug 29, 2011 5:24 pm
Contact: Website

Re: mounting USB 1TB drive

Wed Dec 27, 2017 6:57 pm

OK, well once again the forum community has demoinstrated WHY I shouldnt work past 2200.

SMM not only were you right on target, but after taking a break and going back after readiung everyones replies I checked a little detail that filled in a LOT of the details for me.

well that AND plugging in ANOTHER USB HD to see what THAT one displayed.

Funny thing, not ONLY did it display the proper "1st line" as in the instructions and example for minidlna where its shows: /dev/sdb ....etc
but THEN it ALSO went on to display the "2nd line" down at the bottom that says : /dev/sdb1....etc

So then I KNEW something VERY basic was wrong, so I loaded gparted and looked at both the drives only to find that the 1TB that I had been treating as VFAT was actually EXT4, and the NEW drive I plugged in (A 4TB USB) was NTFS.....

Ok, so NOW I believe I know how to deal with drive #2

BUT what do I need to make the first drive, 1TB ext4, mount properly and display properly under minidlna.

anyone know?

again, drive sharing across networks has been my one HUGE weakness, its why I have a whole network team at the hospital that deals with that for me!

Thanks for all you great replies, really a lot of great information

J

User avatar
DougieLawson
Posts: 39806
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: mounting USB 1TB drive

Wed Dec 27, 2017 7:31 pm

Here's how to do it

Code: Select all

pi@eagle ~ $ sudo fdisk /dev/sda

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x83b2a35c

Device     Boot  Start       End   Sectors  Size Id Type
/dev/sda1         2048    133119    131072   64M  b W95 FAT32
/dev/sda2       133120 312581807 312448688  149G 83 Linux

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-312581807, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-312581807, default 312581807):

Created a new partition 1 of type 'Linux' and of size 149.1 GiB.
Partition #1 contains a vfat signature.

Do you want to remove the signature? [Y]es/[N]o: y

The signature will be removed by a write command.

Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 83
Changed type of partition 'Linux' to 'Linux'.

Command (m for help): w
Then when you have a new partition on that drive, use sudo mke2fs /dev/sda1 to turn it into an ext4 partition.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

mindwave
Posts: 36
Joined: Mon Aug 29, 2011 5:24 pm
Contact: Website

Re: mounting USB 1TB drive

Thu Dec 28, 2017 2:45 am

right, got one as an ext4 drive, actually it akways was, I just forgot to check.....

now again, much as I love 'nix samba has never come naturally to me, normally after a HREAT deal pf following this example or that, trying THIS amazing new tool set. pr that simplified script, I will poke it with a scripy enough to get it to work/

BUT because I never get from point A to B in a straight line I always take the longestfg route, because I cant remember!

any simoplified instructions. especially as it may relate to minidLna ?

I'll try just about anything.
\
I really do want to leran the proper wayt, I just dont have anywhere I can go and leaern from step- 1

:)

Return to “Raspberry Pi OS”