Live USB requires file system check of root filesystem

Forum Forums New users New Users and General Questions Live USB requires file system check of root filesystem

  • This topic has 7 replies, 5 voices, and was last updated May 11-8:00 pm by ModdIt.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #83030
    Member
    Grisonix

      I made a Live USB from an existing system. In the init stage I get the error message:

      “An automatic file system check (fsck) of the root file system failed. A manual fsck must be performed then the system restarted. fsck should be performed in maintenance mode with the root file system mounted in read-only mode

      The root filesystem is currently mounted in read-only mode. A maintenance shell will now be started. After performing system maintenance, press CONTROL-D to terminate the maintenance shell and restart the system.”

      I logged into root and ran fsck on /dev/sda1 /dev/sda2 and /dev/sda3 with no problems. I tried to run fsck on /dev/sda and got an error message that it is in use. I ran umount on /dev/sda and got the message that “/dev/sda: not mounted”

      #83033
      Moderator
      christophe
        Helpful
        Up
        0
        ::

        I logged into root and ran fsck on /dev/sda1 /dev/sda2 and /dev/sda3 with no problems.

        That should be adequate. Do you get any errors on a subsequent reboot?

        confirmed antiX frugaler, since 2019

        #83034
        Member
        Grisonix
          Helpful
          Up
          0
          ::

          Yes. I got the exact same error message after rebooting.

          #83035
          Moderator
          Brian Masinick
            Helpful
            Up
            1
            ::

            Since the drive needs to be “mounted” in some fashion, I vaguely remember an old method I used 15-20 years ago;
            I’d boot into single user mode, and remount the root drive (/dev/sda in your case) read-only.
            Once file checking is complete, I’d remount n the usual way or simply reboot the system.

            Resources to read for more information to provide you some additional guidance:

            https://linuxhandbook.com/fsck-command/
            https://www.tecmint.com/fsck-repair-file-system-errors-in-linux/
            https://phoenixnap.com/kb/fsck-command-linux

            --
            Brian Masinick

            #83036
            Member
            Robin
              Helpful
              Up
              1
              ::

              /dev/sda is your drive, not a partition containing a file system you could check. So you’ll get an error always.

              Is this a persistent Live system? If so, you need to run the file system check on the rootfs file (need to start with disabled persistence for this, otherwise the file will get eventually corrupted by writing back from the copy in memory on shutdown), Then run
              e2fsck -f live/boot-dev/antiX/rootfs

              or in case you have a second live boot medium at hand you’ll find it, once you plugged the delinquent and it was mounted, at:
              e2fsck -f /media/demo/antiX-Live-usb/antiX/rootfs

              (make sure to use appropriate paths in the commands, according to what you have found on your system)

              Reason for this: The persistent root file system is stored in the rootfs file. So it’s not enough simply to check /dev/sdx where its file is stored on.

              In case you have not a persistency system, the file linuxfs might be corrupted, it contains the root file system without persistence (this is also the place where the contents of rootfs file go once you do a live remaster) But linuxfs is not a default file system, it is squashfs.
              I don’t know a tool to perform a file system check on the contained root file system, but you can try whether it mounts properly when accessed being plugged when running on a second live system.

              sudo mkdir /media/demo/testmount
              sudo mount -o loop '/media/demo/antiX-Live-usb/antiX/linuxfs' /media/demo/testmount

              (make sure to use appropriate paths in the commands, according to what you have found on your system)

              if this is mounted properly, its containing file system should be fine. You can’t write to it, since squashfs is a compressed and read-only file system. but you can see and check all its contents. If it doesn’t mount here, it is corrupted, and needs to get created anew. (Maybe there is a method to repair it anyway, but i don’t know it). Maybe squashfs-tools or squashfs-tools-ng provide something useful to repair a damaged squashfs root file system.

              Windows is like a submarine. Open a window and serious problems will start.

              #83040
              Member
              ModdIt
                Helpful
                Up
                1
                ::

                Hi grisonix,
                Been in the situation several times.
                Did you do a snapshot and then write the resulting ISO to USB with the antiX tools ?.

                Quickest way out is to create a fresh USB live stick, as robin posted you will not be
                able to read and correct any errors in the present compressed filestem of your live stick.

                #83046
                Member
                Grisonix
                  Helpful
                  Up
                  0
                  ::

                  Hi Moddit,

                  Yes I made a ISO Snapshot then used the Live USB Maker to make a persistent drive. So if I run Live USB Maker again it will probably work? Should I try a different flash drive?

                  All I really want to do is to duplicate my current system so I can install it on a new computer with all the programs preinstalled and ready to go. And the same settings.

                  #83047
                  Member
                  ModdIt
                    Helpful
                    Up
                    0
                    ::

                    Hi Grisonix, if your usb stick is known ok just try again. First boot with the newly created stick in to your
                    known working computer.
                    Should you get same error again either the usb stick or the image is the problem, I would then try a different
                    usb stick first. I never had a failed snapshot up to now but it must be considered a possibility.

                    After getting sticks with fake capacity I now use a tool called F3 on all purchases and at times on sticks which
                    give trouble. Fake sticks gave me bad filesystem errors.
                    https://fight-flash-fraud.readthedocs.io/en/latest/introduction.html

                    • This reply was modified 12 months ago by ModdIt.
                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.