stwf

stwf

Mount USB hard drive on boot

I’m trying to mount a USB hard drive on my nerves device at boot, I am using a custom system, so I have some flexibility.

But I’ve tried adding a -m directive to my erlinit.config as well as just mounting it in my application and it isn’t working.

If I am mounting to /root/uns/ does the filesystem on the USB drive have to match the file system on the card?

I added the ExFat and ExFat utilities to my system, and I tried using exfat as a disk format, and others. What disk format should I be using?

Any other ideas are welcome. My goal is to get postgres and influx installed and saving their data to the USB drive as well as a Phoenix app that can store uploads there.

Thanks in advance!

Most Liked

fhunleth

fhunleth

Co-author of Nerves

It doesn’t need to be F2FS. When you don’t specify a filesystem format, mount tries the filesystems that are available and F2FS is particularly verbose.

Try passing the filesystem type that you want to mount by using -t option.

You can get the list of available filesystem drivers by reading /proc/filesystems. If you don’t see the one that you want, you’ll need to update the Linux kernel configuration to included it. I’m pretty sure that vfat is what you want and that should already be enabled.

Also, as you noticed erlinit runs way too early in the boot process and Linux hasn’t enumerated the USB drive yet. Mounting filesystems in erlinit is really only intended for pseudo filesystems (like those under /sys) and things needed before any Elixir code is run (like the application partition so that the the command line history file can be initialized or read).

krgnn

krgnn

For posterity: after lots of playing around, I realized that I had created the USB sticks with a gpt partition table. After switching the disk to trusty MBR + exFAT code (07 in fdisk), and creating the disk using mkfs.vfat mounting worked. IMO the base images should include support for GPT partition tables though!

gBillal

gBillal

Finally, I was able to mount the hard drive. There’s an issue related to version or architecture differences between x86_64 and arm64. I cross-compiled the e2fsprogs, copied the mkfs.ext4 to the nerves image, formatted the hard drive and I was about to mount it without any issue.

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42842 311
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52238 488
New
nobody
Hi! In PHP: $SERVER['SERVERADDR'] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New

We're in Beta

About us Mission Statement