I have two usb hard drives, and everytime i reboot they get a new /dev/sdX and thus a new /var/media/hddpath. How can i prevent this from happening?
how to fixate usb hard drives mount path?
-
Tahurel -
May 30, 2024 at 8:17 PM -
Thread is Resolved
-
-
Use /dev/disk/by-uuid/<YOUR_DRIVE_ID> instead.
-
ok, how do i get this so survive a reboot?
-
-
i did it like this
Bash#!/bin/sh ( ln -s /dev/disk/by-uuid/53971acb-b470-4e13-86e0-214bdc22f621 /var/media/sda1-ata-KINGSTON_SNV2S20 ln -s /dev/disk/by-uuid/e60c7dc1-9f50-4088-9686-2ce42f3f55b9 /var/media/sda1-ata-KINGSTON_SNV2S20/complete/tv2 ) &
and the first drive gets mounted at /var/media/sda1-ata-KINGSTON_SNV2S20 and the second one at /var/media/sdb1-ata-Samsung_SSD_840_
inside /var/media/sda1-ata-KINGSTON_SNV2S20 there is a symlink 53971acb-b470-4e13-86e0-214bdc22f621 -> /dev/disk/by-uuid/53971acb-b470-4e13-86e0-214bdc22f621
and inside /var/media/sda1-ata-KINGSTON_SNV2S20/complete/tv2 there is a symlink /dev/disk/by-uuid/e60c7dc1-9f50-4088-9686-2ce42f3f55b9
not exactly what i wanted?
-
Sorry, I was wrong. Use mount instead of ln -s. Create a folder for each mount, too.
Bash#!/bin/sh ( mkdir /var/media/<YOUR_PREFERRED_PATITION_NAME> mount /dev/disk/by-uuid/<YOUR_PARTITION_ID> /var/media/<YOUR_PREFERRED_PATITION_NAME> ) &
To my knowledge, LE will always add external disk partitions to /var/media, so you eventually get them twice.
-
-
Ok nice! This solved my problem, thank you. Both of you