1

So I accidentally 'sudo mv' my files from /* (root directory) to some directory inside my home directory. My OS stopped working and I rebooted. Then I encountered the

error: file '/grub/i386-pc/normal.mod' not found

I can't boot to my linux OS anymore. So I boot from my flash drive with a linux installer. I can still find my linux installation from one of the devices, and the system files that I moved. The problem is that I can't move them back.

The directories left in the device with corrupted linux installation are: dev, home, proc, run, sys

I'm running Linux Mint 17

  • 1
    "The problem is that I can't move them back." -> Why? How did you try? – goldilocks Dec 1 '14 at 15:16
  • can't paste into the filesystem? don't know how to cd to it too – renz Dec 1 '14 at 15:18
2

LiveCDs usually have something like a "Root terminal" you can open to do things as the superuser. From there, you should be able to cd to where the filesystem is mounted and simply mv the relevant directories. For example, if the mount point is /mnt/fs, and you want to move the /mnt/fs/home/me/whatever/etc directory back:

> cd /mnt/fs
> mv home/me/whatever/etc /mnt/fs

If this was all within one partition (i.e., your home directory is not separate), the original move didn't really do much, but it still might have created a problem in process. So before you do anything, check the drive for corruption. First find out what the device node is:

 > mount | grep "/mnt/fs"
 /dev/sda2 on /mnt/fs type ext4
 ^^^^^^^^^ 

The reply above is just an example to show what the device node is, in this case, /dev/sda2. Now:

> cd /
> umount /dev/sda2
> e2fsck /dev/sda2
[ may take 10-20 seconds, showing progress ]
> mount /dev/sda2 /mnt/fs

Now you are sure everything is okay, you can do the mv stuff.

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.