How to manage storage devices, directories and files on Huawei’s equipment?
I will try to introduce the file system based on NE40E routers.
NE40E, as most of carrier class Huawei’s devices, has two MPU boards. Each board is equipped with two CFcards. The first CFcard, inside the board, is used for storing software and configuration’s files. The second one, at the front panel of the board, stores log files. Some of Huawei’s devices use flash memory to store all necessary files.
The file system manages files and directories in the storage device by creating, deleting, modifying, renaming files or directories and displaying contents of the files.
Let’s do an example:
- Create labnario and huawei directories in CFcard.
- Copy log.log file from CFcard2 to labnario directory.
- Display this file.
- Rename this file with old_log.log.
- Compress it.
- Move old_log.log.zip file to huawei directory of the same CFcard.
- Delete this file from huawei directory.
- Restore the deleted file.
- Delete this file permanently.
- Delete huawei directory.
Display files stored in CFcard:
<NE40E>dir Directory of cfcard:/ Idx Attr Size(Byte) Date Time(LMT) FileName 0 -rw- 0 Aug 08 2011 14:47:00 snmpnotilog.txt 1 -rw- 247,575,224 Aug 08 2011 14:55:58 ne40e80ev6r1c00spc900.cc 2 -rw- 37,289,817 Aug 08 2011 14:57:20 patch-v6r1spc020.pat 3 -rw- 14,725 Sep 16 2011 11:02:28 license.txt 4 -rw- 86,875 Sep 16 2011 11:03:10 paf.txt 5 -rw- 0 Oct 18 2011 14:57:34 vrpcfg.cfg
Create two directories:
<NE40E>mkdir cfcard:/labnario Info: Create directory cfcard:/labnario......Done. <NE40E>mkdir cfcard:/huawei Info: Create directory cfcard:/huawei......Done. <NE40E>dir Directory of cfcard:/ Idx Attr Size(Byte) Date Time(LMT) FileName 0 drw- - Apr 30 2012 14:48:18 labnario 1 drw- - Apr 30 2012 14:51:08 huawei 2 -rw- 0 Aug 08 2011 14:47:00 snmpnotilog.txt 3 -rw- 247,575,224 Aug 08 2011 14:55:58 ne40e80ev6r1c00spc900.cc 4 -rw- 37,289,817 Aug 08 2011 14:57:20 patch-v6r1spc020.pat 5 -rw- 14,725 Sep 16 2011 11:02:28 license.txt 6 -rw- 86,875 Sep 16 2011 11:03:10 paf.txt 7 -rw- 0 Oct 18 2011 14:57:34 vrpcfg.cfg
Copy log.log file from CFcard2 to labnario directory of CFcard:
<NE40E>copy cfcard2:/log/log.log cfcard:/labnario Copy cfcard2:/log/log.log to cfcard:/labnario/log.log?[Y/N]:y \ Info: Copied file cfcard2:/log/log.log to cfcard:/labnario/log.log...Done. <NE40E>cd labnario <NE40E>pwd cfcard:/labnario <NE40E>dir Directory of cfcard:/labnario/ Idx Attr Size(Byte) Date Time(LMT) FileName 0 -rw- 588,992 Apr 30 2012 14:46:50 log.log 1,022,848 KB total (414,016 KB free)
Rename this file:
<NE40E>rename cfcard:/labnario/log.log cfcard:/labnario/old_log.log Rename cfcard:/labnario/log.log to cfcard:/labnario/old_log.log ?[Y/N]:y Info: Rename file cfcard:/labnario/log.log to cfcard:/labnario/old_log.log ......Done. <NE40E>dir Directory of cfcard:/labnario/ Idx Attr Size(Byte) Date Time(LMT) FileName 0 -rw- 588,992 Apr 30 2012 14:46:50 old_log.log 1,022,848 KB total (414,016 KB free)
Display old_log.log file:
<NE40E>more old_log.log ################################################################ #Automatic record log end,current health information as follows: Slot CPU Usage Memory Usage (Used/Total) --------------------------------------------------------------- 9 MPU(System Master) 11% 19% 361MB/1877MB 1 LPU 12% 40% 130MB/319MB 2 LPU 11% 45% 145MB/319MB 3 LPU 11% 45% 145MB/319MB 10 MPU 7% 17% 320MB/1877MB #DateTime Stamp: 2012-01-25 10:15:27.100 ################################################################ Jan 25 2012 10:25:05 NE40E SRM_BASE/1/ENTITYINSERT: OID 1.3.6.1.4.1.2011.5.25.129.2.1.2 Physical entity is inserted. (EntityPhysicalIndex=16842767, BaseTrapSeverity=4, BaseTrapProbableCause=65541, BaseTrapEventType=5, EntPhysicalContainedIn=16842757, EntPhysicalName="GigabitEthernet1/0/9") Jan 25 2012 10:25:06 NE40E %%01PHY/4/PHY_SFP_XFP_OK(l)[2082]:Slot=1;GigabitEthernet1/0/9 SFP/XFP is present. Jan 25 2012 10:27:14 NE40E %%01SRM/2/NODEFAULT(l)[2083]:Slot=1;PIC0 of LPU1 is failed, perhaps Low Rx Pow ALM of SFP9 ALARM is abnormal. (Reason="EAGF0 ESFP RX power low alarm, Current Rxpower is -40.00dBm. ") Jan 25 2012 10:29:55 NE40E %%01SRM/2/NODERESUME(l)[2084]:Slot=2;OTHER of LPU2: branch 2 of 48vPOWER resumed. Jan 25 2012 10:29:56 NE40E %%01SRM/2/NODEFAULT(l)[2085]:Slot=2;OTHER of LPU2 is failed, perhaps branch 2 of 48vPOWER is abnormal. (Reason="second branch abnormal") Jan 25 2012 10:29:57 NE40E %%01SRM/2/NODERESUME(l)[2086]:Slot=2;OTHER of LPU2: branch 2 of 48vPOWER resumed.
Compress this file:
<NE40E>zip cfcard:/labnario/old_log.log cfcard:/labnario/old_log.log.zip Compress cfcard:/labnario/old_log.log to cfcard:/labnario/old_log.log.zip?[Y/N]:y %Compressed file cfcard:/labnario/old_log.log cfcard:/labnario/old_log.log.zip. <NE40E>dir Directory of cfcard:/labnario/ Idx Attr Size(Byte) Date Time(LMT) FileName 0 -rw- 588,992 Apr 30 2012 14:46:50 old_log.log 1 -rw- 47,918 Apr 30 2012 14:48:20 old_log.log.zip 1,022,848 KB total (413,968 KB free)
Move the zipped file to huawei directory:
<NE40E>move cfcard:/labnario/old_log.log.zip cfcard:/huawei Move cfcard:/labnario/old_log.log.zip to cfcard:/huawei/old_log.log.zip ?[Y/N]:y %Moved file cfcard:/labnario/old_log.log.zip to cfcard:/huawei/old_log.log.zip. <NE40E>dir Directory of cfcard:/labnario/ Idx Attr Size(Byte) Date Time(LMT) FileName 0 -rw- 588,992 Apr 30 2012 14:46:50 old_log.log 1,022,848 KB total (413,952 KB free) <NE40E>cd cfcard:/huawei <NE40E>dir Directory of cfcard:/huawei/ Idx Attr Size(Byte) Date Time(LMT) FileName 0 -rw- 47,918 Apr 30 2012 14:48:20 old_log.log.zip 1,022,848 KB total (413,952 KB free)
Delete this file from huawei directory (actually move to recycle bin):
<NE40E>delete old_log.log.zip Delete cfcard:/huawei/old_log.log.zip?[Y/N]:y Info: Deleting file cfcard:/huawei/old_log.log.zip...succeeded. <NE40E>dir /all Directory of * 0 -rw- 47,918 Apr 30 2012 14:48:18 [old_log.log.zip] 1,022,848 KB total (413,936 KB free) <NE40E>dir Info: File can't be found in the directory. 1,022,848 KB total (413,936 KB free)
Restore the deleted file from recycle bin:
<NE40E>undelete old_log.log.zip Undelete cfcard:/huawei/old_log.log.zip?[Y/N]:y %Undeleted file cfcard:/huawei/old_log.log.zip. <NE40E>dir Directory of cfcard:/huawei/ Idx Attr Size(Byte) Date Time(LMT) FileName 0 -rw- 47,918 Apr 30 2012 14:48:20 old_log.log.zip 1,022,848 KB total (413,936 KB free)
Delete this file permanently:
<NE40E>delete /unreserved old_log.log.zip Warning: The contents of file cfcard:/huawei/old_log.log.zip cannot be recycled. Continue? [Y/N]:y Info: Deleting file cfcard:/huawei/old_log.log.zip...succeeded.
How to make recycle-bin empty go to “reset recycle-bin”.
Delete huawei directory:
<NE40E>cd cfcard: <NE40E>rmdir cfcard:/huawei Remove directory cfcard:/huawei?[Y/N]:y %Removing directory cfcard:/huawei...Done!