Mounting USB drive at boot up on a virtualized instance of fedora

Multi tool use
I am running Fedora inside of a Type 1 hypervisor(ESXi). In the VM's settings, I am making 2 USB devices available to it, both are of the exact model and storage capacities, however, one is named "AZS" and the other "ZSA". I want to edit my fstab
so that "AZS" gets mounted to ~/1usb
and "ZSA" is mounted to ~/2usb
at boot up, the problem that I foresee is that I have noticed that the partition that gets assigned to my drives is not always the same. There are only two partitions that I've seen assigned to the drives /dev/sdb1
or /dev/sdc1
, but my flash drives seem to assign to either or, not one in particular. Perhaps this has something to do with the rebooting of the ESXi host or the Fedora guest?
How do I make sure that the flash drives get mounted to the correct mount point at boot up?
linux mount fedora fstab
add a comment |
I am running Fedora inside of a Type 1 hypervisor(ESXi). In the VM's settings, I am making 2 USB devices available to it, both are of the exact model and storage capacities, however, one is named "AZS" and the other "ZSA". I want to edit my fstab
so that "AZS" gets mounted to ~/1usb
and "ZSA" is mounted to ~/2usb
at boot up, the problem that I foresee is that I have noticed that the partition that gets assigned to my drives is not always the same. There are only two partitions that I've seen assigned to the drives /dev/sdb1
or /dev/sdc1
, but my flash drives seem to assign to either or, not one in particular. Perhaps this has something to do with the rebooting of the ESXi host or the Fedora guest?
How do I make sure that the flash drives get mounted to the correct mount point at boot up?
linux mount fedora fstab
Can you mount them by UUID or Volume? wiki.archlinux.org/index.php/Fstab#Identifying_filesystems Perhaps withnofail
in case you forgot to connect them.
– lx07
Feb 6 at 20:58
@lx07 Thanks for the link, I do not know enough about Linux or file systems, so my question is: how do I distinguish between the UUID of/dev/sdb1
vs that of my flash drive? Or does/dev/sdb1
only have a UUID when there is something attached?
– adamz88
Feb 6 at 22:41
The UUID is the ID of the partition and is only there when it is attached. You can see it withsudo blkid
. I'll put it in an answer as it is too long for a comment.
– lx07
Feb 6 at 23:32
add a comment |
I am running Fedora inside of a Type 1 hypervisor(ESXi). In the VM's settings, I am making 2 USB devices available to it, both are of the exact model and storage capacities, however, one is named "AZS" and the other "ZSA". I want to edit my fstab
so that "AZS" gets mounted to ~/1usb
and "ZSA" is mounted to ~/2usb
at boot up, the problem that I foresee is that I have noticed that the partition that gets assigned to my drives is not always the same. There are only two partitions that I've seen assigned to the drives /dev/sdb1
or /dev/sdc1
, but my flash drives seem to assign to either or, not one in particular. Perhaps this has something to do with the rebooting of the ESXi host or the Fedora guest?
How do I make sure that the flash drives get mounted to the correct mount point at boot up?
linux mount fedora fstab
I am running Fedora inside of a Type 1 hypervisor(ESXi). In the VM's settings, I am making 2 USB devices available to it, both are of the exact model and storage capacities, however, one is named "AZS" and the other "ZSA". I want to edit my fstab
so that "AZS" gets mounted to ~/1usb
and "ZSA" is mounted to ~/2usb
at boot up, the problem that I foresee is that I have noticed that the partition that gets assigned to my drives is not always the same. There are only two partitions that I've seen assigned to the drives /dev/sdb1
or /dev/sdc1
, but my flash drives seem to assign to either or, not one in particular. Perhaps this has something to do with the rebooting of the ESXi host or the Fedora guest?
How do I make sure that the flash drives get mounted to the correct mount point at boot up?
linux mount fedora fstab
linux mount fedora fstab
asked Feb 6 at 19:49
adamz88adamz88
83
83
Can you mount them by UUID or Volume? wiki.archlinux.org/index.php/Fstab#Identifying_filesystems Perhaps withnofail
in case you forgot to connect them.
– lx07
Feb 6 at 20:58
@lx07 Thanks for the link, I do not know enough about Linux or file systems, so my question is: how do I distinguish between the UUID of/dev/sdb1
vs that of my flash drive? Or does/dev/sdb1
only have a UUID when there is something attached?
– adamz88
Feb 6 at 22:41
The UUID is the ID of the partition and is only there when it is attached. You can see it withsudo blkid
. I'll put it in an answer as it is too long for a comment.
– lx07
Feb 6 at 23:32
add a comment |
Can you mount them by UUID or Volume? wiki.archlinux.org/index.php/Fstab#Identifying_filesystems Perhaps withnofail
in case you forgot to connect them.
– lx07
Feb 6 at 20:58
@lx07 Thanks for the link, I do not know enough about Linux or file systems, so my question is: how do I distinguish between the UUID of/dev/sdb1
vs that of my flash drive? Or does/dev/sdb1
only have a UUID when there is something attached?
– adamz88
Feb 6 at 22:41
The UUID is the ID of the partition and is only there when it is attached. You can see it withsudo blkid
. I'll put it in an answer as it is too long for a comment.
– lx07
Feb 6 at 23:32
Can you mount them by UUID or Volume? wiki.archlinux.org/index.php/Fstab#Identifying_filesystems Perhaps with
nofail
in case you forgot to connect them.– lx07
Feb 6 at 20:58
Can you mount them by UUID or Volume? wiki.archlinux.org/index.php/Fstab#Identifying_filesystems Perhaps with
nofail
in case you forgot to connect them.– lx07
Feb 6 at 20:58
@lx07 Thanks for the link, I do not know enough about Linux or file systems, so my question is: how do I distinguish between the UUID of
/dev/sdb1
vs that of my flash drive? Or does /dev/sdb1
only have a UUID when there is something attached?– adamz88
Feb 6 at 22:41
@lx07 Thanks for the link, I do not know enough about Linux or file systems, so my question is: how do I distinguish between the UUID of
/dev/sdb1
vs that of my flash drive? Or does /dev/sdb1
only have a UUID when there is something attached?– adamz88
Feb 6 at 22:41
The UUID is the ID of the partition and is only there when it is attached. You can see it with
sudo blkid
. I'll put it in an answer as it is too long for a comment.– lx07
Feb 6 at 23:32
The UUID is the ID of the partition and is only there when it is attached. You can see it with
sudo blkid
. I'll put it in an answer as it is too long for a comment.– lx07
Feb 6 at 23:32
add a comment |
1 Answer
1
active
oldest
votes
If you look at blkid
you can see the UUID of the partitions you want to attach. For example this is two attached USB - the second having 4 partitions.
/dev/sdb1: LABEL="A USB Key" UUID="2E2C1CA92C1C6DD9" TYPE="ntfs" PARTUUID="001b9586-01"
/dev/sdc1: UUID="bbbab20e-f534-3125-aa76-9307200ac097" TYPE="hfsplus" PARTLABEL="ESP" PARTUUID="9c2b51dc-7fb7-4b7a-87c7-ab99e6541a3c"
/dev/sdc2: LABEL_FATBOOT="USB_FAT" LABEL="USB_FAT" UUID="63DE-0F12" TYPE="vfat" PARTLABEL="Microsoft basic data" PARTUUID="ac46c74a-5db6-42a2-a3ad-997c395bd8e5"
/dev/sdc3: UUID="4d6e9ffd-cd4e-38e2-932c-17d0f1c634b5" LABEL="Preboot" TYPE="hfsplus" PARTLABEL="Apple HFS/HFS+" PARTUUID="2db5ea6a-e921-4ee6-a5e5-884487a5b0e1"
/dev/sdc4: UUID="6ab50862-5de9-3c8b-af2e-615f73d23c67" LABEL="Recovery HD" TYPE="hfsplus" PARTLABEL="Recovery HD" PARTUUID="43e67dda-00dd-4844-a570-883ea8dfca6c"
To mount what is currently at sdb1 and sdc2 you make a couple of directories :
# mkdir /mnt/usb1
# mkdir /mnt/usb2
Then add records to /etc/fstab
but specifying setting UUID=
to the value you got from blkid
rather than the device name as described in this answer on Ask Ubuntu. Note that you can use LABEL=
or PARTLABEL=
instead if you prefer.
UUID=63DE-0F12 /mnt/usb1 vfat auto,nosuid,nodev,nofail 0 0
UUID=2E2C1CA92C1C6DD9 /mnt/usb2 ntfs auto,nosuid,nodev,nofail 0 0
If you mount them the correct UUID goes to correct mountpoint :
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdb 8:16 1 14.9G 0 disk
└─sdb1 8:17 1 14.9G 0 part /mnt/usb2
sdc 8:32 1 29.8G 0 disk
├─sdc1 8:33 1 200M 0 part
├─sdc2 8:34 1 8G 0 part /mnt/usb1
├─sdc3 8:35 1 20.4G 0 part
└─sdc4 8:36 1 1.2G 0 part
Even if you then pull out and swap them - the device names change to sdd1 and sde2 but are still mounted in same mount point.
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdd 8:48 1 14.9G 0 disk
└─sdd1 8:49 1 14.9G 0 part /mnt/usb2
sde 8:64 1 29.8G 0 disk
├─sde1 8:65 1 200M 0 part
├─sde2 8:66 1 8G 0 part /mnt/usb1
├─sde3 8:67 1 20.4G 0 part
└─sde4 8:68 1 1.2G 0 part
Thank you, your answer is very thorough and helped me understand the concepts. One last thing, what is the proper term to use to refer to an entity such as:/dev/sdb1
. This confuses me because I think that this is being referenced as the partition, but to my knowledge, the partition would be inside of the flash drive and/dev/sdb1
seems to be inside of my OS.
– adamz88
Feb 7 at 17:43
The partition is on flash drive. The/dev/sdb1
is a filesystem representation of this partition that the OS can understand and would normally be called a partition to make life easier. Similarly/dev/sdb
would be called a device even though the 'real' device is the physical object. Have a look at this answer for more details/discussion of this.
– lx07
Feb 7 at 18:10
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1402831%2fmounting-usb-drive-at-boot-up-on-a-virtualized-instance-of-fedora%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you look at blkid
you can see the UUID of the partitions you want to attach. For example this is two attached USB - the second having 4 partitions.
/dev/sdb1: LABEL="A USB Key" UUID="2E2C1CA92C1C6DD9" TYPE="ntfs" PARTUUID="001b9586-01"
/dev/sdc1: UUID="bbbab20e-f534-3125-aa76-9307200ac097" TYPE="hfsplus" PARTLABEL="ESP" PARTUUID="9c2b51dc-7fb7-4b7a-87c7-ab99e6541a3c"
/dev/sdc2: LABEL_FATBOOT="USB_FAT" LABEL="USB_FAT" UUID="63DE-0F12" TYPE="vfat" PARTLABEL="Microsoft basic data" PARTUUID="ac46c74a-5db6-42a2-a3ad-997c395bd8e5"
/dev/sdc3: UUID="4d6e9ffd-cd4e-38e2-932c-17d0f1c634b5" LABEL="Preboot" TYPE="hfsplus" PARTLABEL="Apple HFS/HFS+" PARTUUID="2db5ea6a-e921-4ee6-a5e5-884487a5b0e1"
/dev/sdc4: UUID="6ab50862-5de9-3c8b-af2e-615f73d23c67" LABEL="Recovery HD" TYPE="hfsplus" PARTLABEL="Recovery HD" PARTUUID="43e67dda-00dd-4844-a570-883ea8dfca6c"
To mount what is currently at sdb1 and sdc2 you make a couple of directories :
# mkdir /mnt/usb1
# mkdir /mnt/usb2
Then add records to /etc/fstab
but specifying setting UUID=
to the value you got from blkid
rather than the device name as described in this answer on Ask Ubuntu. Note that you can use LABEL=
or PARTLABEL=
instead if you prefer.
UUID=63DE-0F12 /mnt/usb1 vfat auto,nosuid,nodev,nofail 0 0
UUID=2E2C1CA92C1C6DD9 /mnt/usb2 ntfs auto,nosuid,nodev,nofail 0 0
If you mount them the correct UUID goes to correct mountpoint :
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdb 8:16 1 14.9G 0 disk
└─sdb1 8:17 1 14.9G 0 part /mnt/usb2
sdc 8:32 1 29.8G 0 disk
├─sdc1 8:33 1 200M 0 part
├─sdc2 8:34 1 8G 0 part /mnt/usb1
├─sdc3 8:35 1 20.4G 0 part
└─sdc4 8:36 1 1.2G 0 part
Even if you then pull out and swap them - the device names change to sdd1 and sde2 but are still mounted in same mount point.
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdd 8:48 1 14.9G 0 disk
└─sdd1 8:49 1 14.9G 0 part /mnt/usb2
sde 8:64 1 29.8G 0 disk
├─sde1 8:65 1 200M 0 part
├─sde2 8:66 1 8G 0 part /mnt/usb1
├─sde3 8:67 1 20.4G 0 part
└─sde4 8:68 1 1.2G 0 part
Thank you, your answer is very thorough and helped me understand the concepts. One last thing, what is the proper term to use to refer to an entity such as:/dev/sdb1
. This confuses me because I think that this is being referenced as the partition, but to my knowledge, the partition would be inside of the flash drive and/dev/sdb1
seems to be inside of my OS.
– adamz88
Feb 7 at 17:43
The partition is on flash drive. The/dev/sdb1
is a filesystem representation of this partition that the OS can understand and would normally be called a partition to make life easier. Similarly/dev/sdb
would be called a device even though the 'real' device is the physical object. Have a look at this answer for more details/discussion of this.
– lx07
Feb 7 at 18:10
add a comment |
If you look at blkid
you can see the UUID of the partitions you want to attach. For example this is two attached USB - the second having 4 partitions.
/dev/sdb1: LABEL="A USB Key" UUID="2E2C1CA92C1C6DD9" TYPE="ntfs" PARTUUID="001b9586-01"
/dev/sdc1: UUID="bbbab20e-f534-3125-aa76-9307200ac097" TYPE="hfsplus" PARTLABEL="ESP" PARTUUID="9c2b51dc-7fb7-4b7a-87c7-ab99e6541a3c"
/dev/sdc2: LABEL_FATBOOT="USB_FAT" LABEL="USB_FAT" UUID="63DE-0F12" TYPE="vfat" PARTLABEL="Microsoft basic data" PARTUUID="ac46c74a-5db6-42a2-a3ad-997c395bd8e5"
/dev/sdc3: UUID="4d6e9ffd-cd4e-38e2-932c-17d0f1c634b5" LABEL="Preboot" TYPE="hfsplus" PARTLABEL="Apple HFS/HFS+" PARTUUID="2db5ea6a-e921-4ee6-a5e5-884487a5b0e1"
/dev/sdc4: UUID="6ab50862-5de9-3c8b-af2e-615f73d23c67" LABEL="Recovery HD" TYPE="hfsplus" PARTLABEL="Recovery HD" PARTUUID="43e67dda-00dd-4844-a570-883ea8dfca6c"
To mount what is currently at sdb1 and sdc2 you make a couple of directories :
# mkdir /mnt/usb1
# mkdir /mnt/usb2
Then add records to /etc/fstab
but specifying setting UUID=
to the value you got from blkid
rather than the device name as described in this answer on Ask Ubuntu. Note that you can use LABEL=
or PARTLABEL=
instead if you prefer.
UUID=63DE-0F12 /mnt/usb1 vfat auto,nosuid,nodev,nofail 0 0
UUID=2E2C1CA92C1C6DD9 /mnt/usb2 ntfs auto,nosuid,nodev,nofail 0 0
If you mount them the correct UUID goes to correct mountpoint :
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdb 8:16 1 14.9G 0 disk
└─sdb1 8:17 1 14.9G 0 part /mnt/usb2
sdc 8:32 1 29.8G 0 disk
├─sdc1 8:33 1 200M 0 part
├─sdc2 8:34 1 8G 0 part /mnt/usb1
├─sdc3 8:35 1 20.4G 0 part
└─sdc4 8:36 1 1.2G 0 part
Even if you then pull out and swap them - the device names change to sdd1 and sde2 but are still mounted in same mount point.
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdd 8:48 1 14.9G 0 disk
└─sdd1 8:49 1 14.9G 0 part /mnt/usb2
sde 8:64 1 29.8G 0 disk
├─sde1 8:65 1 200M 0 part
├─sde2 8:66 1 8G 0 part /mnt/usb1
├─sde3 8:67 1 20.4G 0 part
└─sde4 8:68 1 1.2G 0 part
Thank you, your answer is very thorough and helped me understand the concepts. One last thing, what is the proper term to use to refer to an entity such as:/dev/sdb1
. This confuses me because I think that this is being referenced as the partition, but to my knowledge, the partition would be inside of the flash drive and/dev/sdb1
seems to be inside of my OS.
– adamz88
Feb 7 at 17:43
The partition is on flash drive. The/dev/sdb1
is a filesystem representation of this partition that the OS can understand and would normally be called a partition to make life easier. Similarly/dev/sdb
would be called a device even though the 'real' device is the physical object. Have a look at this answer for more details/discussion of this.
– lx07
Feb 7 at 18:10
add a comment |
If you look at blkid
you can see the UUID of the partitions you want to attach. For example this is two attached USB - the second having 4 partitions.
/dev/sdb1: LABEL="A USB Key" UUID="2E2C1CA92C1C6DD9" TYPE="ntfs" PARTUUID="001b9586-01"
/dev/sdc1: UUID="bbbab20e-f534-3125-aa76-9307200ac097" TYPE="hfsplus" PARTLABEL="ESP" PARTUUID="9c2b51dc-7fb7-4b7a-87c7-ab99e6541a3c"
/dev/sdc2: LABEL_FATBOOT="USB_FAT" LABEL="USB_FAT" UUID="63DE-0F12" TYPE="vfat" PARTLABEL="Microsoft basic data" PARTUUID="ac46c74a-5db6-42a2-a3ad-997c395bd8e5"
/dev/sdc3: UUID="4d6e9ffd-cd4e-38e2-932c-17d0f1c634b5" LABEL="Preboot" TYPE="hfsplus" PARTLABEL="Apple HFS/HFS+" PARTUUID="2db5ea6a-e921-4ee6-a5e5-884487a5b0e1"
/dev/sdc4: UUID="6ab50862-5de9-3c8b-af2e-615f73d23c67" LABEL="Recovery HD" TYPE="hfsplus" PARTLABEL="Recovery HD" PARTUUID="43e67dda-00dd-4844-a570-883ea8dfca6c"
To mount what is currently at sdb1 and sdc2 you make a couple of directories :
# mkdir /mnt/usb1
# mkdir /mnt/usb2
Then add records to /etc/fstab
but specifying setting UUID=
to the value you got from blkid
rather than the device name as described in this answer on Ask Ubuntu. Note that you can use LABEL=
or PARTLABEL=
instead if you prefer.
UUID=63DE-0F12 /mnt/usb1 vfat auto,nosuid,nodev,nofail 0 0
UUID=2E2C1CA92C1C6DD9 /mnt/usb2 ntfs auto,nosuid,nodev,nofail 0 0
If you mount them the correct UUID goes to correct mountpoint :
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdb 8:16 1 14.9G 0 disk
└─sdb1 8:17 1 14.9G 0 part /mnt/usb2
sdc 8:32 1 29.8G 0 disk
├─sdc1 8:33 1 200M 0 part
├─sdc2 8:34 1 8G 0 part /mnt/usb1
├─sdc3 8:35 1 20.4G 0 part
└─sdc4 8:36 1 1.2G 0 part
Even if you then pull out and swap them - the device names change to sdd1 and sde2 but are still mounted in same mount point.
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdd 8:48 1 14.9G 0 disk
└─sdd1 8:49 1 14.9G 0 part /mnt/usb2
sde 8:64 1 29.8G 0 disk
├─sde1 8:65 1 200M 0 part
├─sde2 8:66 1 8G 0 part /mnt/usb1
├─sde3 8:67 1 20.4G 0 part
└─sde4 8:68 1 1.2G 0 part
If you look at blkid
you can see the UUID of the partitions you want to attach. For example this is two attached USB - the second having 4 partitions.
/dev/sdb1: LABEL="A USB Key" UUID="2E2C1CA92C1C6DD9" TYPE="ntfs" PARTUUID="001b9586-01"
/dev/sdc1: UUID="bbbab20e-f534-3125-aa76-9307200ac097" TYPE="hfsplus" PARTLABEL="ESP" PARTUUID="9c2b51dc-7fb7-4b7a-87c7-ab99e6541a3c"
/dev/sdc2: LABEL_FATBOOT="USB_FAT" LABEL="USB_FAT" UUID="63DE-0F12" TYPE="vfat" PARTLABEL="Microsoft basic data" PARTUUID="ac46c74a-5db6-42a2-a3ad-997c395bd8e5"
/dev/sdc3: UUID="4d6e9ffd-cd4e-38e2-932c-17d0f1c634b5" LABEL="Preboot" TYPE="hfsplus" PARTLABEL="Apple HFS/HFS+" PARTUUID="2db5ea6a-e921-4ee6-a5e5-884487a5b0e1"
/dev/sdc4: UUID="6ab50862-5de9-3c8b-af2e-615f73d23c67" LABEL="Recovery HD" TYPE="hfsplus" PARTLABEL="Recovery HD" PARTUUID="43e67dda-00dd-4844-a570-883ea8dfca6c"
To mount what is currently at sdb1 and sdc2 you make a couple of directories :
# mkdir /mnt/usb1
# mkdir /mnt/usb2
Then add records to /etc/fstab
but specifying setting UUID=
to the value you got from blkid
rather than the device name as described in this answer on Ask Ubuntu. Note that you can use LABEL=
or PARTLABEL=
instead if you prefer.
UUID=63DE-0F12 /mnt/usb1 vfat auto,nosuid,nodev,nofail 0 0
UUID=2E2C1CA92C1C6DD9 /mnt/usb2 ntfs auto,nosuid,nodev,nofail 0 0
If you mount them the correct UUID goes to correct mountpoint :
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdb 8:16 1 14.9G 0 disk
└─sdb1 8:17 1 14.9G 0 part /mnt/usb2
sdc 8:32 1 29.8G 0 disk
├─sdc1 8:33 1 200M 0 part
├─sdc2 8:34 1 8G 0 part /mnt/usb1
├─sdc3 8:35 1 20.4G 0 part
└─sdc4 8:36 1 1.2G 0 part
Even if you then pull out and swap them - the device names change to sdd1 and sde2 but are still mounted in same mount point.
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 82G 0 part
├─sda3 8:3 0 4G 0 part
├─sda4 8:4 0 10G 0 part /
├─sda5 8:5 0 9.9G 0 part
└─sda6 8:6 0 12.9G 0 part
sdd 8:48 1 14.9G 0 disk
└─sdd1 8:49 1 14.9G 0 part /mnt/usb2
sde 8:64 1 29.8G 0 disk
├─sde1 8:65 1 200M 0 part
├─sde2 8:66 1 8G 0 part /mnt/usb1
├─sde3 8:67 1 20.4G 0 part
└─sde4 8:68 1 1.2G 0 part
answered Feb 7 at 0:11
lx07lx07
602411
602411
Thank you, your answer is very thorough and helped me understand the concepts. One last thing, what is the proper term to use to refer to an entity such as:/dev/sdb1
. This confuses me because I think that this is being referenced as the partition, but to my knowledge, the partition would be inside of the flash drive and/dev/sdb1
seems to be inside of my OS.
– adamz88
Feb 7 at 17:43
The partition is on flash drive. The/dev/sdb1
is a filesystem representation of this partition that the OS can understand and would normally be called a partition to make life easier. Similarly/dev/sdb
would be called a device even though the 'real' device is the physical object. Have a look at this answer for more details/discussion of this.
– lx07
Feb 7 at 18:10
add a comment |
Thank you, your answer is very thorough and helped me understand the concepts. One last thing, what is the proper term to use to refer to an entity such as:/dev/sdb1
. This confuses me because I think that this is being referenced as the partition, but to my knowledge, the partition would be inside of the flash drive and/dev/sdb1
seems to be inside of my OS.
– adamz88
Feb 7 at 17:43
The partition is on flash drive. The/dev/sdb1
is a filesystem representation of this partition that the OS can understand and would normally be called a partition to make life easier. Similarly/dev/sdb
would be called a device even though the 'real' device is the physical object. Have a look at this answer for more details/discussion of this.
– lx07
Feb 7 at 18:10
Thank you, your answer is very thorough and helped me understand the concepts. One last thing, what is the proper term to use to refer to an entity such as:
/dev/sdb1
. This confuses me because I think that this is being referenced as the partition, but to my knowledge, the partition would be inside of the flash drive and /dev/sdb1
seems to be inside of my OS.– adamz88
Feb 7 at 17:43
Thank you, your answer is very thorough and helped me understand the concepts. One last thing, what is the proper term to use to refer to an entity such as:
/dev/sdb1
. This confuses me because I think that this is being referenced as the partition, but to my knowledge, the partition would be inside of the flash drive and /dev/sdb1
seems to be inside of my OS.– adamz88
Feb 7 at 17:43
The partition is on flash drive. The
/dev/sdb1
is a filesystem representation of this partition that the OS can understand and would normally be called a partition to make life easier. Similarly /dev/sdb
would be called a device even though the 'real' device is the physical object. Have a look at this answer for more details/discussion of this.– lx07
Feb 7 at 18:10
The partition is on flash drive. The
/dev/sdb1
is a filesystem representation of this partition that the OS can understand and would normally be called a partition to make life easier. Similarly /dev/sdb
would be called a device even though the 'real' device is the physical object. Have a look at this answer for more details/discussion of this.– lx07
Feb 7 at 18:10
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1402831%2fmounting-usb-drive-at-boot-up-on-a-virtualized-instance-of-fedora%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
sMsW9cIBKpPT3ZI2 m Ga1VZ3B,XPYk3p,FeE1Ctl0gf,luy,5BQXY,rhGpe3Bf,Z
Can you mount them by UUID or Volume? wiki.archlinux.org/index.php/Fstab#Identifying_filesystems Perhaps with
nofail
in case you forgot to connect them.– lx07
Feb 6 at 20:58
@lx07 Thanks for the link, I do not know enough about Linux or file systems, so my question is: how do I distinguish between the UUID of
/dev/sdb1
vs that of my flash drive? Or does/dev/sdb1
only have a UUID when there is something attached?– adamz88
Feb 6 at 22:41
The UUID is the ID of the partition and is only there when it is attached. You can see it with
sudo blkid
. I'll put it in an answer as it is too long for a comment.– lx07
Feb 6 at 23:32