Results 1 to 6 of 6

Thread: Recover From Idiotic MV Command?

  1. #1
    Join Date
    Dec 2012
    Beans
    15

    Exclamation Recover From Idiotic MV Command?

    I have trashed my Ubuntu 12.04 file system with an idiotic mv command.

    Code:
    /var/www$ sudo mv /* /var/www/drupal
    Ahhhh! To recover I tried:
    Code:
    /var/www$ sudo mv /var/www/drupal/* /
    and
    Code:
    /var/www$ sudo mv /var/www/drupal/* /..
    Both these returned:
    Code:
    bash: /usr/bin/sudo: No such file or directory
    I am posting this from another pc. The trashed PC is sat waiting for my next move. Is there anything I can do to recover this?

    Please help. And of course feel free to mock me.
    Last edited by philwx; March 25th, 2013 at 03:16 PM.

  2. #2
    Join Date
    Nov 2008
    Location
    Storybrooke
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Recover From Idiotic MV Command!??

    Quote Originally Posted by philwx View Post
    I have trashed my Ubuntu 12.04 file system with an idiotic mv command.

    Code:
    /var/www$ sudo mv /* /var/www/drupal
    Ahhhh! To recover I tried:
    Code:
    /var/www$ sudo mv /var/www/drupal/* /
    and
    Code:
    /var/www$ sudo mv /var/www/drupal/* /..
    Both these returned:
    Code:
    bash: /usr/bin/sudo: No such file or directory
    I am posting this from another pc. The trashed PC is sat waiting for my next move. Is there anything I can do to recover this?

    Please help. And of course feel free to mock me.
    You are currently missing the sudo binary (and the dynamic loader, ld-linux.so has probably become messed as well)

    What I would suggest:

    Boot to a Linux LiveCD, mount the Ubuntu partition there, and move the folders back to their original location.

    If you post the output of
    Code:
    sudo fdisk -l
    from a livecd,
    we can probably help you further by giving you complete commands to run.
    Ubuntu Forums Moderation Staff
    Okay then. We're relying on mirror dust and fairies but now we have a plan which is progress - Emma

  3. #3
    Join Date
    Dec 2012
    Beans
    15

    Re: Recover From Idiotic MV Command!??

    Thanks for helping sandyd. Here's the output:

    Code:
    ubuntu@ubuntu:~$ sudo fdisk -l
    
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0x000a4aba
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048   972648447   486323200   83  Linux
    /dev/sda2       972650494   976771071     2060289    5  Extended
    /dev/sda5       972650496   976771071     2060288   82  Linux swap / Solaris
    
    Disk /dev/sdb: 250.1 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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: 0xe9f8e9f8
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *          63   488392064   244196001    7  HPFS/NTFS/exFAT
    
    Disk /dev/sdc: 15.9 GB, 15892217856 bytes
    255 heads, 63 sectors/track, 1932 cylinders, total 31039488 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: 0x0009c707
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1   *          63    31037579    15518758+   c  W95 FAT32 (LBA)

  4. #4
    Join Date
    Dec 2012
    Beans
    15

    Re: Recover From Idiotic MV Command?

    I have mounted sda1 to /mnt. I have changed directory to /mnt/var/www/drupal.

    Should I do this?
    Code:
    ubuntu@ubuntu:/mnt/var/www/drupal$ sudo mv /mnt/var/www/drupal/* /mnt/

  5. #5
    Join Date
    Dec 2012
    Beans
    15

    Re: Recover From Idiotic MV Command?

    Ok I did perform the command and everything is back and running just fine.

    Thanks sandyd.

    (btw I have a little 3 legged dog but I love cats too)

  6. #6
    Join Date
    Dec 2012
    Beans
    15

    Re: Recover From Idiotic MV Command?

    I am having a really stupid day. How do I mark this thread as SOLVED?

    There is nothing regarding solved on the thread tools menu (only print, email and subscribe items).

    Found solution for marking as SOLVED here: http://ubuntuforums.org/showthread.php?t=2121377
    Last edited by philwx; March 25th, 2013 at 03:17 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •