Another utility, which should support both reading and writing to "Class A" file-systems, at least to some extent, is cffs:
root@T60:~# cffs -v cffs version 0.06 (C) Simon Evans 2002 ([email protected]) root@T60:~# However, it seems to refuse to support ATA-type flash-memory cards: root@T60:~# fdisk -lu /dev/sdb Disk /dev/sdb: 32 MB, 32112640 bytes 255 heads, 63 sectors/track, 3 cylinders, total 62720 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdb doesn't contain a valid partition table root@T60:~# cffs /dev/sdb --dir /dev/sdb is not an MTD character device root@T60:~# ..and detects only linear-flash cards. For example SMART 4MB linear flash PCMCIA card: root@T60:~# dmesg | tail -5 [ 2756.208470] pcmciamtd 0.0: pcmcia: could not parse base and rmask0 of CIS [ 2756.212768] Found: Intel 28F016S5 [ 2756.212773] SMART Modular Technologies 4MB FLASH Card : Found 2 x8 devices at 0x0 in 16-bit bank [ 2756.215555] erase region 0: offset=0x0,size=0x20000,blocks=32 [ 2756.218484] pcmciamtd 0.0: mtd0: SMART Modular Technologies 4MB FLASH Card root@T60:~# cffs /dev/mtd0 --dir root@T60:~# cffs /dev/mtd0 --fsck Free space = 4194304 bytes Flash is not blank root@T60:~# cffs /dev/mtd0 --erase Size = 4194304 erase size = 131072 32 Erase blocks Proceed with erase [Y/n]Y Erasing block 1/32 erase failed: Timer expired However, this erase operation never completes. Ciscoflash, on the other hand, seems not to support linear flash: root@T60:~# ciscoflash -v -d /dev/mtd0 info ciscoflash: Unknown magic number (0x00000000) root@T60:~# Are there "Class A" and "Class B" file-systems both on ATA-type and linear-type flash cards? Has anyone succesfully written to "Class A" file-system under Linux? thanks, Martin On Mon, Jun 17, 2013 at 5:18 PM, Martin T <[email protected]> wrote: > One utility, which supports reading the "Class A" file-system, is > ciscoflash(http://freecode.com/projects/ciscoflash) by Simon Lockhart: > > T42 ~ # ciscoflash -d /dev/sdb dir > -#- --type-- --crc--- -seek-- -length- -----date/time------ name > 1 00000002 E81CCB85 09831C 426652 Jun 17 2013 03:56:03 > cat4500-ios-promupgrade-122_31r_SGA7 > T42 ~ # ciscoflash -d /dev/sdb extract > T42 ~ # ls -l cat4500-ios-promupgrade-122_31r_SGA7 > -rw-r--r-- 1 root root 426652 2013-06-17 17:13 > cat4500-ios-promupgrade-122_31r_SGA7 > T42 ~ # > > However, it does not support writing to "Class A" file-systems. > > > regards, > Martin > > 2013/6/17, Martin T <[email protected]>: >> Hi, >> >> older Cisco 4500 series supervisor engines support compact flash >> cards. However, Cisco-branded 32MB compact-flash taken from Cisco 1800 >> series router is not recognized by SUP: >> >> Catalyst4500#dir slot0: >> %Error opening slot0:/ (Bad device info block) >> Catalyst4500# >> >> After executing "format slot0:", the compact flash became accessible: >> >> Catalyst4500#format slot0: >> Format operation may take a while. Continue? [confirm] >> Format operation will destroy all data in "slot0:". Continue? [confirm] >> Enter volume ID (up to 64 chars)[default slot0]: >> >> Format of slot0 complete >> Catalyst4500#dir slot0: >> Directory of slot0:/ >> >> No files in directory >> >> 31784960 bytes total (31784960 bytes free) >> Catalyst4500# >> >> >> The problem is, that now I'm not able to access this compact-flash in >> my PC. Looks like it even does not have a partition-table: >> >> T42 ~ # dmesg | tail >> [1983944.880491] ata5.00: 62720 sectors, multi 0: LBA >> [1983944.888476] ata5.00: configured for PIO0 >> [1983944.888794] scsi 4:0:0:0: Direct-Access ATA STI Flash >> 8.0.0 01/1 PQ: 0 ANSI: 5 >> [1983944.889398] sd 4:0:0:0: Attached scsi generic sg2 type 0 >> [1983944.891205] sd 4:0:0:0: [sdb] 62720 512-byte logical blocks: >> (32.1 MB/30.6 MiB) >> [1983944.891403] sd 4:0:0:0: [sdb] Write Protect is off >> [1983944.891414] sd 4:0:0:0: [sdb] Mode Sense: 00 3a 00 00 >> [1983944.891501] sd 4:0:0:0: [sdb] Write cache: enabled, read cache: >> enabled, doesn't support DPO or FUA >> [1983944.910031] sdb: unknown partition table >> [1983944.910632] sd 4:0:0:0: [sdb] Attached SCSI removable disk >> T42 ~ # fdisk -lu /dev/sdb >> >> Disk /dev/sdb: 32 MB, 32112640 bytes >> 255 heads, 63 sectors/track, 3 cylinders, total 62720 sectors >> Units = sectors of 1 * 512 = 512 bytes >> Sector size (logical/physical): 512 bytes / 512 bytes >> I/O size (minimum/optimal): 512 bytes / 512 bytes >> Disk identifier: 0x00000000 >> >> Disk /dev/sdb doesn't contain a valid partition table >> T42 ~ # file -s /dev/sdb >> /dev/sdb: data >> T42 ~ # dd if=/dev/sdb bs=512 count=1 | hexdump -C >> 00000000 88 06 35 76 ea 01 00 00 01 00 00 00 00 00 04 00 >> |..5v............| >> 00000010 ff ff ff ff 01 00 06 00 03 00 00 00 e5 01 00 00 >> |................| >> 00000020 00 00 00 01 02 00 7c 60 00 00 00 00 02 00 c2 ff >> |......|`........| >> 00000030 00 00 3e 00 e8 01 00 00 01 00 00 00 e9 01 00 00 >> |..>.............| >> 00000040 01 00 00 00 6c 73 74 6f 00 30 00 00 00 00 00 00 >> |....lsto.0......| >> 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >> |................| >> * >> 000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 >> |................| >> 000000b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> |................| >> * >> 00000100 d0 ba 1e 0b 02 00 f8 5f b8 80 ff ff ff ff ff ff >> |......._........| >> 00000110 6f 79 61 64 66 2d 6c 73 62 69 6d 2d 00 00 00 00 >> |oyadf-lsbim-....| >> 00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >> |................| >> * >> 00000140 45 7f 46 4c 02 01 00 01 00 00 00 00 00 00 00 00 >> |E.FL............| >> 00000150 02 00 70 00 00 00 01 00 00 01 00 00 00 00 34 00 >> |..p...........4.| >> 00000160 02 00 68 5e 00 00 00 00 34 00 20 00 01 00 28 00 |..h^....4. >> ...(.| >> 00000170 0a 00 09 00 00 00 01 00 01 00 00 00 00 01 00 00 >> |................| >> 00000180 00 01 00 00 01 00 b4 57 29 00 a4 c2 00 00 07 00 >> |.......W).......| >> 00000190 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >> |................| >> 000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >> |................| >> * >> 1+0 records in >> 1+0 records out >> 512 bytes (512 B) copied, 0.0158727 s, 32.3 kB/s >> 00000200 >> T42 ~ # >> >> >> "format" command creates a "Class A" file-system? Is this "Class A" >> file-system some kind of Cisco-proprietary file-system? is there a way >> to access this file-system under modern(2.6/3.x) Linux kernel? >> >> >> regards, >> Martin >> _______________________________________________ cisco-nsp mailing list [email protected] https://puck.nether.net/mailman/listinfo/cisco-nsp archive at http://puck.nether.net/pipermail/cisco-nsp/
