How to fix boot failure due to incorrect fstab?

Multi tool use
Multi tool use

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











up vote
19
down vote

favorite
12












It seems that I have added incorrect record to /etc/fstab:



//servername/share /mnt/share cifs defaults,username=myuser 0 0


When I did mount -a, it asked user password to mount network share. It seems that it cannot proceed without password on boot, so it is just hung.



How can I fix fstab to prevent boot failure?







share|improve this question


























    up vote
    19
    down vote

    favorite
    12












    It seems that I have added incorrect record to /etc/fstab:



    //servername/share /mnt/share cifs defaults,username=myuser 0 0


    When I did mount -a, it asked user password to mount network share. It seems that it cannot proceed without password on boot, so it is just hung.



    How can I fix fstab to prevent boot failure?







    share|improve this question
























      up vote
      19
      down vote

      favorite
      12









      up vote
      19
      down vote

      favorite
      12






      12





      It seems that I have added incorrect record to /etc/fstab:



      //servername/share /mnt/share cifs defaults,username=myuser 0 0


      When I did mount -a, it asked user password to mount network share. It seems that it cannot proceed without password on boot, so it is just hung.



      How can I fix fstab to prevent boot failure?







      share|improve this question














      It seems that I have added incorrect record to /etc/fstab:



      //servername/share /mnt/share cifs defaults,username=myuser 0 0


      When I did mount -a, it asked user password to mount network share. It seems that it cannot proceed without password on boot, so it is just hung.



      How can I fix fstab to prevent boot failure?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 10 '14 at 15:07









      Pro Backup

      1,91452853




      1,91452853










      asked Jul 26 '12 at 13:10









      altern

      78731120




      78731120




















          5 Answers
          5






          active

          oldest

          votes

















          up vote
          25
          down vote



          accepted










          It seems that I've found a solution:



          • at the grub prompt, hit a to append options

          • add init=/bin/bash to the end of the kernel command line and press enter

          The system will boot to a prompt like 'bash-3.2#' enter the following commands at the prompt



          • mount -o remount,rw /

          • vim /etc/fstab

          edit the fstab file commenting the errors by adding a # at the begining of each problematic line, save the file



          • reboot by pressing CTRL+ALT+DEL





          share|improve this answer


















          • 2




            I had to use mount -o remount,rw / --target / to succesfully remount in rw mode. Elsecase mount was picking the bad values from /etc/fstab, see the man mount for details.
            – laconbass
            Oct 18 '16 at 12:14











          • @laconbass you are damn right, --target / is the key!
            – sempasha
            Jul 28 '17 at 16:46

















          up vote
          2
          down vote













          How about removing the entry, creating a snapshot and then trying to change your /etc/fstab so you have a working snapshot you can roll back to?



          According to the manpage mount.cifs you can also specify a password via password=arg. Also, according to that manpage there is no argument username=arg but instead user=arg. But it might be different on your system, better check your manpage for the correct argument names.






          share|improve this answer




















          • man for the win.
            – Tim
            Jul 26 '12 at 13:22










          • I was about to create snapshot, but while I was experimenting with fstab, vm instance went off for some reason. Apparently, I wouldn't ask the question if I could fix it myself.
            – altern
            Jul 26 '12 at 13:31







          • 2




            Your problem description is a little bit unclear. Can't you boot in single user / recovery mode? It should only try to mount the root fs and leave the fstab alone.
            – scai
            Jul 26 '12 at 13:54


















          up vote
          0
          down vote













          The other easy way is booting to live-cd mode and mount the right partition. Then you can fix anything you want!






          share|improve this answer



























            up vote
            0
            down vote













            I found a solution to systems error kernel not loading
            Use live cd to gain access to your existing installation. Once in reinstall Linux kernel :



            pacman -S Linux


            Then delete the fstab file from etc/fstab :



            rm /etc/fstab


            Now reinstall systemd:



            pacman -S systemd


            When reinstalling systemd it will automatically generate a new fstab file



            Now reinstall the bootloader
            in this case I use grub:



            pacman -S grub os-prober


            (os probe is useful if you have more than 1 os installed on your hdd/ssd)
            Then



            grub-install --target=i386-pc /dev/sda


            Once finished make the configuration files:



            grub-mkconfig -o /boot/grub/grub.cfg


            Then unmount the partitions in use and reboot



            umount /dev/sdX 
            reboot


            This should fix the problem, it worked for me.






            share|improve this answer





























              up vote
              0
              down vote













              May be I am too late. But this is FYI. In this situation you can use nano to load fstab and you can restart after editing the fstab.



              sudo nano /etc/fstab





              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%2f44027%2fhow-to-fix-boot-failure-due-to-incorrect-fstab%23new-answer', 'question_page');

                );

                Post as a guest






























                5 Answers
                5






                active

                oldest

                votes








                5 Answers
                5






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                25
                down vote



                accepted










                It seems that I've found a solution:



                • at the grub prompt, hit a to append options

                • add init=/bin/bash to the end of the kernel command line and press enter

                The system will boot to a prompt like 'bash-3.2#' enter the following commands at the prompt



                • mount -o remount,rw /

                • vim /etc/fstab

                edit the fstab file commenting the errors by adding a # at the begining of each problematic line, save the file



                • reboot by pressing CTRL+ALT+DEL





                share|improve this answer


















                • 2




                  I had to use mount -o remount,rw / --target / to succesfully remount in rw mode. Elsecase mount was picking the bad values from /etc/fstab, see the man mount for details.
                  – laconbass
                  Oct 18 '16 at 12:14











                • @laconbass you are damn right, --target / is the key!
                  – sempasha
                  Jul 28 '17 at 16:46














                up vote
                25
                down vote



                accepted










                It seems that I've found a solution:



                • at the grub prompt, hit a to append options

                • add init=/bin/bash to the end of the kernel command line and press enter

                The system will boot to a prompt like 'bash-3.2#' enter the following commands at the prompt



                • mount -o remount,rw /

                • vim /etc/fstab

                edit the fstab file commenting the errors by adding a # at the begining of each problematic line, save the file



                • reboot by pressing CTRL+ALT+DEL





                share|improve this answer


















                • 2




                  I had to use mount -o remount,rw / --target / to succesfully remount in rw mode. Elsecase mount was picking the bad values from /etc/fstab, see the man mount for details.
                  – laconbass
                  Oct 18 '16 at 12:14











                • @laconbass you are damn right, --target / is the key!
                  – sempasha
                  Jul 28 '17 at 16:46












                up vote
                25
                down vote



                accepted







                up vote
                25
                down vote



                accepted






                It seems that I've found a solution:



                • at the grub prompt, hit a to append options

                • add init=/bin/bash to the end of the kernel command line and press enter

                The system will boot to a prompt like 'bash-3.2#' enter the following commands at the prompt



                • mount -o remount,rw /

                • vim /etc/fstab

                edit the fstab file commenting the errors by adding a # at the begining of each problematic line, save the file



                • reboot by pressing CTRL+ALT+DEL





                share|improve this answer














                It seems that I've found a solution:



                • at the grub prompt, hit a to append options

                • add init=/bin/bash to the end of the kernel command line and press enter

                The system will boot to a prompt like 'bash-3.2#' enter the following commands at the prompt



                • mount -o remount,rw /

                • vim /etc/fstab

                edit the fstab file commenting the errors by adding a # at the begining of each problematic line, save the file



                • reboot by pressing CTRL+ALT+DEL






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jul 2 '15 at 11:51









                elijahbee

                34




                34










                answered Jul 26 '12 at 14:20









                altern

                78731120




                78731120







                • 2




                  I had to use mount -o remount,rw / --target / to succesfully remount in rw mode. Elsecase mount was picking the bad values from /etc/fstab, see the man mount for details.
                  – laconbass
                  Oct 18 '16 at 12:14











                • @laconbass you are damn right, --target / is the key!
                  – sempasha
                  Jul 28 '17 at 16:46












                • 2




                  I had to use mount -o remount,rw / --target / to succesfully remount in rw mode. Elsecase mount was picking the bad values from /etc/fstab, see the man mount for details.
                  – laconbass
                  Oct 18 '16 at 12:14











                • @laconbass you are damn right, --target / is the key!
                  – sempasha
                  Jul 28 '17 at 16:46







                2




                2




                I had to use mount -o remount,rw / --target / to succesfully remount in rw mode. Elsecase mount was picking the bad values from /etc/fstab, see the man mount for details.
                – laconbass
                Oct 18 '16 at 12:14





                I had to use mount -o remount,rw / --target / to succesfully remount in rw mode. Elsecase mount was picking the bad values from /etc/fstab, see the man mount for details.
                – laconbass
                Oct 18 '16 at 12:14













                @laconbass you are damn right, --target / is the key!
                – sempasha
                Jul 28 '17 at 16:46




                @laconbass you are damn right, --target / is the key!
                – sempasha
                Jul 28 '17 at 16:46












                up vote
                2
                down vote













                How about removing the entry, creating a snapshot and then trying to change your /etc/fstab so you have a working snapshot you can roll back to?



                According to the manpage mount.cifs you can also specify a password via password=arg. Also, according to that manpage there is no argument username=arg but instead user=arg. But it might be different on your system, better check your manpage for the correct argument names.






                share|improve this answer




















                • man for the win.
                  – Tim
                  Jul 26 '12 at 13:22










                • I was about to create snapshot, but while I was experimenting with fstab, vm instance went off for some reason. Apparently, I wouldn't ask the question if I could fix it myself.
                  – altern
                  Jul 26 '12 at 13:31







                • 2




                  Your problem description is a little bit unclear. Can't you boot in single user / recovery mode? It should only try to mount the root fs and leave the fstab alone.
                  – scai
                  Jul 26 '12 at 13:54















                up vote
                2
                down vote













                How about removing the entry, creating a snapshot and then trying to change your /etc/fstab so you have a working snapshot you can roll back to?



                According to the manpage mount.cifs you can also specify a password via password=arg. Also, according to that manpage there is no argument username=arg but instead user=arg. But it might be different on your system, better check your manpage for the correct argument names.






                share|improve this answer




















                • man for the win.
                  – Tim
                  Jul 26 '12 at 13:22










                • I was about to create snapshot, but while I was experimenting with fstab, vm instance went off for some reason. Apparently, I wouldn't ask the question if I could fix it myself.
                  – altern
                  Jul 26 '12 at 13:31







                • 2




                  Your problem description is a little bit unclear. Can't you boot in single user / recovery mode? It should only try to mount the root fs and leave the fstab alone.
                  – scai
                  Jul 26 '12 at 13:54













                up vote
                2
                down vote










                up vote
                2
                down vote









                How about removing the entry, creating a snapshot and then trying to change your /etc/fstab so you have a working snapshot you can roll back to?



                According to the manpage mount.cifs you can also specify a password via password=arg. Also, according to that manpage there is no argument username=arg but instead user=arg. But it might be different on your system, better check your manpage for the correct argument names.






                share|improve this answer












                How about removing the entry, creating a snapshot and then trying to change your /etc/fstab so you have a working snapshot you can roll back to?



                According to the manpage mount.cifs you can also specify a password via password=arg. Also, according to that manpage there is no argument username=arg but instead user=arg. But it might be different on your system, better check your manpage for the correct argument names.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 26 '12 at 13:21









                scai

                6,09221734




                6,09221734











                • man for the win.
                  – Tim
                  Jul 26 '12 at 13:22










                • I was about to create snapshot, but while I was experimenting with fstab, vm instance went off for some reason. Apparently, I wouldn't ask the question if I could fix it myself.
                  – altern
                  Jul 26 '12 at 13:31







                • 2




                  Your problem description is a little bit unclear. Can't you boot in single user / recovery mode? It should only try to mount the root fs and leave the fstab alone.
                  – scai
                  Jul 26 '12 at 13:54

















                • man for the win.
                  – Tim
                  Jul 26 '12 at 13:22










                • I was about to create snapshot, but while I was experimenting with fstab, vm instance went off for some reason. Apparently, I wouldn't ask the question if I could fix it myself.
                  – altern
                  Jul 26 '12 at 13:31







                • 2




                  Your problem description is a little bit unclear. Can't you boot in single user / recovery mode? It should only try to mount the root fs and leave the fstab alone.
                  – scai
                  Jul 26 '12 at 13:54
















                man for the win.
                – Tim
                Jul 26 '12 at 13:22




                man for the win.
                – Tim
                Jul 26 '12 at 13:22












                I was about to create snapshot, but while I was experimenting with fstab, vm instance went off for some reason. Apparently, I wouldn't ask the question if I could fix it myself.
                – altern
                Jul 26 '12 at 13:31





                I was about to create snapshot, but while I was experimenting with fstab, vm instance went off for some reason. Apparently, I wouldn't ask the question if I could fix it myself.
                – altern
                Jul 26 '12 at 13:31





                2




                2




                Your problem description is a little bit unclear. Can't you boot in single user / recovery mode? It should only try to mount the root fs and leave the fstab alone.
                – scai
                Jul 26 '12 at 13:54





                Your problem description is a little bit unclear. Can't you boot in single user / recovery mode? It should only try to mount the root fs and leave the fstab alone.
                – scai
                Jul 26 '12 at 13:54











                up vote
                0
                down vote













                The other easy way is booting to live-cd mode and mount the right partition. Then you can fix anything you want!






                share|improve this answer
























                  up vote
                  0
                  down vote













                  The other easy way is booting to live-cd mode and mount the right partition. Then you can fix anything you want!






                  share|improve this answer






















                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    The other easy way is booting to live-cd mode and mount the right partition. Then you can fix anything you want!






                    share|improve this answer












                    The other easy way is booting to live-cd mode and mount the right partition. Then you can fix anything you want!







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Sep 3 '15 at 0:37









                    user3435653

                    11




                    11




















                        up vote
                        0
                        down vote













                        I found a solution to systems error kernel not loading
                        Use live cd to gain access to your existing installation. Once in reinstall Linux kernel :



                        pacman -S Linux


                        Then delete the fstab file from etc/fstab :



                        rm /etc/fstab


                        Now reinstall systemd:



                        pacman -S systemd


                        When reinstalling systemd it will automatically generate a new fstab file



                        Now reinstall the bootloader
                        in this case I use grub:



                        pacman -S grub os-prober


                        (os probe is useful if you have more than 1 os installed on your hdd/ssd)
                        Then



                        grub-install --target=i386-pc /dev/sda


                        Once finished make the configuration files:



                        grub-mkconfig -o /boot/grub/grub.cfg


                        Then unmount the partitions in use and reboot



                        umount /dev/sdX 
                        reboot


                        This should fix the problem, it worked for me.






                        share|improve this answer


























                          up vote
                          0
                          down vote













                          I found a solution to systems error kernel not loading
                          Use live cd to gain access to your existing installation. Once in reinstall Linux kernel :



                          pacman -S Linux


                          Then delete the fstab file from etc/fstab :



                          rm /etc/fstab


                          Now reinstall systemd:



                          pacman -S systemd


                          When reinstalling systemd it will automatically generate a new fstab file



                          Now reinstall the bootloader
                          in this case I use grub:



                          pacman -S grub os-prober


                          (os probe is useful if you have more than 1 os installed on your hdd/ssd)
                          Then



                          grub-install --target=i386-pc /dev/sda


                          Once finished make the configuration files:



                          grub-mkconfig -o /boot/grub/grub.cfg


                          Then unmount the partitions in use and reboot



                          umount /dev/sdX 
                          reboot


                          This should fix the problem, it worked for me.






                          share|improve this answer
























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            I found a solution to systems error kernel not loading
                            Use live cd to gain access to your existing installation. Once in reinstall Linux kernel :



                            pacman -S Linux


                            Then delete the fstab file from etc/fstab :



                            rm /etc/fstab


                            Now reinstall systemd:



                            pacman -S systemd


                            When reinstalling systemd it will automatically generate a new fstab file



                            Now reinstall the bootloader
                            in this case I use grub:



                            pacman -S grub os-prober


                            (os probe is useful if you have more than 1 os installed on your hdd/ssd)
                            Then



                            grub-install --target=i386-pc /dev/sda


                            Once finished make the configuration files:



                            grub-mkconfig -o /boot/grub/grub.cfg


                            Then unmount the partitions in use and reboot



                            umount /dev/sdX 
                            reboot


                            This should fix the problem, it worked for me.






                            share|improve this answer














                            I found a solution to systems error kernel not loading
                            Use live cd to gain access to your existing installation. Once in reinstall Linux kernel :



                            pacman -S Linux


                            Then delete the fstab file from etc/fstab :



                            rm /etc/fstab


                            Now reinstall systemd:



                            pacman -S systemd


                            When reinstalling systemd it will automatically generate a new fstab file



                            Now reinstall the bootloader
                            in this case I use grub:



                            pacman -S grub os-prober


                            (os probe is useful if you have more than 1 os installed on your hdd/ssd)
                            Then



                            grub-install --target=i386-pc /dev/sda


                            Once finished make the configuration files:



                            grub-mkconfig -o /boot/grub/grub.cfg


                            Then unmount the partitions in use and reboot



                            umount /dev/sdX 
                            reboot


                            This should fix the problem, it worked for me.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Jun 24 '16 at 14:52









                            Archemar

                            18.9k93366




                            18.9k93366










                            answered Jun 24 '16 at 14:43









                            Jp---

                            11




                            11




















                                up vote
                                0
                                down vote













                                May be I am too late. But this is FYI. In this situation you can use nano to load fstab and you can restart after editing the fstab.



                                sudo nano /etc/fstab





                                share|improve this answer
























                                  up vote
                                  0
                                  down vote













                                  May be I am too late. But this is FYI. In this situation you can use nano to load fstab and you can restart after editing the fstab.



                                  sudo nano /etc/fstab





                                  share|improve this answer






















                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    May be I am too late. But this is FYI. In this situation you can use nano to load fstab and you can restart after editing the fstab.



                                    sudo nano /etc/fstab





                                    share|improve this answer












                                    May be I am too late. But this is FYI. In this situation you can use nano to load fstab and you can restart after editing the fstab.



                                    sudo nano /etc/fstab






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Apr 2 '17 at 10:35









                                    Choxmi

                                    1012




                                    1012






















                                         

                                        draft saved


                                        draft discarded


























                                         


                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f44027%2fhow-to-fix-boot-failure-due-to-incorrect-fstab%23new-answer', 'question_page');

                                        );

                                        Post as a guest













































































                                        hlneY krVYfHCGFmH311i 6T1f nT dbdIVg5Y jKUfelRN
                                        nuX gSO gfu XW3k7hf5sTCX mEUec,YaTOhcZWd 7HMOdPNvaSFeTeBXi jbFanCm7vdL6q98 GLC0VmZ

                                        Popular posts from this blog

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

                                        How many registers does an x86_64 CPU actually have?

                                        Displaying single band from multi-band raster using QGIS