How can I pin a mount folder to a specific serial number, so that the same disk gets mounted in the same place every-time?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have many hard-disks that need to be mounted on restarts some have have NTFS
file-systems other have EXT4
, some are USB
and some are SATA
, some have the same label names, and they don't get mounted in the same place.
Is there a way that I pin a mount folder to a specific serial number, so that the same disk gets mounted in the same place every-time ?
linux mount usb ntfs
add a comment |Â
up vote
0
down vote
favorite
I have many hard-disks that need to be mounted on restarts some have have NTFS
file-systems other have EXT4
, some are USB
and some are SATA
, some have the same label names, and they don't get mounted in the same place.
Is there a way that I pin a mount folder to a specific serial number, so that the same disk gets mounted in the same place every-time ?
linux mount usb ntfs
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have many hard-disks that need to be mounted on restarts some have have NTFS
file-systems other have EXT4
, some are USB
and some are SATA
, some have the same label names, and they don't get mounted in the same place.
Is there a way that I pin a mount folder to a specific serial number, so that the same disk gets mounted in the same place every-time ?
linux mount usb ntfs
I have many hard-disks that need to be mounted on restarts some have have NTFS
file-systems other have EXT4
, some are USB
and some are SATA
, some have the same label names, and they don't get mounted in the same place.
Is there a way that I pin a mount folder to a specific serial number, so that the same disk gets mounted in the same place every-time ?
linux mount usb ntfs
linux mount usb ntfs
asked Sep 25 at 12:56
Eduard Florinescu
2,964103751
2,964103751
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
First, have a look at the various symlinks in /dev/disk/...
. Symlinks exist for different criteria (volume label, serial number of disk, ...), and you can pick those that best describe the partition you are interested in.
Second, you can edit /etc/fstab
to mount those partitions wherever you'd like them to be mounted. Including to directories with some serial number. Yes, you need one entry for every partition.
If instead you are talking about auto-mounting, and want some general scheme for autom-mounting, that will depend on your auto mounter. One way would be to write custom udev-rules with high priority than whatever your auto-mounter uses.
now I see in/dev/disk/
i have this foldersby-id/ by-path/ by-uuid/
so you say I can mount like thismount /dev/disk/by-id/serial /myfolder
â Eduard Florinescu
Sep 25 at 14:04
1
Yes, exactly. And after you edited/etc/fstab
, you can justmount /myfolder
.
â dirkt
Sep 25 at 14:17
add a comment |Â
up vote
0
down vote
A quick fix would be to unmount all already mounted and mount them all in folders having the uuid
serial:
cd /media/$USER
ls -1 | xargs -L1 -I sudo umount /media/$USER/
sudo mkdir /media/amounted
cd /media/amounted
ls -1 /dev/disk/by-uuid/ | xargs sudo mkdir
ls -1 | xargs -L1 -I sudo mount /dev/disk/by-uuid/ /media/amounted/
Then list the drive with the corresponding mount folder uuid etc:
sudo lsblk -o name,mountpoint,tran,fstype,label,size,uuid
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
First, have a look at the various symlinks in /dev/disk/...
. Symlinks exist for different criteria (volume label, serial number of disk, ...), and you can pick those that best describe the partition you are interested in.
Second, you can edit /etc/fstab
to mount those partitions wherever you'd like them to be mounted. Including to directories with some serial number. Yes, you need one entry for every partition.
If instead you are talking about auto-mounting, and want some general scheme for autom-mounting, that will depend on your auto mounter. One way would be to write custom udev-rules with high priority than whatever your auto-mounter uses.
now I see in/dev/disk/
i have this foldersby-id/ by-path/ by-uuid/
so you say I can mount like thismount /dev/disk/by-id/serial /myfolder
â Eduard Florinescu
Sep 25 at 14:04
1
Yes, exactly. And after you edited/etc/fstab
, you can justmount /myfolder
.
â dirkt
Sep 25 at 14:17
add a comment |Â
up vote
2
down vote
accepted
First, have a look at the various symlinks in /dev/disk/...
. Symlinks exist for different criteria (volume label, serial number of disk, ...), and you can pick those that best describe the partition you are interested in.
Second, you can edit /etc/fstab
to mount those partitions wherever you'd like them to be mounted. Including to directories with some serial number. Yes, you need one entry for every partition.
If instead you are talking about auto-mounting, and want some general scheme for autom-mounting, that will depend on your auto mounter. One way would be to write custom udev-rules with high priority than whatever your auto-mounter uses.
now I see in/dev/disk/
i have this foldersby-id/ by-path/ by-uuid/
so you say I can mount like thismount /dev/disk/by-id/serial /myfolder
â Eduard Florinescu
Sep 25 at 14:04
1
Yes, exactly. And after you edited/etc/fstab
, you can justmount /myfolder
.
â dirkt
Sep 25 at 14:17
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
First, have a look at the various symlinks in /dev/disk/...
. Symlinks exist for different criteria (volume label, serial number of disk, ...), and you can pick those that best describe the partition you are interested in.
Second, you can edit /etc/fstab
to mount those partitions wherever you'd like them to be mounted. Including to directories with some serial number. Yes, you need one entry for every partition.
If instead you are talking about auto-mounting, and want some general scheme for autom-mounting, that will depend on your auto mounter. One way would be to write custom udev-rules with high priority than whatever your auto-mounter uses.
First, have a look at the various symlinks in /dev/disk/...
. Symlinks exist for different criteria (volume label, serial number of disk, ...), and you can pick those that best describe the partition you are interested in.
Second, you can edit /etc/fstab
to mount those partitions wherever you'd like them to be mounted. Including to directories with some serial number. Yes, you need one entry for every partition.
If instead you are talking about auto-mounting, and want some general scheme for autom-mounting, that will depend on your auto mounter. One way would be to write custom udev-rules with high priority than whatever your auto-mounter uses.
answered Sep 25 at 13:13
dirkt
15k21032
15k21032
now I see in/dev/disk/
i have this foldersby-id/ by-path/ by-uuid/
so you say I can mount like thismount /dev/disk/by-id/serial /myfolder
â Eduard Florinescu
Sep 25 at 14:04
1
Yes, exactly. And after you edited/etc/fstab
, you can justmount /myfolder
.
â dirkt
Sep 25 at 14:17
add a comment |Â
now I see in/dev/disk/
i have this foldersby-id/ by-path/ by-uuid/
so you say I can mount like thismount /dev/disk/by-id/serial /myfolder
â Eduard Florinescu
Sep 25 at 14:04
1
Yes, exactly. And after you edited/etc/fstab
, you can justmount /myfolder
.
â dirkt
Sep 25 at 14:17
now I see in
/dev/disk/
i have this folders by-id/ by-path/ by-uuid/
so you say I can mount like this mount /dev/disk/by-id/serial /myfolder
â Eduard Florinescu
Sep 25 at 14:04
now I see in
/dev/disk/
i have this folders by-id/ by-path/ by-uuid/
so you say I can mount like this mount /dev/disk/by-id/serial /myfolder
â Eduard Florinescu
Sep 25 at 14:04
1
1
Yes, exactly. And after you edited
/etc/fstab
, you can just mount /myfolder
.â dirkt
Sep 25 at 14:17
Yes, exactly. And after you edited
/etc/fstab
, you can just mount /myfolder
.â dirkt
Sep 25 at 14:17
add a comment |Â
up vote
0
down vote
A quick fix would be to unmount all already mounted and mount them all in folders having the uuid
serial:
cd /media/$USER
ls -1 | xargs -L1 -I sudo umount /media/$USER/
sudo mkdir /media/amounted
cd /media/amounted
ls -1 /dev/disk/by-uuid/ | xargs sudo mkdir
ls -1 | xargs -L1 -I sudo mount /dev/disk/by-uuid/ /media/amounted/
Then list the drive with the corresponding mount folder uuid etc:
sudo lsblk -o name,mountpoint,tran,fstype,label,size,uuid
add a comment |Â
up vote
0
down vote
A quick fix would be to unmount all already mounted and mount them all in folders having the uuid
serial:
cd /media/$USER
ls -1 | xargs -L1 -I sudo umount /media/$USER/
sudo mkdir /media/amounted
cd /media/amounted
ls -1 /dev/disk/by-uuid/ | xargs sudo mkdir
ls -1 | xargs -L1 -I sudo mount /dev/disk/by-uuid/ /media/amounted/
Then list the drive with the corresponding mount folder uuid etc:
sudo lsblk -o name,mountpoint,tran,fstype,label,size,uuid
add a comment |Â
up vote
0
down vote
up vote
0
down vote
A quick fix would be to unmount all already mounted and mount them all in folders having the uuid
serial:
cd /media/$USER
ls -1 | xargs -L1 -I sudo umount /media/$USER/
sudo mkdir /media/amounted
cd /media/amounted
ls -1 /dev/disk/by-uuid/ | xargs sudo mkdir
ls -1 | xargs -L1 -I sudo mount /dev/disk/by-uuid/ /media/amounted/
Then list the drive with the corresponding mount folder uuid etc:
sudo lsblk -o name,mountpoint,tran,fstype,label,size,uuid
A quick fix would be to unmount all already mounted and mount them all in folders having the uuid
serial:
cd /media/$USER
ls -1 | xargs -L1 -I sudo umount /media/$USER/
sudo mkdir /media/amounted
cd /media/amounted
ls -1 /dev/disk/by-uuid/ | xargs sudo mkdir
ls -1 | xargs -L1 -I sudo mount /dev/disk/by-uuid/ /media/amounted/
Then list the drive with the corresponding mount folder uuid etc:
sudo lsblk -o name,mountpoint,tran,fstype,label,size,uuid
edited Sep 25 at 20:45
answered Sep 25 at 19:56
Eduard Florinescu
2,964103751
2,964103751
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471315%2fhow-can-i-pin-a-mount-folder-to-a-specific-serial-number-so-that-the-same-disk%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password