Beginners Guide: Adding USB Storage, Linux Formatting and Permissions
#1
Information 
In this guide, I will be going through how to add USB storage to your Board: 

Confirm that the drive is recognized by Linux 

Formatting the drive for Linux use 

Mounting the Partition/FS

Setting appropriate directory and file permissions. 





Prerequisites: 

Rock64 running Debian/Ubuntu 

Local access or SSH access

USB Drive  

I would highly suggest reading through this to understand the basics of using the Linux terminal: 

https://www.howtogeek.com/140679/beginne...-terminal/



Confirm that the drive is recognized by Linux 




The first step is pretty obvious, plug in the USB drive into your Board: 

[Image: CB3Uoyp.jpg]

I know my ethernet cable termination is horrendous, I'm getting it fixed soon. 

Hopefully by now you'll have some idea how to SSH into your device. SSH into the device or open up a terminal. 


There are two quick ways we can confirm that the USB drive is "recognized" by the system. The first is issuing the command lsblk - List Block devices: 

Code:
lsblk

Running it on your board should show something similar to the following: 
Code:
rock64@rock64:~$ lsblk 
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    1 14.9G  0 disk 
└─sda1        8:1    1 14.9G  0 part 
mmcblk1     179:0    0 29.8G  0 disk 
├─mmcblk1p1 179:1    0  3.9M  0 part 
├─mmcblk1p2 179:2    0   64K  0 part 
├─mmcblk1p3 179:3    0    4M  0 part 
├─mmcblk1p4 179:4    0    4M  0 part 
├─mmcblk1p5 179:5    0    4M  0 part 
├─mmcblk1p6 179:6    0  112M  0 part /boot/efi
└─mmcblk1p7 179:7    0 29.7G  0 part /

[Image: 9yATeZM.png]
If you had ran the lsblk command before plugging in the USB device, you'd have only seen entries under "mmcblk1". This shows the boot MicroSD card and its various partitions. 
Usually a newly plugged in USB drive shows up as sdX with X being a letter. In this case it's sda but it could also be sdb or sdc depending on your configuration. The numbers after the letters demarcate the various partitions present on the device. 
To see more details about the device and partition, invoke the "fdisk -l" command with the block device (sda in this case) as an argument. You will need superuser access for this, simply insert your password to give it access: 
Code:
sudo fdisk -l /dev/sda

Code:
rock64@rock64:~$ sudo fdisk -l /dev/sda
Disk /dev/sda: 14.9 GiB, 16008609792 bytes, 31266816 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: gpt
Disk identifier: 7C4E0E7E-888C-48C6-AC55-A3F6D3F37E2B

Device     Start      End  Sectors  Size Type
/dev/sda1   2048 31264767 31262720 14.9G Microsoft basic data
This shows that our device (the flashdrive) has a capacity of 14.9 GiB (or 15.99 GB). The sector size is 512 bytes long, and it has one partition, "Microsoft basic data" which is know is a FAT partition. 




You dont need to list your block device as an argument, it just makes the output less cluttered. If you simply used "fdisk -l" it would print out information about all recognized devices: 
[Image: N6wkkua.png]
  Reply


Messages In This Thread
Beginners Guide: Adding USB Storage, Linux Formatting and Permissions - by Ptheven - 08-15-2017, 07:22 AM
Formatting the drive for Linux use - by Ptheven - 08-15-2017, 08:23 AM
Mounting the Partition/Filesystem - by Ptheven - 08-15-2017, 09:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginners Guide: Migrating to SSD rontant 18 40,356 01-19-2022, 09:30 AM
Last Post: Ellesar Dragon
  Step by step guide PXE diskless configuration. burglar_ot 13 36,083 11-01-2020, 11:26 PM
Last Post: michael.gruner
Thumbs Up A guide for how I made RetroPie, RetroArch, and EmulationStation Work on the Rock64 Mrfixit2001 4 16,221 12-17-2018, 03:52 AM
Last Post: va88
  Guide - XRDP - Debian Stretch / Ubuntu Xenial / OMV S3phi40T 3 14,070 05-05-2018, 06:08 AM
Last Post: S3phi40T
Information Guide - Raid Array (Raid 0) Ptheven 0 4,864 10-07-2017, 09:22 AM
Last Post: Ptheven
Information Guide - Setting up a NFS Share Ptheven 0 5,533 09-26-2017, 04:44 AM
Last Post: Ptheven
  Guide - Setting up a SMB(Windows) file server Ptheven 0 12,664 08-21-2017, 08:54 AM
Last Post: Ptheven
Information Beginners Guide: Locating your board, connecting to it. Ptheven 5 16,055 08-21-2017, 04:12 AM
Last Post: Ptheven

Forum Jump:


Users browsing this thread: 1 Guest(s)