A directory in my external drive contained 1tb data, and when accidentally unplugging, the directory shows empty when opened and in properties...
When I go to delete directory, shows "error: directory not empty"
How to resolve this?
A directory in my external drive contained 1tb data, and when accidentally unplugging, the directory shows empty when opened and in properties...
When I go to delete directory, shows "error: directory not empty"
How to resolve this?
You may be able to retrieve a lot of information about your drive when it is connected, and hopefully this will give you some ideas. I will list some command-line based tools.
First thought
...should solve your problem with this direcotry: it should really remove it for good. If you need to, you can precede the above command with sudo; and you have to be VERY cautious, because you will remove almost anyting you ask it to. Also, type
-rf
at the end, so if you press Enter accidentally, prematurely, you will not "force" and "recursively" over something you did not intend.However, if you feel like experimenting more - there is more for you below:
1) Info about ALL disk devices
...will list device name, size and partitions (and more). In the last column you get the partition type.
I think that fat32 is not the optimal choice for large disks, however, it is fairly standard everywhere. You could use ntfs - nowadays Ubuntu also supports it to some extent.
2) Info about mounted devices
...will pint info about mounted filesystems together with the name of a device that contins it. You have bytes (default) used, you have inodes (specified by -i parameter) which are correlated to the number of files on the disk (not only a size matters, bu also the number of entries in the file allocation table). "h" for human readible units.
...will let you know the summary of that is in
/direcotry/path
. "s" for summary rather than a complete list and "h" for human readible units....this is the protagon of all console-based disk-free-space checks. My favourite. I love how it shows me the biggest items in the current path. By using
asterisk
/asterisk
instead ofasterisk
you will compare all sub-items that are in the current location....is for viewing the directory too. "h" as above, "a" includes hidden files/dirs, "l" shows access rights and ownership info. Especially "a" flag may be of interest in your case.
3) Still nothing? Format the drive
Copy your precious data elsewhere and format the drive over again. After all, the system might have suffered some damages due to the power loss.
CAREFULLY CHOOSE THE DEVICE. If you make a typo at some point, you may loose all you data and OS, and your machine will stop working.
...has the potential to repair your disk whis HAS TO BE unmounted. After fsck finishes, you can remount your drive by
mount /dev/name0 /any/path/you/want
and verify, but sometimes you have to replace the filesystem internals - keep on reading....it overwrites the file system the disk already has. This could also be
mkfs.vfat
for fat32 or (what I prefer)mkfs.ext3
.