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.
The device is found at startup:
00:00:10.079 [info] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
00:00:10.079 [info] usb 2-1: New USB device found, idVendor=0bc2, idProduct=ab30, bcdDevice= 1.08
00:00:10.079 [info] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
00:00:10.079 [info] usb 2-1: Product: BUP RD
00:00:10.079 [info] usb 2-1: Manufacturer: Seagate
00:00:10.081 [info] usb 2-1: SerialNumber: NA9F8S18
I’m trying to mount it as /dev/sda1 . Trying /dev/sdb1 (since the usb designation is 2-1) doesn’t yield anything.
Does it need to be f2fs ? Thats seems like it’s for flash devices. Is it OK to format a USB HD like that? I would prefer expat so I can mount it on a mac if needed.
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).
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.