0

I'm running Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-48-generic x86_64) on Amazon AWS. I had a folder "foo" in the /mnt and after few modification I had to recover to previous backup of the instance .
after restore "/mnt/foo" folder is missing , however when I tried "locate foo" it showed me on in "/mnt/foo" .

then I did updatedb command and then /mnt/foo no longer visible in the locate foo command.

/mnt only have lost+found directory .

df command give following.

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/xvda1       8115168 6991056    688836  92% /
none                   4       0         4   0% /sys/fs/cgroup
udev             3824796      12   3824784   1% /dev
tmpfs             765952     352    765600   1% /run
none                5120       0      5120   0% /run/lock
none             3829752       0   3829752   0% /run/shm
none              102400       0    102400   0% /run/user
/dev/xvdb       30824956   45140  29207336   1% /mnt

and sudo fdisk -l gives following .

Disk /dev/xvda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *       16065    16771859     8377897+  83  Linux

Disk /dev/xvdb: 32.2 GB, 32204390400 bytes
255 heads, 63 sectors/track, 3915 cylinders, total 62899200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/xvdb doesn't contain a valid partition table

edit 1 :

fsck shows ,

fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
/dev/xvdb is mounted.
e2fsck: Cannot continue, aborting.

What can be happened to the directory "foo" in the /mnt and is there any possibility that I can get it back ?

  • The output of locate is cached. The fact that /mnt/foo showed up with locate does not mean it's actually there. – Andrea Lazzarotto Jul 13 '16 at 10:00
  • @AndreaLazzarotto yes , I did a : updatedb – Ruwan Ranganath Jul 13 '16 at 10:28
1

You propably mounted the partition /dev/xvdbover the original /mnt ? Try

umount /dev/xvdb

an see, if the folder is there. If so, move it to some other partition, then re-mount /dev/xvdb and move the folder back.

  • output for umount /dev/xvdb umount: /mnt: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) – Ruwan Ranganath Jul 12 '16 at 6:37
  • I tried umount -l /dev/xvdb' and now lost+found` dir from /mnt also gone. – Ruwan Ranganath Jul 12 '16 at 6:39
  • Then the folder has been deleted somehow. What were your original steps for the restore process ? – gerhard d. Jul 12 '16 at 6:41
  • amazon ec2 , backup image and restore procedure . – Ruwan Ranganath Jul 12 '16 at 6:48
  • since I still have the backup image , will there any possibility to get it back ? with new restore instance ? – Ruwan Ranganath Jul 12 '16 at 6:55
1

You can create /mnt/foo mount point and mount /dev/xvdb using following commands.

sudo umount /mnt
sudo mkdir /mnt/foo
sudo mount /dev/xvdb /mnt/foo

If you are getting device busy,find process running with device and kill it

lsof | grep '/dev/xvdb'
  • I've followed these steps and in the /mnt/foo directory it only have lost+found , I did cd lost+found and ll only shows .swp file in it . seems I lost the directory ? – Ruwan Ranganath Jul 12 '16 at 6:47
  • it looks like it might have been formatted. – Ketan Patel Jul 12 '16 at 6:55
  • cd /dev/xvdb gives -bash: cd: /dev/xvdb: Not a directory output . – Ruwan Ranganath Jul 12 '16 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.