how to enter mount details in fstab
Clash Royale CLAN TAG#URR8PPP
$ sudo blkid
/dev/mapper/vg_proj-lvswap: UUID="e2ce33bc-d4c9-4f82-80f3-665410e039b8"
TYPE="swap"
/dev/mapper/vg_proj-lvora: UUID="53a8dcc2-170f-47c7-99ff-6bc9d0abc3fc"
TYPE="ext4"
/dev/mapper/vg_proj-lvdata: UUID="62bdbde7-598a-4a21-9e6c-7222a0bdd224"
TYPE="ext4"
There are already some default entries in fstab and i created three logical volumes (one is swap) as mentioned above and need to enter them in fstab. In which format i need to enter these details in fstab to mount properly ? How to ensure that there are no errors so that it will not cause problem after reboot ?
rhel
add a comment |
$ sudo blkid
/dev/mapper/vg_proj-lvswap: UUID="e2ce33bc-d4c9-4f82-80f3-665410e039b8"
TYPE="swap"
/dev/mapper/vg_proj-lvora: UUID="53a8dcc2-170f-47c7-99ff-6bc9d0abc3fc"
TYPE="ext4"
/dev/mapper/vg_proj-lvdata: UUID="62bdbde7-598a-4a21-9e6c-7222a0bdd224"
TYPE="ext4"
There are already some default entries in fstab and i created three logical volumes (one is swap) as mentioned above and need to enter them in fstab. In which format i need to enter these details in fstab to mount properly ? How to ensure that there are no errors so that it will not cause problem after reboot ?
rhel
add a comment |
$ sudo blkid
/dev/mapper/vg_proj-lvswap: UUID="e2ce33bc-d4c9-4f82-80f3-665410e039b8"
TYPE="swap"
/dev/mapper/vg_proj-lvora: UUID="53a8dcc2-170f-47c7-99ff-6bc9d0abc3fc"
TYPE="ext4"
/dev/mapper/vg_proj-lvdata: UUID="62bdbde7-598a-4a21-9e6c-7222a0bdd224"
TYPE="ext4"
There are already some default entries in fstab and i created three logical volumes (one is swap) as mentioned above and need to enter them in fstab. In which format i need to enter these details in fstab to mount properly ? How to ensure that there are no errors so that it will not cause problem after reboot ?
rhel
$ sudo blkid
/dev/mapper/vg_proj-lvswap: UUID="e2ce33bc-d4c9-4f82-80f3-665410e039b8"
TYPE="swap"
/dev/mapper/vg_proj-lvora: UUID="53a8dcc2-170f-47c7-99ff-6bc9d0abc3fc"
TYPE="ext4"
/dev/mapper/vg_proj-lvdata: UUID="62bdbde7-598a-4a21-9e6c-7222a0bdd224"
TYPE="ext4"
There are already some default entries in fstab and i created three logical volumes (one is swap) as mentioned above and need to enter them in fstab. In which format i need to enter these details in fstab to mount properly ? How to ensure that there are no errors so that it will not cause problem after reboot ?
rhel
rhel
edited Feb 20 at 9:11
BlackCrystal
33112
33112
asked Feb 20 at 8:32
user2439245user2439245
122
122
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Note: Swap partitions/LVs won't be mounted as such; instead, they will be enabled with swapon
.
With LVM, there is no real advantage to using the UUID over using the LV device name, as the LVM subsystem already searches all disks for LVM UUIDs when starting up and whenever new devices are detected. So I prefer using names.
With LVM, there's one extra trick. You can usually specify the name of a LVM LV in two forms: either the actual name /dev/mapper/<VG name>-<LV name>
or the legacy LVMv1 compatibility alias: /dev/<VG name>/<LV name>
. Usually both forms are equivalent, but when specifying the root filesystem, you might want to stick with the current syntax as the initramfs might not implement the legacy compatibility.
So, you could specify them like this:
/dev/mapper/vg_proj-lvswap none swap defaults 0 0
/dev/mapper/vg_proj-lvora <desired mountpoint> ext4 defaults 0 2
/dev/mapper/vg_proj-lvdata <desired mountpoint> ext4 defaults 0 2
Or like this:
/dev/vg_proj/lvswap none swap defaults 0 0
/dev/vg_proj/lvora <desired mountpoint> ext4 defaults 0 2
/dev/vg_proj/lvdata <desired mountpoint> ext4 defaults 0 2
Or using UUIDs like this:
UUID="e2ce33bc-d4c9-4f82-80f3-665410e039b8" none swap defaults 0 0
UUID="53a8dcc2-170f-47c7-99ff-6bc9d0abc3fc" <desired mountpoint> ext4 defaults 0 2
UUID="62bdbde7-598a-4a21-9e6c-7222a0bdd224" <desired mountpoint> ext4 defaults 0 2
All the above three forms should be equivalent for the computer, but in my opinion, the first two are more sysadmin-friendly than the third one.
After adding the appropriate lines to /etc/fstab
and ensuring the mount point directories exist, instead of mounting the filesystems manually, you might use mount -a
to tell the system to mount them based on the edited fstab file. If this results in errors, you'll know you made a typo in editing the fstab file.
(Unless, of course, your fstab file contains filesystems that are configured to be mounted, but cannot be mounted right now for whatever reason. But if that's true, those would also cause you problems at reboot, so it's still a good check.)
add a comment |
To enter the details within your fstab file it is firstly important to know where you can locate the fstab file. Usually, in a standard Linux build; the fstab file is located on the following filepath:
/etc/fstab
Due to the nature of this file you need to have admin/sudo privileges so ensure to execute sudo alongside your chosen text editor. The format in this case will be the following:
Format your file in order of the objects mentioned.
Device - This field fully specifies the mount device which you need to apply. I notice in your answer you have both UUID and device label, you can use one or the other.
Mount point - You then need to specify the mount point the partition or disk will be mounted. In your case it is an LVM which is a disk and that disk must reside somewhere in the file system. For example: swap. That is one component which you need for one of your disks so for example your formatting would like
INCOMPLETE EXAMPLE/dev/mapper/vg_proj-lvswap swap
File system type - There are many types of file systems available such as ext4, ext3, xfs, zfs, swap. You need to specify the type of file system required after specifying the mount point.
Options - Once you've specified the core areas such as the file system type, label and mount point; you then need to specify how you want the kernel to treat your mounted device. There are a number of options available which can determine the behavior and purpose of your mounted FS (File System), a good reference point would be this site.
https://pclosmag.com/html/Issues/200709/page07.html
Backup option (Optional) - The next field you will need is a specification of backing up the partition you have added in a dump format. You can either add 1 if you choose to do so or simply add 0 or just ignore. This field is not important and is not required.
File system check - When a Linux system boots, the file systems need to be checked for errors on boot time depending on the level of priority added in the FSTAB file. You have three different options which you can add for your priority check ranging from 0 to 2.
0 - Ignore file system check
1 - Specify root partition
2 - File system will be checked using a program namedfsck
(File System Consistency Check)
More information on file system checking is here:
https://askubuntu.com/questions/9939/what-do-the-last-two-fields-in-fstab-mean
Information on fsck: https://linux.die.net/man/8/fsck
Complete example:
/dev/mapper/vg_proj-lvswap swap swap defaults 0 0
Assuming you have made your LVMs and your swap partition this is all you will need to do with a reboot. Please be careful whilst editing this file as a false entry could cause you some issues.
Once you have added all the device names to the mount points you want. Run the mount
command to add these to your file system and you're good to go.
References:
https://geek-university.com/linux/etc-fstab-file/
https://wiki.archlinux.org/index.php/fstab
https://pclosmag.com/html/Issues/200709/page07.html
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f501792%2fhow-to-enter-mount-details-in-fstab%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Note: Swap partitions/LVs won't be mounted as such; instead, they will be enabled with swapon
.
With LVM, there is no real advantage to using the UUID over using the LV device name, as the LVM subsystem already searches all disks for LVM UUIDs when starting up and whenever new devices are detected. So I prefer using names.
With LVM, there's one extra trick. You can usually specify the name of a LVM LV in two forms: either the actual name /dev/mapper/<VG name>-<LV name>
or the legacy LVMv1 compatibility alias: /dev/<VG name>/<LV name>
. Usually both forms are equivalent, but when specifying the root filesystem, you might want to stick with the current syntax as the initramfs might not implement the legacy compatibility.
So, you could specify them like this:
/dev/mapper/vg_proj-lvswap none swap defaults 0 0
/dev/mapper/vg_proj-lvora <desired mountpoint> ext4 defaults 0 2
/dev/mapper/vg_proj-lvdata <desired mountpoint> ext4 defaults 0 2
Or like this:
/dev/vg_proj/lvswap none swap defaults 0 0
/dev/vg_proj/lvora <desired mountpoint> ext4 defaults 0 2
/dev/vg_proj/lvdata <desired mountpoint> ext4 defaults 0 2
Or using UUIDs like this:
UUID="e2ce33bc-d4c9-4f82-80f3-665410e039b8" none swap defaults 0 0
UUID="53a8dcc2-170f-47c7-99ff-6bc9d0abc3fc" <desired mountpoint> ext4 defaults 0 2
UUID="62bdbde7-598a-4a21-9e6c-7222a0bdd224" <desired mountpoint> ext4 defaults 0 2
All the above three forms should be equivalent for the computer, but in my opinion, the first two are more sysadmin-friendly than the third one.
After adding the appropriate lines to /etc/fstab
and ensuring the mount point directories exist, instead of mounting the filesystems manually, you might use mount -a
to tell the system to mount them based on the edited fstab file. If this results in errors, you'll know you made a typo in editing the fstab file.
(Unless, of course, your fstab file contains filesystems that are configured to be mounted, but cannot be mounted right now for whatever reason. But if that's true, those would also cause you problems at reboot, so it's still a good check.)
add a comment |
Note: Swap partitions/LVs won't be mounted as such; instead, they will be enabled with swapon
.
With LVM, there is no real advantage to using the UUID over using the LV device name, as the LVM subsystem already searches all disks for LVM UUIDs when starting up and whenever new devices are detected. So I prefer using names.
With LVM, there's one extra trick. You can usually specify the name of a LVM LV in two forms: either the actual name /dev/mapper/<VG name>-<LV name>
or the legacy LVMv1 compatibility alias: /dev/<VG name>/<LV name>
. Usually both forms are equivalent, but when specifying the root filesystem, you might want to stick with the current syntax as the initramfs might not implement the legacy compatibility.
So, you could specify them like this:
/dev/mapper/vg_proj-lvswap none swap defaults 0 0
/dev/mapper/vg_proj-lvora <desired mountpoint> ext4 defaults 0 2
/dev/mapper/vg_proj-lvdata <desired mountpoint> ext4 defaults 0 2
Or like this:
/dev/vg_proj/lvswap none swap defaults 0 0
/dev/vg_proj/lvora <desired mountpoint> ext4 defaults 0 2
/dev/vg_proj/lvdata <desired mountpoint> ext4 defaults 0 2
Or using UUIDs like this:
UUID="e2ce33bc-d4c9-4f82-80f3-665410e039b8" none swap defaults 0 0
UUID="53a8dcc2-170f-47c7-99ff-6bc9d0abc3fc" <desired mountpoint> ext4 defaults 0 2
UUID="62bdbde7-598a-4a21-9e6c-7222a0bdd224" <desired mountpoint> ext4 defaults 0 2
All the above three forms should be equivalent for the computer, but in my opinion, the first two are more sysadmin-friendly than the third one.
After adding the appropriate lines to /etc/fstab
and ensuring the mount point directories exist, instead of mounting the filesystems manually, you might use mount -a
to tell the system to mount them based on the edited fstab file. If this results in errors, you'll know you made a typo in editing the fstab file.
(Unless, of course, your fstab file contains filesystems that are configured to be mounted, but cannot be mounted right now for whatever reason. But if that's true, those would also cause you problems at reboot, so it's still a good check.)
add a comment |
Note: Swap partitions/LVs won't be mounted as such; instead, they will be enabled with swapon
.
With LVM, there is no real advantage to using the UUID over using the LV device name, as the LVM subsystem already searches all disks for LVM UUIDs when starting up and whenever new devices are detected. So I prefer using names.
With LVM, there's one extra trick. You can usually specify the name of a LVM LV in two forms: either the actual name /dev/mapper/<VG name>-<LV name>
or the legacy LVMv1 compatibility alias: /dev/<VG name>/<LV name>
. Usually both forms are equivalent, but when specifying the root filesystem, you might want to stick with the current syntax as the initramfs might not implement the legacy compatibility.
So, you could specify them like this:
/dev/mapper/vg_proj-lvswap none swap defaults 0 0
/dev/mapper/vg_proj-lvora <desired mountpoint> ext4 defaults 0 2
/dev/mapper/vg_proj-lvdata <desired mountpoint> ext4 defaults 0 2
Or like this:
/dev/vg_proj/lvswap none swap defaults 0 0
/dev/vg_proj/lvora <desired mountpoint> ext4 defaults 0 2
/dev/vg_proj/lvdata <desired mountpoint> ext4 defaults 0 2
Or using UUIDs like this:
UUID="e2ce33bc-d4c9-4f82-80f3-665410e039b8" none swap defaults 0 0
UUID="53a8dcc2-170f-47c7-99ff-6bc9d0abc3fc" <desired mountpoint> ext4 defaults 0 2
UUID="62bdbde7-598a-4a21-9e6c-7222a0bdd224" <desired mountpoint> ext4 defaults 0 2
All the above three forms should be equivalent for the computer, but in my opinion, the first two are more sysadmin-friendly than the third one.
After adding the appropriate lines to /etc/fstab
and ensuring the mount point directories exist, instead of mounting the filesystems manually, you might use mount -a
to tell the system to mount them based on the edited fstab file. If this results in errors, you'll know you made a typo in editing the fstab file.
(Unless, of course, your fstab file contains filesystems that are configured to be mounted, but cannot be mounted right now for whatever reason. But if that's true, those would also cause you problems at reboot, so it's still a good check.)
Note: Swap partitions/LVs won't be mounted as such; instead, they will be enabled with swapon
.
With LVM, there is no real advantage to using the UUID over using the LV device name, as the LVM subsystem already searches all disks for LVM UUIDs when starting up and whenever new devices are detected. So I prefer using names.
With LVM, there's one extra trick. You can usually specify the name of a LVM LV in two forms: either the actual name /dev/mapper/<VG name>-<LV name>
or the legacy LVMv1 compatibility alias: /dev/<VG name>/<LV name>
. Usually both forms are equivalent, but when specifying the root filesystem, you might want to stick with the current syntax as the initramfs might not implement the legacy compatibility.
So, you could specify them like this:
/dev/mapper/vg_proj-lvswap none swap defaults 0 0
/dev/mapper/vg_proj-lvora <desired mountpoint> ext4 defaults 0 2
/dev/mapper/vg_proj-lvdata <desired mountpoint> ext4 defaults 0 2
Or like this:
/dev/vg_proj/lvswap none swap defaults 0 0
/dev/vg_proj/lvora <desired mountpoint> ext4 defaults 0 2
/dev/vg_proj/lvdata <desired mountpoint> ext4 defaults 0 2
Or using UUIDs like this:
UUID="e2ce33bc-d4c9-4f82-80f3-665410e039b8" none swap defaults 0 0
UUID="53a8dcc2-170f-47c7-99ff-6bc9d0abc3fc" <desired mountpoint> ext4 defaults 0 2
UUID="62bdbde7-598a-4a21-9e6c-7222a0bdd224" <desired mountpoint> ext4 defaults 0 2
All the above three forms should be equivalent for the computer, but in my opinion, the first two are more sysadmin-friendly than the third one.
After adding the appropriate lines to /etc/fstab
and ensuring the mount point directories exist, instead of mounting the filesystems manually, you might use mount -a
to tell the system to mount them based on the edited fstab file. If this results in errors, you'll know you made a typo in editing the fstab file.
(Unless, of course, your fstab file contains filesystems that are configured to be mounted, but cannot be mounted right now for whatever reason. But if that's true, those would also cause you problems at reboot, so it's still a good check.)
answered Feb 20 at 8:54
telcoMtelcoM
19.2k12348
19.2k12348
add a comment |
add a comment |
To enter the details within your fstab file it is firstly important to know where you can locate the fstab file. Usually, in a standard Linux build; the fstab file is located on the following filepath:
/etc/fstab
Due to the nature of this file you need to have admin/sudo privileges so ensure to execute sudo alongside your chosen text editor. The format in this case will be the following:
Format your file in order of the objects mentioned.
Device - This field fully specifies the mount device which you need to apply. I notice in your answer you have both UUID and device label, you can use one or the other.
Mount point - You then need to specify the mount point the partition or disk will be mounted. In your case it is an LVM which is a disk and that disk must reside somewhere in the file system. For example: swap. That is one component which you need for one of your disks so for example your formatting would like
INCOMPLETE EXAMPLE/dev/mapper/vg_proj-lvswap swap
File system type - There are many types of file systems available such as ext4, ext3, xfs, zfs, swap. You need to specify the type of file system required after specifying the mount point.
Options - Once you've specified the core areas such as the file system type, label and mount point; you then need to specify how you want the kernel to treat your mounted device. There are a number of options available which can determine the behavior and purpose of your mounted FS (File System), a good reference point would be this site.
https://pclosmag.com/html/Issues/200709/page07.html
Backup option (Optional) - The next field you will need is a specification of backing up the partition you have added in a dump format. You can either add 1 if you choose to do so or simply add 0 or just ignore. This field is not important and is not required.
File system check - When a Linux system boots, the file systems need to be checked for errors on boot time depending on the level of priority added in the FSTAB file. You have three different options which you can add for your priority check ranging from 0 to 2.
0 - Ignore file system check
1 - Specify root partition
2 - File system will be checked using a program namedfsck
(File System Consistency Check)
More information on file system checking is here:
https://askubuntu.com/questions/9939/what-do-the-last-two-fields-in-fstab-mean
Information on fsck: https://linux.die.net/man/8/fsck
Complete example:
/dev/mapper/vg_proj-lvswap swap swap defaults 0 0
Assuming you have made your LVMs and your swap partition this is all you will need to do with a reboot. Please be careful whilst editing this file as a false entry could cause you some issues.
Once you have added all the device names to the mount points you want. Run the mount
command to add these to your file system and you're good to go.
References:
https://geek-university.com/linux/etc-fstab-file/
https://wiki.archlinux.org/index.php/fstab
https://pclosmag.com/html/Issues/200709/page07.html
add a comment |
To enter the details within your fstab file it is firstly important to know where you can locate the fstab file. Usually, in a standard Linux build; the fstab file is located on the following filepath:
/etc/fstab
Due to the nature of this file you need to have admin/sudo privileges so ensure to execute sudo alongside your chosen text editor. The format in this case will be the following:
Format your file in order of the objects mentioned.
Device - This field fully specifies the mount device which you need to apply. I notice in your answer you have both UUID and device label, you can use one or the other.
Mount point - You then need to specify the mount point the partition or disk will be mounted. In your case it is an LVM which is a disk and that disk must reside somewhere in the file system. For example: swap. That is one component which you need for one of your disks so for example your formatting would like
INCOMPLETE EXAMPLE/dev/mapper/vg_proj-lvswap swap
File system type - There are many types of file systems available such as ext4, ext3, xfs, zfs, swap. You need to specify the type of file system required after specifying the mount point.
Options - Once you've specified the core areas such as the file system type, label and mount point; you then need to specify how you want the kernel to treat your mounted device. There are a number of options available which can determine the behavior and purpose of your mounted FS (File System), a good reference point would be this site.
https://pclosmag.com/html/Issues/200709/page07.html
Backup option (Optional) - The next field you will need is a specification of backing up the partition you have added in a dump format. You can either add 1 if you choose to do so or simply add 0 or just ignore. This field is not important and is not required.
File system check - When a Linux system boots, the file systems need to be checked for errors on boot time depending on the level of priority added in the FSTAB file. You have three different options which you can add for your priority check ranging from 0 to 2.
0 - Ignore file system check
1 - Specify root partition
2 - File system will be checked using a program namedfsck
(File System Consistency Check)
More information on file system checking is here:
https://askubuntu.com/questions/9939/what-do-the-last-two-fields-in-fstab-mean
Information on fsck: https://linux.die.net/man/8/fsck
Complete example:
/dev/mapper/vg_proj-lvswap swap swap defaults 0 0
Assuming you have made your LVMs and your swap partition this is all you will need to do with a reboot. Please be careful whilst editing this file as a false entry could cause you some issues.
Once you have added all the device names to the mount points you want. Run the mount
command to add these to your file system and you're good to go.
References:
https://geek-university.com/linux/etc-fstab-file/
https://wiki.archlinux.org/index.php/fstab
https://pclosmag.com/html/Issues/200709/page07.html
add a comment |
To enter the details within your fstab file it is firstly important to know where you can locate the fstab file. Usually, in a standard Linux build; the fstab file is located on the following filepath:
/etc/fstab
Due to the nature of this file you need to have admin/sudo privileges so ensure to execute sudo alongside your chosen text editor. The format in this case will be the following:
Format your file in order of the objects mentioned.
Device - This field fully specifies the mount device which you need to apply. I notice in your answer you have both UUID and device label, you can use one or the other.
Mount point - You then need to specify the mount point the partition or disk will be mounted. In your case it is an LVM which is a disk and that disk must reside somewhere in the file system. For example: swap. That is one component which you need for one of your disks so for example your formatting would like
INCOMPLETE EXAMPLE/dev/mapper/vg_proj-lvswap swap
File system type - There are many types of file systems available such as ext4, ext3, xfs, zfs, swap. You need to specify the type of file system required after specifying the mount point.
Options - Once you've specified the core areas such as the file system type, label and mount point; you then need to specify how you want the kernel to treat your mounted device. There are a number of options available which can determine the behavior and purpose of your mounted FS (File System), a good reference point would be this site.
https://pclosmag.com/html/Issues/200709/page07.html
Backup option (Optional) - The next field you will need is a specification of backing up the partition you have added in a dump format. You can either add 1 if you choose to do so or simply add 0 or just ignore. This field is not important and is not required.
File system check - When a Linux system boots, the file systems need to be checked for errors on boot time depending on the level of priority added in the FSTAB file. You have three different options which you can add for your priority check ranging from 0 to 2.
0 - Ignore file system check
1 - Specify root partition
2 - File system will be checked using a program namedfsck
(File System Consistency Check)
More information on file system checking is here:
https://askubuntu.com/questions/9939/what-do-the-last-two-fields-in-fstab-mean
Information on fsck: https://linux.die.net/man/8/fsck
Complete example:
/dev/mapper/vg_proj-lvswap swap swap defaults 0 0
Assuming you have made your LVMs and your swap partition this is all you will need to do with a reboot. Please be careful whilst editing this file as a false entry could cause you some issues.
Once you have added all the device names to the mount points you want. Run the mount
command to add these to your file system and you're good to go.
References:
https://geek-university.com/linux/etc-fstab-file/
https://wiki.archlinux.org/index.php/fstab
https://pclosmag.com/html/Issues/200709/page07.html
To enter the details within your fstab file it is firstly important to know where you can locate the fstab file. Usually, in a standard Linux build; the fstab file is located on the following filepath:
/etc/fstab
Due to the nature of this file you need to have admin/sudo privileges so ensure to execute sudo alongside your chosen text editor. The format in this case will be the following:
Format your file in order of the objects mentioned.
Device - This field fully specifies the mount device which you need to apply. I notice in your answer you have both UUID and device label, you can use one or the other.
Mount point - You then need to specify the mount point the partition or disk will be mounted. In your case it is an LVM which is a disk and that disk must reside somewhere in the file system. For example: swap. That is one component which you need for one of your disks so for example your formatting would like
INCOMPLETE EXAMPLE/dev/mapper/vg_proj-lvswap swap
File system type - There are many types of file systems available such as ext4, ext3, xfs, zfs, swap. You need to specify the type of file system required after specifying the mount point.
Options - Once you've specified the core areas such as the file system type, label and mount point; you then need to specify how you want the kernel to treat your mounted device. There are a number of options available which can determine the behavior and purpose of your mounted FS (File System), a good reference point would be this site.
https://pclosmag.com/html/Issues/200709/page07.html
Backup option (Optional) - The next field you will need is a specification of backing up the partition you have added in a dump format. You can either add 1 if you choose to do so or simply add 0 or just ignore. This field is not important and is not required.
File system check - When a Linux system boots, the file systems need to be checked for errors on boot time depending on the level of priority added in the FSTAB file. You have three different options which you can add for your priority check ranging from 0 to 2.
0 - Ignore file system check
1 - Specify root partition
2 - File system will be checked using a program namedfsck
(File System Consistency Check)
More information on file system checking is here:
https://askubuntu.com/questions/9939/what-do-the-last-two-fields-in-fstab-mean
Information on fsck: https://linux.die.net/man/8/fsck
Complete example:
/dev/mapper/vg_proj-lvswap swap swap defaults 0 0
Assuming you have made your LVMs and your swap partition this is all you will need to do with a reboot. Please be careful whilst editing this file as a false entry could cause you some issues.
Once you have added all the device names to the mount points you want. Run the mount
command to add these to your file system and you're good to go.
References:
https://geek-university.com/linux/etc-fstab-file/
https://wiki.archlinux.org/index.php/fstab
https://pclosmag.com/html/Issues/200709/page07.html
answered Feb 20 at 9:04
A.HussainA.Hussain
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f501792%2fhow-to-enter-mount-details-in-fstab%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