Mounting SSD storage (Jetson tx2)


#1

Hi,

I am trying to mount a SSD storage following the instruction in documents and the following topic,

I am using systemd and have enabled DBUS_SYSTEM_BUS_ADDRESS using the dashboard Device Configuration. The path for SSD is /dev/sda1. Here is my mount service,

[Unit]
Description = External SSD Drive

[Mount]
What = /dev/sda1
Where = /mnt/storage
Type = ext4
Options = rw,relatime,data=ordered

[Install]
WantedBy = multi-user.target    

and in Dockerfile INISYSTEM is set to on,

#Enable container init system.
ENV INITSYSTEM on

#External storage
COPY mnt-storage.mount /etc/systemd/system/mnt-storage.mount
RUN systemctl enable /etc/systemd/system/mnt-storage.mount  

I am not sure what I am missing since the SSD never gets mounted and the /mnt/storage path never gets created. The mount service is copied to the correct location,

:/etc/systemd/system# ll
total 28
drwxr-xr-x 1 root root 4096 Jan 10 19:51 ./
drwxr-xr-x 1 root root 4096 Dec 18 05:50 ../
drwxr-xr-x 2 root root 4096 Dec 18 05:49 getty.target.wants/
-rw-rw-r-- 1 root root  174 Jan 10 19:47 mnt-storage.mount
drwxr-xr-x 1 root root 4096 Jan 10 19:51 multi-user.target.wants/
lrwxrwxrwx 1 root root   31 Jan  9 23:07 sshd.service -> /lib/systemd/system/ssh.service
drwxr-xr-x 2 root root 4096 Dec 18 05:49 sysinit.target.wants/
drwxr-xr-x 2 root root 4096 Dec 18 05:50 timers.target.wants/

also symlink is created,

Created symlink /etc/systemd/system/multi-user.target.wants/mnt-storage.mount, pointing to /etc/systemd/system/mnt-storage.mount.

running systemctl status command returns not found error,

systemctl status mnt-storage.mount
● mnt-storage.mount
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

also tried to start the service in container and again returned not found error,

systemctl start  mnt-storage.mount
Failed to start mnt-storage.mount: Unit mnt-storage.mount not found.

What is incorrect in my configuration?

Thanks!


#4

Hi there,
What version of balenaOS and device type?
What is the output of systemd-analyze verify test-storage.mount.?


#5

Thank you for your response.
Device type: Nvidia Jetson TX2 (BETA)
Host OS Version: balenaOS 2.29.0+rev1

Here are the outputs,

root@xxxx:/# systemd-analyze verify test-storage.mount.
Failed to prepare filename test-storage.mount.: Invalid argument
root@xxxx:/# systemd-analyze verify mnt-storage.mount.
Failed to prepare filename mnt-storage.mount.: Invalid argument
root@xxxx:/# systemd-analyze verify /etc/systemd/system/mnt-storage.mount
root@xxxx:/#

#6

Hi Farzad,

I’m not 100% certain but I think the mountpoint has to exist. Can you try adding RUN mkdir -p /mnt/storage to your Dockerfile?


#7

Hi wrboyce,

tried it with existing mountpoint and it didn’t wok :frowning:.

Apparently, the service is enabled,

root@xxxxx:/# systemctl list-unit-files
UNIT FILE                                  STATE
proc-sys-fs-binfmt_misc.automount          static
dev-hugepages.mount                        static
dev-mqueue.mount                           static
mnt-storage.mount                          enabled
proc-sys-fs-binfmt_misc.mount              static
sys-fs-fuse-connections.mount              static
....

#8

Ah, damn, worth a try I guess!

I’m stabbing in the dark a bit here, can you show me the output of systemctl status mnt-storage.mount and journalctl -ab -u mnt-storage.mount please?

What happens if you manually start the service (systemctl start mnt-storage.mount)?


#9

here are the outputs,

root@xxxx:/# systemctl start mnt-storage.mount
Failed to start mnt-storage.mount: Unit mnt-storage.mount not found.

root@xxxx:/# systemctl status mnt-storage.mount
● mnt-storage.mount
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

root@xxxx:/# journalctl -ab -u mnt-storage.mount
No journal files were found.
-- No entries --

thank you for your time!


#10

Hmm… How about if you try and mount the drive manually?

mount -t ext4 -o rw,relatime,data=ordered /dev/sda1 /mnt/storage


#11

That’s the interesting thing I forgot to mention. I can manually mount the storage and use the storage. So the mount command works fine.


#12

Right, so its definitely systemd then (surprise surprise!). Bit of a long shot, but have you tried a systemctl daemon-reload? I don’t think it should be necessary, but at this point I’d say it is worth a try!


#13

The service is still inactive.

I guess a solution would be to add mounting command into startup script but I am more interested to know what is incorrect in my configuration.


#14

I’m going to dig out a usb drive and try this with a device I’ve got here, it is puzzling me now. I’ll let you know how I get on.


#19

Farzad, can you just confirm for me which base image you’re using so I know we’re both singing from the same hymn sheet?

Cheers.


#25

arm64v8/ros:kinetic-ros-base-xenial is our base image

I can share the dockerfile with you if you need it.

thanks you!


#26

Hi @wrboyce ,

Did you get a chance to look into this issue?

thank you !