User avatar
sav25
Posts: 364
Joined: Thu Aug 30, 2012 7:18 pm
Location: Southend-on-Sea, Essex, UK
Contact: Website Twitter

[SOLVED] SSD as Storage via USB Adapter

Wed Nov 28, 2018 3:15 pm

I bought an SSD>USB adapter after reading some posts here showing some success.

My use case is slightly different to those posts as I'm using my SSD simply as storage for music (for a Plex server). I already use a Seagate Expansion 2TB hard drive (NTFS filesystem) with my Pi with no issues - it auto-mounts perfectly and I can view/edit files directly or via FTP.

So I expected to be able to do the same with this SSD. So far I've managed to find the drive's UUID, format as ext4 and create a mount point to 'home/pi/ssd'. So far so good, but I came across an issue when I tried to manually mount:

Code: Select all

[email protected]:~ $ sudo mount /dev/sdb /home/pi/ssd -o uid=pi,gid=pi
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
dmesg | tail then shows the following relevant line, but I'm not sure what to do with that:

Code: Select all

Unrecognized mount option "uid=1000" or missing va 
Initially I decided to ignore this, to see if I could get fstab to mount the drive at boot (in the same way as the seagate - worth a punt).

This is the fstab line I used:

Code: Select all

UUID=1dfc31fb-3139-4dc2-9a04-ddca6b4497f3 /home/pi/ssd ext4 auto,nofail,noatime,users,rw,uid=pi,gid=pi 0 0
That didn't work of course, probably for the same reason the manual mount didn't work.

However, if I change that to the line below, the drive shows up with df -h (auto mounts) but I can't view files in terminal or move files via FTP:

Code: Select all

UUID=1dfc31fb-3139-4dc2-9a04-ddca6b4497f3 /home/pi/ssd ext4 auto,nofail,noatime,users,rw 0 0
All I removed was the uid=pi,gid=pi section, which I believe is the part that gives permissions. Catch 22!

What I can't work out is:
- Why is Raspbian treating an SSD (ext4) differently to my Seagate (NTFS)?
- Why does Raspbian fail to mount my SSD just because I added permissions?
- Is it to do with NTFS vs EXT4?

Any help greatly appreciated.
Last edited by sav25 on Wed Nov 28, 2018 5:20 pm, edited 2 times in total.
Averagemaker.com

User avatar
RaTTuS
Posts: 10493
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: SSD as Storage via USB Adapter

Wed Nov 28, 2018 3:18 pm

I think you really want
/dev/sdb1
not
/dev/sdb
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
sav25
Posts: 364
Joined: Thu Aug 30, 2012 7:18 pm
Location: Southend-on-Sea, Essex, UK
Contact: Website Twitter

Re: SSD as Storage via USB Adapter

Wed Nov 28, 2018 3:27 pm

RaTTuS wrote:
Wed Nov 28, 2018 3:18 pm
I think you really want
/dev/sdb1
not
/dev/sdb
Thanks for the quick reply.

I saw something similar whilst trying to find answers in Google. I don't have an sdb1, just an sdb, and I have a suspicion it's something to do with how I formatted the SSD. Let me show you.

If I mount manually with the following command (mounts but no access):

Code: Select all

sudo mount /dev/sdb /home/pi/ssd
I can then run df -h and see the following:

Code: Select all

[email protected]:~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        59G   46G   11G  81% /
devtmpfs        466M     0  466M   0% /dev
tmpfs           470M  8.0K  470M   1% /dev/shm
tmpfs           470M   13M  458M   3% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           470M     0  470M   0% /sys/fs/cgroup
/dev/mmcblk0p1   42M   23M   20M  54% /boot
/dev/sda1       1.9T  1.2T  636G  66% /home/pi/seagate
tmpfs            94M     0   94M   0% /run/user/1000
/dev/sdb        110G   61M  104G   1% /home/pi/ssd
So my Seagate drive is on sda1 as expected, but my SSD sits on sdb (not sdb1).

I'm not great with Linux filesystems so I don't know how to 'make' an sdb1. Happy to try anything though - it's an empty drive so I can't lose anything.
Averagemaker.com

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: SSD as Storage via USB Adapter

Wed Nov 28, 2018 3:29 pm

Post the output of:

1) cat /proc/partitions

2) fdisk -l

(the later needs to be run as root)
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
sav25
Posts: 364
Joined: Thu Aug 30, 2012 7:18 pm
Location: Southend-on-Sea, Essex, UK
Contact: Website Twitter

Re: SSD as Storage via USB Adapter

Wed Nov 28, 2018 3:31 pm

n67 wrote:
Wed Nov 28, 2018 3:29 pm
Post the output of:

1) cat /proc/partitions

2) fdisk -l

(the later needs to be run as root)

Ok. The cat command gives me:

Code: Select all

[email protected]:~ $ cat /proc/partitions
major minor  #blocks  name

   1        0       4096 ram0
   1        1       4096 ram1
   1        2       4096 ram2
   1        3       4096 ram3
   1        4       4096 ram4
   1        5       4096 ram5
   1        6       4096 ram6
   1        7       4096 ram7
   1        8       4096 ram8
   1        9       4096 ram9
   1       10       4096 ram10
   1       11       4096 ram11
   1       12       4096 ram12
   1       13       4096 ram13
   1       14       4096 ram14
   1       15       4096 ram15
 179        0   62367744 mmcblk0
 179        1      42805 mmcblk0p1
 179        2   62318592 mmcblk0p2
   8       16  117220824 sdb
   8        0 1953514583 sda
   8        1 1953513558 sda1
The sudo fdisk -l command gives me:

Code: Select all

[email protected]:~ $ sudo fdisk -l
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk0: 59.5 GiB, 63864569856 bytes, 124735488 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: 0x856ce77a

Device         Boot Start       End   Sectors  Size Id Type
/dev/mmcblk0p1       8192     93802     85611 41.8M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      98304 124735487 124637184 59.4G 83 Linux


Disk /dev/sdb: 111.8 GiB, 120034123776 bytes, 234441648 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


Disk /dev/sda: 1.8 TiB, 2000398933504 bytes, 3907029167 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: 0x909efc5c

Device     Boot Start        End    Sectors  Size Id Type
/dev/sda1        2048 3907029163 3907027116  1.8T  7 HPFS/NTFS/exFAT
Averagemaker.com

pws
Posts: 92
Joined: Mon Apr 11, 2016 4:16 pm

Re: SSD as Storage via USB Adapter

Wed Nov 28, 2018 3:42 pm

It is not clear why you are ignoring RaTTuS' response......

User avatar
sav25
Posts: 364
Joined: Thu Aug 30, 2012 7:18 pm
Location: Southend-on-Sea, Essex, UK
Contact: Website Twitter

Re: SSD as Storage via USB Adapter

Wed Nov 28, 2018 3:49 pm

pws wrote:
Wed Nov 28, 2018 3:42 pm
It is not clear why you are ignoring RaTTuS' response......
I replied to it - I don't appear to have an sdb1, that's my issue.

This is my first time doing anything above beginner level with Linux filesystems - maybe I'm missing something that is obvious to you guys?

On Twitter, someone suggested that I haven't actually put a partition on sdb, and that I need to try partitioning again?
Averagemaker.com

User avatar
RaTTuS
Posts: 10493
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: SSD as Storage via USB Adapter

Wed Nov 28, 2018 3:57 pm

yeah you should of partitioned the drive but you can do it without ....
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
sav25
Posts: 364
Joined: Thu Aug 30, 2012 7:18 pm
Location: Southend-on-Sea, Essex, UK
Contact: Website Twitter

Re: SSD as Storage via USB Adapter

Wed Nov 28, 2018 5:19 pm

I think this is now resolved, so I'm adding commentary here for others who may find this thread.

A friend asked me to run 'ls -al /home/pi' to see what was showing for the mount point I had set for my SSD. The SSD was showing as 'root root' which was different to the 'pi pi' that my Seagate drive was showing.

So we ran the following commands to sort out the permissions: (I was told that this isn't the 'proper' way, but that it'll work)

Code: Select all

sudo chown -R pi /home/pi/ssd
and

Code: Select all

sudo chgrp -R pi /home/pi/ssd
We then changed the fstab to the following, as supposedly the uid/gid thing only works for fat, exfat, vfat and ntfs formatted drives:

Code: Select all

/dev/sdb1 /home/pi/ssd ext4 defaults 0 2
After a reboot it's now working. The drive is mounted and I can read/write to the drive.

Thanks for the help all :)
Averagemaker.com

User avatar
startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

Re: [SOLVED] SSD as Storage via USB Adapter

Fri Nov 30, 2018 2:55 pm

I always thought SDB would be the device, and SDB1 is the partition?

Steve
Pi 2 running LibreElec Krypton, Pi 2 running Wheezy Desktop, Pi 1 headless Wheezy, downloading Radio, Pi 1 running Picore headless Media Server, Pi Zero to be an Old Time Radio Project. Pi 3 testing. Pi Zero W downloading Radio shows headless.

Return to “Troubleshooting”