Tuesday , December 24 2024
Home / Command Line / from Huawei CLI – reset recycle-bin

from Huawei CLI – reset recycle-bin

reset recycle-bin

Sometimes new engineers, not familiar with Huawei devices, complain that there is not enough space in flash to upload a new software by FTP. The reason of it is that files from flash haven’t been deleted permanently from the memory. They use “delete name of file” command to delete files. Actually this command causes that deleted file is moved to recycle bin and “dir” command does not display it in flash, but it still occupies memory of flash. To display all files stored in flash you should use “dir /all” command.

<labnario>dir
Directory of flash:/
1  -rw-     12017319  Jan 19 2012 17:30:51   labnario.bin
2  -rw-     12017553  Aug 12 2008 18:02:39   ar28-vrp340-r0201p20.bin
3  -rw-         9018  Dec 05 2011 16:22:11   config.cfg

31877 KB total ( 7843 KB free)

Look what will happen if we use “delete labnario.bin” command:

<labnario>delete labnario.bin
Delete flash:/labnario.bin?[Y/N]:y
...
%Delete file flash:/labnario.bin...Done.

As you can see below, even the file has been deleted, it is still occupying memory of flash:

<labnario>dir
Directory of flash:/
1  -rw-  12017553  Aug 12 2008 18:02:39   ar28-vrp340-r0201p20.bin
2  -rw-      9018  Dec 05 2011 16:22:11   config.cfg

31877 KB total ( 7843 KB free)

<labnario>dir /all
Directory of flash:/
1  -rw-  12017553  Aug 12 2008 18:02:39   ar28-vrp340-r0201p20.bin
2  -rw-      9018  Dec 05 2011 16:22:11   config.cfg
3  -rw-  12017319  Jan 19 2012 17:30:51   [labnario.bin]

 31877 KB total ( 7843 KB free)

Below two ways how to delete this file permanently:

reset recycle-bin
<labnario>reset recycle-bin
Clear flash:/~/labnario.bin ?[Y/N]:y
Clearing files from flash may take a long time. Please wait...
.......
%Cleared file flash:/~/labnario.bin.
delete /unreserved …
<labnario>delete /unreserved labnario.bin
The contents cannot be restored!!! Delete flash:/labnario.bin?[Y/N]:y
Deleting a file permanently will take a long time. Please wait...
.....
%Delete file flash:/labnario.bin...Done.

And now what the result is:

<labnario>dir /all
Directory of flash:/
1  -rw-  12017553  Aug 12 2008 18:02:39   ar28-vrp340-r0201p20.bin
2  -rw-      9018  Dec 05 2011 16:22:11   config.cfg

31877 KB total ( 19860 KB free)

The file has been deleted successfully 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *