I need to mount directory from another HDD to my current home directory. I can do it by following command and it works properly:
sudo mount --bind /media/username/HDD3TB/'Мои документы'/Фото /home/username/Pictures/HDD_Photo
But I want it to mount automatically during system initialization. I have tried to add the entry below to /etc/fstab:
/media/username/HDD3TB/'Мои документы'/Фото /home/username/Pictures/HDD_Photo none bind 0 0
But this way does not work and it entails errors in time of system initialization.
In journalctl I have found out the following error messages:
kernel: ACPI Error: [\_SB_.PCI0.XHC_.RHUB.HS11] Namespace lookup failure, AE_NOT_FOUND (20170831/dswload-210)
kernel: ACPI Exception: AE_NOT_FOUND, During name lookup/catalog (20170831/psobject-253)
kernel: ACPI Exception: AE_NOT_FOUND, (SSDT:xh_rvp08) while loading table (20170831/tbxfload-228)
kernel: ACPI Error: 1 table load failures, 5 successful (20170831/tbxfload-246)
kernel: clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635855245 ns
and
-- The start-up result is RESULT.
июн 30 20:03:24 elementaryOS systemd-remount-fs[448]: mount: /etc/fstab: parse error at line 19 -- ignored
июн 30 20:03:24 elementaryOS systemd[1]: Started Remount Root and Kernel File Systems.
-- Subject: Unit systemd-remount-fs.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit systemd-remount-fs.service has finished starting up.
...
-- The start-up result is RESULT.
июн 30 20:03:32 elementaryOS systemd-fsck[1055]: fsck: /etc/fstab: parse error at line 19 -- ignored
июн 30 20:03:32 elementaryOS systemd[1]: Started File System Check Daemon to report status.
-- Subject: Unit systemd-fsckd.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
...
-- Unit systemd-fsck@dev-disk-by\x2duuid-4e02e814\x2d86be\x2d4995\x2d9989\x2dbe965304d5ea.service has begun starting up.
июн 30 20:03:32 elementaryOS systemd-fsck[1078]: fsck: /etc/fstab: parse error at line 19 -- ignored
июн 30 20:03:32 elementaryOS systemd[1]: Found device ST1000DM003-9YN162 1.
-- Subject: Unit dev-disk-by\x2duuid-c6e31fc0\x2d90ae\x2d48c3\x2dba37\x2db124bffc57f3.device has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit dev-disk-by\x2duuid-c6e31fc0\x2d90ae\x2d48c3\x2dba37\x2db124bffc57f3.device has finished starting up.
Can I use spaces and cyrillic symbols in path? Or maybe I should use another way to auto mount this directory?
You don't need to use
/etc/fstab/
and you can create the followingsystemd
service to mount the file instead.I adapted: this answer written by user: @detuur to fit this particular situation.
Create a new file using:
sudo vim /etc/systemd/system/boot-shadow-mount.service
and then copy and paste the following and then save the file and exitvim
Next, run the following command to correct the "username" in the file:
Then, run the following commands to "enable" the new service so that the service will automatically start when you boot the system:
When you reboot, the file should automatically mount.
Please post any errors. Thanks!
additional source: blog.iwakd.de/systemd-fstab-and-bind-mounts-with-options