1

I moved a folder using mv and now my folder is a file with unknown details.

The command I ran was mv juno-projects/ juno. After running this command juno is a file not a folder and more than that the system has no clue what juno is. A simple ls command results in

ls: cannot access 'juno': No such file or directory
api_keys  bin  juno  portfolio  python  react  rusttest  school  

A detailed ls -l results in:

drwxrwxrwx 1 sandbox sandbox 512 Mar 19 16:19 api_keys                                                                             drwxrwxrwx 1 sandbox sandbox 512 Mar 25 13:39 bin
d????????? ? ?       ?         ?            ? juno                                                                                 
drwxrwxrwx 1 sandbox sandbox 512 Mar  7 23:49 portfolio                                                                            
drwxrwxrwx 1 sandbox sandbox 512 Mar 18 12:46 python                                                                               
drwxrwxrwx 1 sandbox sandbox 512 Mar 19 01:53 react                                                                                
drwxrwxrwx 1 sandbox sandbox 512 Jan 26 23:51 rusttest                                                                             
drwxrwxrwx 1 sandbox sandbox 512 Jan 28 20:46 school       

A cd into juno works. However when I list the directory I get.

cd juno
ls
ls: cannot open directory '.': No such file or directory

Can anyone help me tell Ubuntu that juno is a folder. All the contents are gone. Thank you.

  • 1
    "is a file not a folder" – It's (still) a directory (`d` in the output of `ls` indicates this) and [thus a file](https://superuser.com/a/1467109/432690). OK, semantics aside. What is the type of the filesystem holding the directory? The filesystem may be corrupted. If the missing data is critical, check your RAM, then SMART status of the block device holding the filesystem, then `ddrescue` the entire partition just in case, then run `fsck`. If the missing data is not critical and you don't think your hardware may be faulty then just `fsck`. What does it report? – Kamil Maciorowski Mar 26 '22 at 18:57
  • `fsck` outputs ```fsck from util-linux 2.34 fsck.ext4: Unable to resolve 'LABEL=cloudimg-rootfs'``` – Brandon Nadeau Mar 26 '22 at 20:43
  • Well a simple computer restart fixed this lol. I had quite a bit going on and couldn't restart but when I did, it was fixed. – Brandon Nadeau Mar 27 '22 at 16:26

1 Answers1

0

A simple restart fixed this for me.