samhh / dotfiles

Configuring the universe with Nix.
49 stars 2 forks source link

Auto-mount second SSD & NAS #79

Closed samhh closed 4 years ago

samhh commented 4 years ago

SSD was easy, just an fstab entry. NAS is also in there and works manually with sudo mount <local mount path in fstab> but fails on boot. From journalctl -xb:

kernel: iwlwifi 0000:2a:00.0: Detected WIFICARD
systemd[1]: Mounting /mnt/nas...
-- Subject: A start job for unit mnt-nas.mount has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit mnt-nas.mount has begun execution.
--
-- The job identifier is 69.
mount[1247]: mount error: could not resolve address for nas: Unknown error
systemd[1]: mnt-nas.mount: Mount process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- An n/a= process belonging to unit mnt-nas.mount has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
systemd[1]: mnt-nas.mount: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit mnt-nas.mount has entered the 'failed' state with result 'exit-code'.
systemd[1]: Failed to mount /mnt/nas.
-- Subject: A start job for unit mnt-nas.mount has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit mnt-nas.mount has finished with a failure.
--
-- The job identifier is 69 and the job result is failed.
systemd[1]: Dependency failed for Remote File Systems.
-- Subject: A start job for unit remote-fs.target has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit remote-fs.target has finished with a failure.
--
-- The job identifier is 68 and the job result is dependency.
systemd[1]: remote-fs.target: Job remote-fs.target/start failed with result 'dependency'.
samhh commented 4 years ago

https://unix.stackexchange.com/a/306518

samhh commented 4 years ago

Fixed with the above approach, it mounts with something as simple as ls <local mount path>.

samhh commented 4 years ago

Now takes three minutes to shutdown as it fails to unmount. :unamused:

samhh commented 4 years ago

Adding _netdev causes it to fail to mount on startup, but manual mount via fstab still works.

samhh commented 4 years ago

^