- printf(" Magic : %08x\n", super.md_magic);
- printf(" Version : %02d.%02d.%02d\n", super.major_version, super.minor_version,
- super.patch_version);
- if (super.minor_version >= 90)
- printf(" UUID : %08x:%08x:%08x:%08x\n", super.set_uuid0, super.set_uuid1,
- super.set_uuid2, super.set_uuid3);
- else
- printf(" UUID : %08x\n", super.set_uuid0);
-
- atime = super.ctime;
- printf(" Creation Time : %.24s\n", ctime(&atime));
- c=map_num(pers, super.level);
- printf(" Raid Level : %s\n", c?c:"-unknown-");
- printf(" Device Size : %d%s\n", super.size, human_size((long long)super.size<<10));
- printf(" Raid Devices : %d\n", super.raid_disks);
- printf(" Total Devices : %d\n", super.nr_disks);
- printf("Preferred Minor : %d\n", super.md_minor);
- printf("\n");
- atime = super.utime;
- printf(" Update Time : %.24s\n", ctime(&atime));
- printf(" State : %s, %serrors\n",
- (super.state&(1<<MD_SB_CLEAN))?"clean":"dirty",
- (super.state&(1<<MD_SB_ERRORS))?"":"no-");
- printf(" Active Devices : %d\n", super.active_disks);
- printf("Working Devices : %d\n", super.working_disks);
- printf(" Failed Devices : %d\n", super.failed_disks);
- printf(" Spare Devices : %d\n", super.spare_disks);
- if (calc_sb_csum(&super) == super.sb_csum)
- printf(" Checksum : %x - correct\n", super.sb_csum);
- else
- printf(" Checksum : %x - expected %x\n", super.sb_csum, calc_sb_csum(&super));
- if (SparcAdjust) {
- /* 2.2 sparc put the events in the wrong place
- * So we copy the tail of the superblock
- * up 4 bytes before continuing
- */
- __u32 *sb32 = (__u32*)&super;
- memcpy(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
- sb32+MD_SB_GENERIC_CONSTANT_WORDS+7+1,
- (MD_SB_WORDS - (MD_SB_GENERIC_CONSTANT_WORDS+7+1))*4);
- printf (" --- adjusting superblock for 2.2/sparc compatability ---\n");
- }
- printf(" Events : %d.%d\n", super.events_hi, super.events_lo);
- printf("\n");
- if (super.level == 5) {
- c = map_num(r5layout, super.layout);
- printf(" Layout : %s\n", c?c:"-unknown-");
- }
- switch(super.level) {
- case 0:
- case 4:
- case 5:
- printf(" Chunk Size : %dK\n", super.chunk_size/1024);
- break;
- case -1:
- printf(" Rounding : %dK\n", super.chunk_size/1024);
- break;
- default: break;
- }
- printf("\n");
- printf(" Number Major Minor RaidDevice State\n");
- for (d= -1; d<(signed int)(super.raid_disks+super.spare_disks); d++) {
- mdp_disk_t *dp;
- char *dv;
- char nb[5];
- if (d>=0) dp = &super.disks[d];
- else dp = &super.this_disk;
- sprintf(nb, "%4d", d);
- printf("%4s %5d %5d %5d %5d ", d < 0 ? "this" : nb,
- dp->number, dp->major, dp->minor, dp->raid_disk);
- if (dp->state & (1<<MD_DISK_FAULTY)) printf(" faulty");
- if (dp->state & (1<<MD_DISK_ACTIVE)) printf(" active");
- if (dp->state & (1<<MD_DISK_SYNC)) printf(" sync");
- if (dp->state & (1<<MD_DISK_REMOVED)) printf(" removed");
- if ((dv=map_dev(dp->major, dp->minor)))
- printf(" %s", dv);
- printf("\n");
- }
- }
- if (SparcAdjust == 2) {
- printf(" ----- updating superblock on device ----\n");
- fd = open(devlist->devname, O_RDWR);
- if (fd < 0) {
- fprintf(stderr, Name ": cannot open %s to update superblock: %s\n",
- devlist->devname, strerror(errno));
- err = 1;
- } else {
- super.sb_csum = calc_sb_csum(&super);
- if (store_super(fd, &super)) {
- fprintf(stderr, Name ": Count not re-write superblock on %s\n",
- devlist->devname);
- err = 1;
- }
- close(fd);
- }