How do I create a proper /etc/fstab file for my LFS partition?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












I'm trying to create an appropriate /etc/fstab file for my LFS partition, as in LFS part 8.2. How do I find out the file systems for my / mount-point and my swap mount point ( and )? And how do I find out the type of my / mount-point? I'm using a Ubuntu 17.04 host, and this is what I'm using as a model (pasted below).



cat > /etc/fstab << "EOF"
# Begin /etc/fstab

# file system mount-point type options dump fsck
# order

/dev/<xxx> / <fff> defaults 1 1
/dev/<yyy> swap swap pri=1 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0

# End /etc/fstab
EO









share|improve this question





















  • blkid is your friend! Also if you used archlinux, genfstab works in LFS (it's a simple bash script to generate a fstab).
    – cylgalad
    Oct 2 '17 at 8:37















up vote
1
down vote

favorite
1












I'm trying to create an appropriate /etc/fstab file for my LFS partition, as in LFS part 8.2. How do I find out the file systems for my / mount-point and my swap mount point ( and )? And how do I find out the type of my / mount-point? I'm using a Ubuntu 17.04 host, and this is what I'm using as a model (pasted below).



cat > /etc/fstab << "EOF"
# Begin /etc/fstab

# file system mount-point type options dump fsck
# order

/dev/<xxx> / <fff> defaults 1 1
/dev/<yyy> swap swap pri=1 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0

# End /etc/fstab
EO









share|improve this question





















  • blkid is your friend! Also if you used archlinux, genfstab works in LFS (it's a simple bash script to generate a fstab).
    – cylgalad
    Oct 2 '17 at 8:37













up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I'm trying to create an appropriate /etc/fstab file for my LFS partition, as in LFS part 8.2. How do I find out the file systems for my / mount-point and my swap mount point ( and )? And how do I find out the type of my / mount-point? I'm using a Ubuntu 17.04 host, and this is what I'm using as a model (pasted below).



cat > /etc/fstab << "EOF"
# Begin /etc/fstab

# file system mount-point type options dump fsck
# order

/dev/<xxx> / <fff> defaults 1 1
/dev/<yyy> swap swap pri=1 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0

# End /etc/fstab
EO









share|improve this question













I'm trying to create an appropriate /etc/fstab file for my LFS partition, as in LFS part 8.2. How do I find out the file systems for my / mount-point and my swap mount point ( and )? And how do I find out the type of my / mount-point? I'm using a Ubuntu 17.04 host, and this is what I'm using as a model (pasted below).



cat > /etc/fstab << "EOF"
# Begin /etc/fstab

# file system mount-point type options dump fsck
# order

/dev/<xxx> / <fff> defaults 1 1
/dev/<yyy> swap swap pri=1 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0

# End /etc/fstab
EO






ubuntu fstab lfs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 1 '17 at 19:31









fgjt

83




83











  • blkid is your friend! Also if you used archlinux, genfstab works in LFS (it's a simple bash script to generate a fstab).
    – cylgalad
    Oct 2 '17 at 8:37

















  • blkid is your friend! Also if you used archlinux, genfstab works in LFS (it's a simple bash script to generate a fstab).
    – cylgalad
    Oct 2 '17 at 8:37
















blkid is your friend! Also if you used archlinux, genfstab works in LFS (it's a simple bash script to generate a fstab).
– cylgalad
Oct 2 '17 at 8:37





blkid is your friend! Also if you used archlinux, genfstab works in LFS (it's a simple bash script to generate a fstab).
– cylgalad
Oct 2 '17 at 8:37











2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










as per lfs book description:




Replace <xxx>, <yyy>, and <fff> with the values appropriate for the
system, for example, sda2, sda5, and ext4.




your root partition described by:



/dev/<xxx> / <fff> defaults 1 1


is the same partition you set up in chapter "2.4. Creating a New Partition", and later mounted as your $LFS (by default /mnt/lfs). and as per book description it's something like /dev/sda5.



type of root partition (<fff> in fstab example) was set by you in chapter "2.5. Creating a File System on the Partition". by default it is ext4.



if unsure, you can use mount command from your host. wihout any options it returns all mounted partitions, so you look for something like:



/dev/sda9 on /mnt/lfs type ext4 (rw,relatime,data=ordered)


in my case it is device /dev/sda9 and type is ext4, and that's what i put in my fstab for <xxx> and <fff>.



swap partition described by:



/dev/<yyy> swap swap pri=1 0 0


was probably already on your ubuntu host, so you didn't set it up in chapter 2. but we can again look it up in already mounted partitions.
command mount | grep swap will show you only mounted swap partitions. and again, you take device name and substitute <yyy> for it :)



rest of the fstab file you leave as it is in the example, should work without any more changes.






share|improve this answer





























    up vote
    -1
    down vote













    I am not familiar with LFS. But, the "mount" command does a good job of guessing what file system is on the partition. Create a mount point for the partition, mount it, then run the mount command again.



    # mkdir -p /mnt/hd
    # mount /dev/sdb1 /mnt/hd
    # mount


    The output of the last command should look something like this:



    /dev/sda6 swap swap defaults 0 0
    /dev/sda8 / ext4 defaults 1 1
    /dev/sda5 /mnt/old ext4 defaults 1 2
    /dev/sda7 /usr/src/ ext4 defaults 1 2
    /dev/sda9 /var/log ext4 defaults 1 2
    /dev/sdb1 /home ext4 defaults 1 2





    share|improve this answer




















      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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395512%2fhow-do-i-create-a-proper-etc-fstab-file-for-my-lfs-partition%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote



      accepted










      as per lfs book description:




      Replace <xxx>, <yyy>, and <fff> with the values appropriate for the
      system, for example, sda2, sda5, and ext4.




      your root partition described by:



      /dev/<xxx> / <fff> defaults 1 1


      is the same partition you set up in chapter "2.4. Creating a New Partition", and later mounted as your $LFS (by default /mnt/lfs). and as per book description it's something like /dev/sda5.



      type of root partition (<fff> in fstab example) was set by you in chapter "2.5. Creating a File System on the Partition". by default it is ext4.



      if unsure, you can use mount command from your host. wihout any options it returns all mounted partitions, so you look for something like:



      /dev/sda9 on /mnt/lfs type ext4 (rw,relatime,data=ordered)


      in my case it is device /dev/sda9 and type is ext4, and that's what i put in my fstab for <xxx> and <fff>.



      swap partition described by:



      /dev/<yyy> swap swap pri=1 0 0


      was probably already on your ubuntu host, so you didn't set it up in chapter 2. but we can again look it up in already mounted partitions.
      command mount | grep swap will show you only mounted swap partitions. and again, you take device name and substitute <yyy> for it :)



      rest of the fstab file you leave as it is in the example, should work without any more changes.






      share|improve this answer


























        up vote
        0
        down vote



        accepted










        as per lfs book description:




        Replace <xxx>, <yyy>, and <fff> with the values appropriate for the
        system, for example, sda2, sda5, and ext4.




        your root partition described by:



        /dev/<xxx> / <fff> defaults 1 1


        is the same partition you set up in chapter "2.4. Creating a New Partition", and later mounted as your $LFS (by default /mnt/lfs). and as per book description it's something like /dev/sda5.



        type of root partition (<fff> in fstab example) was set by you in chapter "2.5. Creating a File System on the Partition". by default it is ext4.



        if unsure, you can use mount command from your host. wihout any options it returns all mounted partitions, so you look for something like:



        /dev/sda9 on /mnt/lfs type ext4 (rw,relatime,data=ordered)


        in my case it is device /dev/sda9 and type is ext4, and that's what i put in my fstab for <xxx> and <fff>.



        swap partition described by:



        /dev/<yyy> swap swap pri=1 0 0


        was probably already on your ubuntu host, so you didn't set it up in chapter 2. but we can again look it up in already mounted partitions.
        command mount | grep swap will show you only mounted swap partitions. and again, you take device name and substitute <yyy> for it :)



        rest of the fstab file you leave as it is in the example, should work without any more changes.






        share|improve this answer
























          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          as per lfs book description:




          Replace <xxx>, <yyy>, and <fff> with the values appropriate for the
          system, for example, sda2, sda5, and ext4.




          your root partition described by:



          /dev/<xxx> / <fff> defaults 1 1


          is the same partition you set up in chapter "2.4. Creating a New Partition", and later mounted as your $LFS (by default /mnt/lfs). and as per book description it's something like /dev/sda5.



          type of root partition (<fff> in fstab example) was set by you in chapter "2.5. Creating a File System on the Partition". by default it is ext4.



          if unsure, you can use mount command from your host. wihout any options it returns all mounted partitions, so you look for something like:



          /dev/sda9 on /mnt/lfs type ext4 (rw,relatime,data=ordered)


          in my case it is device /dev/sda9 and type is ext4, and that's what i put in my fstab for <xxx> and <fff>.



          swap partition described by:



          /dev/<yyy> swap swap pri=1 0 0


          was probably already on your ubuntu host, so you didn't set it up in chapter 2. but we can again look it up in already mounted partitions.
          command mount | grep swap will show you only mounted swap partitions. and again, you take device name and substitute <yyy> for it :)



          rest of the fstab file you leave as it is in the example, should work without any more changes.






          share|improve this answer














          as per lfs book description:




          Replace <xxx>, <yyy>, and <fff> with the values appropriate for the
          system, for example, sda2, sda5, and ext4.




          your root partition described by:



          /dev/<xxx> / <fff> defaults 1 1


          is the same partition you set up in chapter "2.4. Creating a New Partition", and later mounted as your $LFS (by default /mnt/lfs). and as per book description it's something like /dev/sda5.



          type of root partition (<fff> in fstab example) was set by you in chapter "2.5. Creating a File System on the Partition". by default it is ext4.



          if unsure, you can use mount command from your host. wihout any options it returns all mounted partitions, so you look for something like:



          /dev/sda9 on /mnt/lfs type ext4 (rw,relatime,data=ordered)


          in my case it is device /dev/sda9 and type is ext4, and that's what i put in my fstab for <xxx> and <fff>.



          swap partition described by:



          /dev/<yyy> swap swap pri=1 0 0


          was probably already on your ubuntu host, so you didn't set it up in chapter 2. but we can again look it up in already mounted partitions.
          command mount | grep swap will show you only mounted swap partitions. and again, you take device name and substitute <yyy> for it :)



          rest of the fstab file you leave as it is in the example, should work without any more changes.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 2 '17 at 2:12

























          answered Oct 2 '17 at 2:03









          rsm

          1589




          1589






















              up vote
              -1
              down vote













              I am not familiar with LFS. But, the "mount" command does a good job of guessing what file system is on the partition. Create a mount point for the partition, mount it, then run the mount command again.



              # mkdir -p /mnt/hd
              # mount /dev/sdb1 /mnt/hd
              # mount


              The output of the last command should look something like this:



              /dev/sda6 swap swap defaults 0 0
              /dev/sda8 / ext4 defaults 1 1
              /dev/sda5 /mnt/old ext4 defaults 1 2
              /dev/sda7 /usr/src/ ext4 defaults 1 2
              /dev/sda9 /var/log ext4 defaults 1 2
              /dev/sdb1 /home ext4 defaults 1 2





              share|improve this answer
























                up vote
                -1
                down vote













                I am not familiar with LFS. But, the "mount" command does a good job of guessing what file system is on the partition. Create a mount point for the partition, mount it, then run the mount command again.



                # mkdir -p /mnt/hd
                # mount /dev/sdb1 /mnt/hd
                # mount


                The output of the last command should look something like this:



                /dev/sda6 swap swap defaults 0 0
                /dev/sda8 / ext4 defaults 1 1
                /dev/sda5 /mnt/old ext4 defaults 1 2
                /dev/sda7 /usr/src/ ext4 defaults 1 2
                /dev/sda9 /var/log ext4 defaults 1 2
                /dev/sdb1 /home ext4 defaults 1 2





                share|improve this answer






















                  up vote
                  -1
                  down vote










                  up vote
                  -1
                  down vote









                  I am not familiar with LFS. But, the "mount" command does a good job of guessing what file system is on the partition. Create a mount point for the partition, mount it, then run the mount command again.



                  # mkdir -p /mnt/hd
                  # mount /dev/sdb1 /mnt/hd
                  # mount


                  The output of the last command should look something like this:



                  /dev/sda6 swap swap defaults 0 0
                  /dev/sda8 / ext4 defaults 1 1
                  /dev/sda5 /mnt/old ext4 defaults 1 2
                  /dev/sda7 /usr/src/ ext4 defaults 1 2
                  /dev/sda9 /var/log ext4 defaults 1 2
                  /dev/sdb1 /home ext4 defaults 1 2





                  share|improve this answer












                  I am not familiar with LFS. But, the "mount" command does a good job of guessing what file system is on the partition. Create a mount point for the partition, mount it, then run the mount command again.



                  # mkdir -p /mnt/hd
                  # mount /dev/sdb1 /mnt/hd
                  # mount


                  The output of the last command should look something like this:



                  /dev/sda6 swap swap defaults 0 0
                  /dev/sda8 / ext4 defaults 1 1
                  /dev/sda5 /mnt/old ext4 defaults 1 2
                  /dev/sda7 /usr/src/ ext4 defaults 1 2
                  /dev/sda9 /var/log ext4 defaults 1 2
                  /dev/sdb1 /home ext4 defaults 1 2






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 1 '17 at 22:01









                  Garnet

                  1




                  1



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395512%2fhow-do-i-create-a-proper-etc-fstab-file-for-my-lfs-partition%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay