unmount drive / e2fsck / re-mount -> are my files gone












3















The journal on my disk had died, and the drive was mounted only as read-only and I could not re-mount it as read write.



So I have unmounted it ran e2fsck and re-mounted the drive.



The disk is fixed, but the files are gone. I can actually see the space on the disk being taken by my files as:



Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/drive
1.9T 46G 1.7T 3% /drive


So They are there, I just cannot access it. The following is what I did



[root@box log]# umount /dev/mapper/drive
[root@box log]# e2fsck /dev/mapper/drive
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/drive: recovering journal
/dev/mapper/drive contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/mapper/drive: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mapper/drive: 1704368/124518400 files (1.1% non-contiguous), 19741609/498065408 blocks

[root@box log]# mount -o remount,rw /drive


How can I recover the files? Did I re-mount it incorrectly? Thanks in advance!










share|improve this question























  • What happens if you just run mount /drive without including options?

    – Kaz Wolfe
    Nov 25 '16 at 18:22
















3















The journal on my disk had died, and the drive was mounted only as read-only and I could not re-mount it as read write.



So I have unmounted it ran e2fsck and re-mounted the drive.



The disk is fixed, but the files are gone. I can actually see the space on the disk being taken by my files as:



Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/drive
1.9T 46G 1.7T 3% /drive


So They are there, I just cannot access it. The following is what I did



[root@box log]# umount /dev/mapper/drive
[root@box log]# e2fsck /dev/mapper/drive
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/drive: recovering journal
/dev/mapper/drive contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/mapper/drive: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mapper/drive: 1704368/124518400 files (1.1% non-contiguous), 19741609/498065408 blocks

[root@box log]# mount -o remount,rw /drive


How can I recover the files? Did I re-mount it incorrectly? Thanks in advance!










share|improve this question























  • What happens if you just run mount /drive without including options?

    – Kaz Wolfe
    Nov 25 '16 at 18:22














3












3








3








The journal on my disk had died, and the drive was mounted only as read-only and I could not re-mount it as read write.



So I have unmounted it ran e2fsck and re-mounted the drive.



The disk is fixed, but the files are gone. I can actually see the space on the disk being taken by my files as:



Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/drive
1.9T 46G 1.7T 3% /drive


So They are there, I just cannot access it. The following is what I did



[root@box log]# umount /dev/mapper/drive
[root@box log]# e2fsck /dev/mapper/drive
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/drive: recovering journal
/dev/mapper/drive contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/mapper/drive: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mapper/drive: 1704368/124518400 files (1.1% non-contiguous), 19741609/498065408 blocks

[root@box log]# mount -o remount,rw /drive


How can I recover the files? Did I re-mount it incorrectly? Thanks in advance!










share|improve this question














The journal on my disk had died, and the drive was mounted only as read-only and I could not re-mount it as read write.



So I have unmounted it ran e2fsck and re-mounted the drive.



The disk is fixed, but the files are gone. I can actually see the space on the disk being taken by my files as:



Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/drive
1.9T 46G 1.7T 3% /drive


So They are there, I just cannot access it. The following is what I did



[root@box log]# umount /dev/mapper/drive
[root@box log]# e2fsck /dev/mapper/drive
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/drive: recovering journal
/dev/mapper/drive contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/mapper/drive: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mapper/drive: 1704368/124518400 files (1.1% non-contiguous), 19741609/498065408 blocks

[root@box log]# mount -o remount,rw /drive


How can I recover the files? Did I re-mount it incorrectly? Thanks in advance!







filesystem fsck read-only






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 25 '16 at 17:56









emraldinhoemraldinho

162




162













  • What happens if you just run mount /drive without including options?

    – Kaz Wolfe
    Nov 25 '16 at 18:22



















  • What happens if you just run mount /drive without including options?

    – Kaz Wolfe
    Nov 25 '16 at 18:22

















What happens if you just run mount /drive without including options?

– Kaz Wolfe
Nov 25 '16 at 18:22





What happens if you just run mount /drive without including options?

– Kaz Wolfe
Nov 25 '16 at 18:22










2 Answers
2






active

oldest

votes


















3














First of all: Don't try to do further repairs on the original disk !
Use another hard drive and backup /dev/mapper/drive with "dd" as an image to the new disk: (I assume the new disk use a file system and is mounted to /mnt/newdisk directory)




dd if=/dev/mapper/drive of=/mnt/newdisk/drive.img bs=4M


after that you should try to repair only using the image-copy "mnt/newdisk/drive.img".
mount the image and a look to the "lost+found" directory if you can find data inside this.




losetup -f /mnt/newdisk/drive.img
losetup -a|grep drive.img ### get the /dev/loop-device
mkdir /mnt/drv-copy && mount /dev/loopX /mnt/drv-copy
ls -la /mnt/drv-copy/lost+found


But e2fsck will normally replay only the journal and exit. If you don't use -f -p e2fsck will not check and repair the file system structure. So if you don't had a I/O error caused by a media error before you shouldn't lost data. so check if you can find I/O messages on systemlog/dmesg during the "dd" copy.
if not do an unmount on /mnt/dsk-copy and use "e2fsck -f -y






share|improve this answer

































    0














    I was facing a similar issue on an Ubuntu Server 18.10
    I have 2 HDD's (2TB) and 1 SSD (120GB).
    Ubuntu server is installed on the SSD.
    I initially ran



    fsck -y /dev/sdb1


    it kept giving me the message



    ***** FILE SYSTEM WAS MODIFIED *****


    I search for a solution and came up with the e2fsck one.
    I ran e2fsck (only on one of the HDD's) and when I mounted it everything was gone.



    e2fsck -y /deb/sdb1


    What was giving me a headache was the fact that the e2fsck ran very quickly so it couldn't have delete all my data. And the files in the lost+found directory were not consistent with what I had before on my hard drive.
    So next I did this:
    Ran:



    sudo e2fsck -f -y /dev/sdb1


    Mounted the drive back and still nothing was shown.



    Afterwards I ran:



    sudo e2fsck -f -p /dev/sdb1


    Now everything's back into place.



    I was really scared that I couldn't recover my files, now everything seems ok. I need to mention that everytime I was rebooting the system it kept going in "recovery mode".



    I know the question was posted 2y ago but in my desperate search I came across it and I just wanted to mention that this fixed my dissapearing files.






    share|improve this answer








    New contributor




    Radu Galan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      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: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f853567%2funmount-drive-e2fsck-re-mount-are-my-files-gone%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









      3














      First of all: Don't try to do further repairs on the original disk !
      Use another hard drive and backup /dev/mapper/drive with "dd" as an image to the new disk: (I assume the new disk use a file system and is mounted to /mnt/newdisk directory)




      dd if=/dev/mapper/drive of=/mnt/newdisk/drive.img bs=4M


      after that you should try to repair only using the image-copy "mnt/newdisk/drive.img".
      mount the image and a look to the "lost+found" directory if you can find data inside this.




      losetup -f /mnt/newdisk/drive.img
      losetup -a|grep drive.img ### get the /dev/loop-device
      mkdir /mnt/drv-copy && mount /dev/loopX /mnt/drv-copy
      ls -la /mnt/drv-copy/lost+found


      But e2fsck will normally replay only the journal and exit. If you don't use -f -p e2fsck will not check and repair the file system structure. So if you don't had a I/O error caused by a media error before you shouldn't lost data. so check if you can find I/O messages on systemlog/dmesg during the "dd" copy.
      if not do an unmount on /mnt/dsk-copy and use "e2fsck -f -y






      share|improve this answer






























        3














        First of all: Don't try to do further repairs on the original disk !
        Use another hard drive and backup /dev/mapper/drive with "dd" as an image to the new disk: (I assume the new disk use a file system and is mounted to /mnt/newdisk directory)




        dd if=/dev/mapper/drive of=/mnt/newdisk/drive.img bs=4M


        after that you should try to repair only using the image-copy "mnt/newdisk/drive.img".
        mount the image and a look to the "lost+found" directory if you can find data inside this.




        losetup -f /mnt/newdisk/drive.img
        losetup -a|grep drive.img ### get the /dev/loop-device
        mkdir /mnt/drv-copy && mount /dev/loopX /mnt/drv-copy
        ls -la /mnt/drv-copy/lost+found


        But e2fsck will normally replay only the journal and exit. If you don't use -f -p e2fsck will not check and repair the file system structure. So if you don't had a I/O error caused by a media error before you shouldn't lost data. so check if you can find I/O messages on systemlog/dmesg during the "dd" copy.
        if not do an unmount on /mnt/dsk-copy and use "e2fsck -f -y






        share|improve this answer




























          3












          3








          3







          First of all: Don't try to do further repairs on the original disk !
          Use another hard drive and backup /dev/mapper/drive with "dd" as an image to the new disk: (I assume the new disk use a file system and is mounted to /mnt/newdisk directory)




          dd if=/dev/mapper/drive of=/mnt/newdisk/drive.img bs=4M


          after that you should try to repair only using the image-copy "mnt/newdisk/drive.img".
          mount the image and a look to the "lost+found" directory if you can find data inside this.




          losetup -f /mnt/newdisk/drive.img
          losetup -a|grep drive.img ### get the /dev/loop-device
          mkdir /mnt/drv-copy && mount /dev/loopX /mnt/drv-copy
          ls -la /mnt/drv-copy/lost+found


          But e2fsck will normally replay only the journal and exit. If you don't use -f -p e2fsck will not check and repair the file system structure. So if you don't had a I/O error caused by a media error before you shouldn't lost data. so check if you can find I/O messages on systemlog/dmesg during the "dd" copy.
          if not do an unmount on /mnt/dsk-copy and use "e2fsck -f -y






          share|improve this answer















          First of all: Don't try to do further repairs on the original disk !
          Use another hard drive and backup /dev/mapper/drive with "dd" as an image to the new disk: (I assume the new disk use a file system and is mounted to /mnt/newdisk directory)




          dd if=/dev/mapper/drive of=/mnt/newdisk/drive.img bs=4M


          after that you should try to repair only using the image-copy "mnt/newdisk/drive.img".
          mount the image and a look to the "lost+found" directory if you can find data inside this.




          losetup -f /mnt/newdisk/drive.img
          losetup -a|grep drive.img ### get the /dev/loop-device
          mkdir /mnt/drv-copy && mount /dev/loopX /mnt/drv-copy
          ls -la /mnt/drv-copy/lost+found


          But e2fsck will normally replay only the journal and exit. If you don't use -f -p e2fsck will not check and repair the file system structure. So if you don't had a I/O error caused by a media error before you shouldn't lost data. so check if you can find I/O messages on systemlog/dmesg during the "dd" copy.
          if not do an unmount on /mnt/dsk-copy and use "e2fsck -f -y







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 26 '16 at 5:21

























          answered Nov 25 '16 at 18:20









          0x0C40x0C4

          525311




          525311

























              0














              I was facing a similar issue on an Ubuntu Server 18.10
              I have 2 HDD's (2TB) and 1 SSD (120GB).
              Ubuntu server is installed on the SSD.
              I initially ran



              fsck -y /dev/sdb1


              it kept giving me the message



              ***** FILE SYSTEM WAS MODIFIED *****


              I search for a solution and came up with the e2fsck one.
              I ran e2fsck (only on one of the HDD's) and when I mounted it everything was gone.



              e2fsck -y /deb/sdb1


              What was giving me a headache was the fact that the e2fsck ran very quickly so it couldn't have delete all my data. And the files in the lost+found directory were not consistent with what I had before on my hard drive.
              So next I did this:
              Ran:



              sudo e2fsck -f -y /dev/sdb1


              Mounted the drive back and still nothing was shown.



              Afterwards I ran:



              sudo e2fsck -f -p /dev/sdb1


              Now everything's back into place.



              I was really scared that I couldn't recover my files, now everything seems ok. I need to mention that everytime I was rebooting the system it kept going in "recovery mode".



              I know the question was posted 2y ago but in my desperate search I came across it and I just wanted to mention that this fixed my dissapearing files.






              share|improve this answer








              New contributor




              Radu Galan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0














                I was facing a similar issue on an Ubuntu Server 18.10
                I have 2 HDD's (2TB) and 1 SSD (120GB).
                Ubuntu server is installed on the SSD.
                I initially ran



                fsck -y /dev/sdb1


                it kept giving me the message



                ***** FILE SYSTEM WAS MODIFIED *****


                I search for a solution and came up with the e2fsck one.
                I ran e2fsck (only on one of the HDD's) and when I mounted it everything was gone.



                e2fsck -y /deb/sdb1


                What was giving me a headache was the fact that the e2fsck ran very quickly so it couldn't have delete all my data. And the files in the lost+found directory were not consistent with what I had before on my hard drive.
                So next I did this:
                Ran:



                sudo e2fsck -f -y /dev/sdb1


                Mounted the drive back and still nothing was shown.



                Afterwards I ran:



                sudo e2fsck -f -p /dev/sdb1


                Now everything's back into place.



                I was really scared that I couldn't recover my files, now everything seems ok. I need to mention that everytime I was rebooting the system it kept going in "recovery mode".



                I know the question was posted 2y ago but in my desperate search I came across it and I just wanted to mention that this fixed my dissapearing files.






                share|improve this answer








                New contributor




                Radu Galan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0







                  I was facing a similar issue on an Ubuntu Server 18.10
                  I have 2 HDD's (2TB) and 1 SSD (120GB).
                  Ubuntu server is installed on the SSD.
                  I initially ran



                  fsck -y /dev/sdb1


                  it kept giving me the message



                  ***** FILE SYSTEM WAS MODIFIED *****


                  I search for a solution and came up with the e2fsck one.
                  I ran e2fsck (only on one of the HDD's) and when I mounted it everything was gone.



                  e2fsck -y /deb/sdb1


                  What was giving me a headache was the fact that the e2fsck ran very quickly so it couldn't have delete all my data. And the files in the lost+found directory were not consistent with what I had before on my hard drive.
                  So next I did this:
                  Ran:



                  sudo e2fsck -f -y /dev/sdb1


                  Mounted the drive back and still nothing was shown.



                  Afterwards I ran:



                  sudo e2fsck -f -p /dev/sdb1


                  Now everything's back into place.



                  I was really scared that I couldn't recover my files, now everything seems ok. I need to mention that everytime I was rebooting the system it kept going in "recovery mode".



                  I know the question was posted 2y ago but in my desperate search I came across it and I just wanted to mention that this fixed my dissapearing files.






                  share|improve this answer








                  New contributor




                  Radu Galan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  I was facing a similar issue on an Ubuntu Server 18.10
                  I have 2 HDD's (2TB) and 1 SSD (120GB).
                  Ubuntu server is installed on the SSD.
                  I initially ran



                  fsck -y /dev/sdb1


                  it kept giving me the message



                  ***** FILE SYSTEM WAS MODIFIED *****


                  I search for a solution and came up with the e2fsck one.
                  I ran e2fsck (only on one of the HDD's) and when I mounted it everything was gone.



                  e2fsck -y /deb/sdb1


                  What was giving me a headache was the fact that the e2fsck ran very quickly so it couldn't have delete all my data. And the files in the lost+found directory were not consistent with what I had before on my hard drive.
                  So next I did this:
                  Ran:



                  sudo e2fsck -f -y /dev/sdb1


                  Mounted the drive back and still nothing was shown.



                  Afterwards I ran:



                  sudo e2fsck -f -p /dev/sdb1


                  Now everything's back into place.



                  I was really scared that I couldn't recover my files, now everything seems ok. I need to mention that everytime I was rebooting the system it kept going in "recovery mode".



                  I know the question was posted 2y ago but in my desperate search I came across it and I just wanted to mention that this fixed my dissapearing files.







                  share|improve this answer








                  New contributor




                  Radu Galan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  Radu Galan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 14 mins ago









                  Radu GalanRadu Galan

                  1




                  1




                  New contributor




                  Radu Galan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Radu Galan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Radu Galan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • 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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f853567%2funmount-drive-e2fsck-re-mount-are-my-files-gone%23new-answer', 'question_page');
                      }
                      );

                      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







                      Popular posts from this blog

                      香粉寮

                      GameSpot