How to update fstab file with UUID?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
The following lines are defined in my /etc/fstab
file.
My current fstab:
/dev/sdb /lpo/sda ext4 defaults,noatime 0 0
/dev/sdc /lpo/sdb ext4 defaults,noatime 0 0
From blkid we get:
/dev/sdb: UUID="14314872-abd5-24e7-a850-db36fab2c6a1" TYPE="ext4"
/dev/sdc: UUID="6d439357-3d20-48de-9973-3afb2a325eee" TYPE="ext4"
How to update my current fstab (the two lines) to use the UUID?
For example, if I create the following line (according to the man page) for /dev/sdb
, is it correct?
UUID="14314872-abd5-24e7-a850-db36fab2c6a1" /dev/sdb ext4 defaults,noatime 0 0
linux mount partition fstab uuid
add a comment |Â
up vote
0
down vote
favorite
The following lines are defined in my /etc/fstab
file.
My current fstab:
/dev/sdb /lpo/sda ext4 defaults,noatime 0 0
/dev/sdc /lpo/sdb ext4 defaults,noatime 0 0
From blkid we get:
/dev/sdb: UUID="14314872-abd5-24e7-a850-db36fab2c6a1" TYPE="ext4"
/dev/sdc: UUID="6d439357-3d20-48de-9973-3afb2a325eee" TYPE="ext4"
How to update my current fstab (the two lines) to use the UUID?
For example, if I create the following line (according to the man page) for /dev/sdb
, is it correct?
UUID="14314872-abd5-24e7-a850-db36fab2c6a1" /dev/sdb ext4 defaults,noatime 0 0
linux mount partition fstab uuid
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
The following lines are defined in my /etc/fstab
file.
My current fstab:
/dev/sdb /lpo/sda ext4 defaults,noatime 0 0
/dev/sdc /lpo/sdb ext4 defaults,noatime 0 0
From blkid we get:
/dev/sdb: UUID="14314872-abd5-24e7-a850-db36fab2c6a1" TYPE="ext4"
/dev/sdc: UUID="6d439357-3d20-48de-9973-3afb2a325eee" TYPE="ext4"
How to update my current fstab (the two lines) to use the UUID?
For example, if I create the following line (according to the man page) for /dev/sdb
, is it correct?
UUID="14314872-abd5-24e7-a850-db36fab2c6a1" /dev/sdb ext4 defaults,noatime 0 0
linux mount partition fstab uuid
The following lines are defined in my /etc/fstab
file.
My current fstab:
/dev/sdb /lpo/sda ext4 defaults,noatime 0 0
/dev/sdc /lpo/sdb ext4 defaults,noatime 0 0
From blkid we get:
/dev/sdb: UUID="14314872-abd5-24e7-a850-db36fab2c6a1" TYPE="ext4"
/dev/sdc: UUID="6d439357-3d20-48de-9973-3afb2a325eee" TYPE="ext4"
How to update my current fstab (the two lines) to use the UUID?
For example, if I create the following line (according to the man page) for /dev/sdb
, is it correct?
UUID="14314872-abd5-24e7-a850-db36fab2c6a1" /dev/sdb ext4 defaults,noatime 0 0
linux mount partition fstab uuid
linux mount partition fstab uuid
edited Sep 25 '17 at 18:52
peterh
3,97792755
3,97792755
asked Sep 25 '17 at 18:20
yael
2,0341145
2,0341145
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
UUID="14314872-abd5-24e7-a850-db36fab2c6a1" /lpo/sda ext4 defaults,noatime 0 0
UUID="6d439357-3d20-48de-9973-3afb2a325eee" /lpo/sdb ext4 defaults,noatime 0 0
The format of entries in fstab are as follows:
<file system> <dir> <type> <options> <dump> <pass>
Where <file system>
is the device you want to mount (such as /dev/sdb
and <dir>
is the path to where the device should be mounted (/lpo/sda
in your case).
There are multiple ways you can specify <file system>
, the simplest being the path to the file system device in question /dev/sdb
in your case (although typically they point to a partition on a drive rather than the drive, such as /dev/sdb1
but it appears that your drives lack a partition table and simply have the filesystem on the main device). But you can also use the device UUID
or PARTUUID
by specifying it as a key/value pair UUID="14314872-abd5-24e7-a850-db36fab2c6a1"
inplace of /dev/sdb
.
The main reason to use UUID
or PARTUUID
instead of device paths is that they are more consistent when changing the physical disks. The devices are numbered according to how they are presented to the OS by the bios (which is normally ordered by the socket they are plugged into). This means that if you add in a new device or physically rearrange existing devices they will be renumbered and what was /dev/sdb
before might not be now. As you can imagine this will result in the wrong disk being mounted to the wrong location. UUID
and PARTUUID
are ids that are written as part of formatting the filesystem for UUID
or at the time of creating the partition in the case of PARTUUID
. These numbers are written to the disk and will always remain the same so can be used to mount the correct disk even when the underlying device file gets renumbered.
Side note: Your devices are a bit confusing - you have /dev/sdb
mounted to /lpo/sda
- while that works it can be confusing and lead to errors when you maintain/configuring your system, you may want to make these more consistent.
ok so when need to use the UUID instead the default conf ?
â yael
Sep 25 '17 at 18:41
1
@yael Basically for consistency when the you add or remove disks - I have updated my answer with more details.
â Michael Daffin
Sep 25 '17 at 18:50
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
UUID="14314872-abd5-24e7-a850-db36fab2c6a1" /lpo/sda ext4 defaults,noatime 0 0
UUID="6d439357-3d20-48de-9973-3afb2a325eee" /lpo/sdb ext4 defaults,noatime 0 0
The format of entries in fstab are as follows:
<file system> <dir> <type> <options> <dump> <pass>
Where <file system>
is the device you want to mount (such as /dev/sdb
and <dir>
is the path to where the device should be mounted (/lpo/sda
in your case).
There are multiple ways you can specify <file system>
, the simplest being the path to the file system device in question /dev/sdb
in your case (although typically they point to a partition on a drive rather than the drive, such as /dev/sdb1
but it appears that your drives lack a partition table and simply have the filesystem on the main device). But you can also use the device UUID
or PARTUUID
by specifying it as a key/value pair UUID="14314872-abd5-24e7-a850-db36fab2c6a1"
inplace of /dev/sdb
.
The main reason to use UUID
or PARTUUID
instead of device paths is that they are more consistent when changing the physical disks. The devices are numbered according to how they are presented to the OS by the bios (which is normally ordered by the socket they are plugged into). This means that if you add in a new device or physically rearrange existing devices they will be renumbered and what was /dev/sdb
before might not be now. As you can imagine this will result in the wrong disk being mounted to the wrong location. UUID
and PARTUUID
are ids that are written as part of formatting the filesystem for UUID
or at the time of creating the partition in the case of PARTUUID
. These numbers are written to the disk and will always remain the same so can be used to mount the correct disk even when the underlying device file gets renumbered.
Side note: Your devices are a bit confusing - you have /dev/sdb
mounted to /lpo/sda
- while that works it can be confusing and lead to errors when you maintain/configuring your system, you may want to make these more consistent.
ok so when need to use the UUID instead the default conf ?
â yael
Sep 25 '17 at 18:41
1
@yael Basically for consistency when the you add or remove disks - I have updated my answer with more details.
â Michael Daffin
Sep 25 '17 at 18:50
add a comment |Â
up vote
3
down vote
accepted
UUID="14314872-abd5-24e7-a850-db36fab2c6a1" /lpo/sda ext4 defaults,noatime 0 0
UUID="6d439357-3d20-48de-9973-3afb2a325eee" /lpo/sdb ext4 defaults,noatime 0 0
The format of entries in fstab are as follows:
<file system> <dir> <type> <options> <dump> <pass>
Where <file system>
is the device you want to mount (such as /dev/sdb
and <dir>
is the path to where the device should be mounted (/lpo/sda
in your case).
There are multiple ways you can specify <file system>
, the simplest being the path to the file system device in question /dev/sdb
in your case (although typically they point to a partition on a drive rather than the drive, such as /dev/sdb1
but it appears that your drives lack a partition table and simply have the filesystem on the main device). But you can also use the device UUID
or PARTUUID
by specifying it as a key/value pair UUID="14314872-abd5-24e7-a850-db36fab2c6a1"
inplace of /dev/sdb
.
The main reason to use UUID
or PARTUUID
instead of device paths is that they are more consistent when changing the physical disks. The devices are numbered according to how they are presented to the OS by the bios (which is normally ordered by the socket they are plugged into). This means that if you add in a new device or physically rearrange existing devices they will be renumbered and what was /dev/sdb
before might not be now. As you can imagine this will result in the wrong disk being mounted to the wrong location. UUID
and PARTUUID
are ids that are written as part of formatting the filesystem for UUID
or at the time of creating the partition in the case of PARTUUID
. These numbers are written to the disk and will always remain the same so can be used to mount the correct disk even when the underlying device file gets renumbered.
Side note: Your devices are a bit confusing - you have /dev/sdb
mounted to /lpo/sda
- while that works it can be confusing and lead to errors when you maintain/configuring your system, you may want to make these more consistent.
ok so when need to use the UUID instead the default conf ?
â yael
Sep 25 '17 at 18:41
1
@yael Basically for consistency when the you add or remove disks - I have updated my answer with more details.
â Michael Daffin
Sep 25 '17 at 18:50
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
UUID="14314872-abd5-24e7-a850-db36fab2c6a1" /lpo/sda ext4 defaults,noatime 0 0
UUID="6d439357-3d20-48de-9973-3afb2a325eee" /lpo/sdb ext4 defaults,noatime 0 0
The format of entries in fstab are as follows:
<file system> <dir> <type> <options> <dump> <pass>
Where <file system>
is the device you want to mount (such as /dev/sdb
and <dir>
is the path to where the device should be mounted (/lpo/sda
in your case).
There are multiple ways you can specify <file system>
, the simplest being the path to the file system device in question /dev/sdb
in your case (although typically they point to a partition on a drive rather than the drive, such as /dev/sdb1
but it appears that your drives lack a partition table and simply have the filesystem on the main device). But you can also use the device UUID
or PARTUUID
by specifying it as a key/value pair UUID="14314872-abd5-24e7-a850-db36fab2c6a1"
inplace of /dev/sdb
.
The main reason to use UUID
or PARTUUID
instead of device paths is that they are more consistent when changing the physical disks. The devices are numbered according to how they are presented to the OS by the bios (which is normally ordered by the socket they are plugged into). This means that if you add in a new device or physically rearrange existing devices they will be renumbered and what was /dev/sdb
before might not be now. As you can imagine this will result in the wrong disk being mounted to the wrong location. UUID
and PARTUUID
are ids that are written as part of formatting the filesystem for UUID
or at the time of creating the partition in the case of PARTUUID
. These numbers are written to the disk and will always remain the same so can be used to mount the correct disk even when the underlying device file gets renumbered.
Side note: Your devices are a bit confusing - you have /dev/sdb
mounted to /lpo/sda
- while that works it can be confusing and lead to errors when you maintain/configuring your system, you may want to make these more consistent.
UUID="14314872-abd5-24e7-a850-db36fab2c6a1" /lpo/sda ext4 defaults,noatime 0 0
UUID="6d439357-3d20-48de-9973-3afb2a325eee" /lpo/sdb ext4 defaults,noatime 0 0
The format of entries in fstab are as follows:
<file system> <dir> <type> <options> <dump> <pass>
Where <file system>
is the device you want to mount (such as /dev/sdb
and <dir>
is the path to where the device should be mounted (/lpo/sda
in your case).
There are multiple ways you can specify <file system>
, the simplest being the path to the file system device in question /dev/sdb
in your case (although typically they point to a partition on a drive rather than the drive, such as /dev/sdb1
but it appears that your drives lack a partition table and simply have the filesystem on the main device). But you can also use the device UUID
or PARTUUID
by specifying it as a key/value pair UUID="14314872-abd5-24e7-a850-db36fab2c6a1"
inplace of /dev/sdb
.
The main reason to use UUID
or PARTUUID
instead of device paths is that they are more consistent when changing the physical disks. The devices are numbered according to how they are presented to the OS by the bios (which is normally ordered by the socket they are plugged into). This means that if you add in a new device or physically rearrange existing devices they will be renumbered and what was /dev/sdb
before might not be now. As you can imagine this will result in the wrong disk being mounted to the wrong location. UUID
and PARTUUID
are ids that are written as part of formatting the filesystem for UUID
or at the time of creating the partition in the case of PARTUUID
. These numbers are written to the disk and will always remain the same so can be used to mount the correct disk even when the underlying device file gets renumbered.
Side note: Your devices are a bit confusing - you have /dev/sdb
mounted to /lpo/sda
- while that works it can be confusing and lead to errors when you maintain/configuring your system, you may want to make these more consistent.
edited Sep 25 '17 at 19:02
answered Sep 25 '17 at 18:37
Michael Daffin
2,6101517
2,6101517
ok so when need to use the UUID instead the default conf ?
â yael
Sep 25 '17 at 18:41
1
@yael Basically for consistency when the you add or remove disks - I have updated my answer with more details.
â Michael Daffin
Sep 25 '17 at 18:50
add a comment |Â
ok so when need to use the UUID instead the default conf ?
â yael
Sep 25 '17 at 18:41
1
@yael Basically for consistency when the you add or remove disks - I have updated my answer with more details.
â Michael Daffin
Sep 25 '17 at 18:50
ok so when need to use the UUID instead the default conf ?
â yael
Sep 25 '17 at 18:41
ok so when need to use the UUID instead the default conf ?
â yael
Sep 25 '17 at 18:41
1
1
@yael Basically for consistency when the you add or remove disks - I have updated my answer with more details.
â Michael Daffin
Sep 25 '17 at 18:50
@yael Basically for consistency when the you add or remove disks - I have updated my answer with more details.
â Michael Daffin
Sep 25 '17 at 18:50
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%2f394381%2fhow-to-update-fstab-file-with-uuid%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