Project

General

Profile

Bug #561

Strange characters when executing "format"

Added by Hernán Saltiel almost 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Start date:
2010-12-19
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Hi!
When executing the "format" command as the root user, and having 2 x 250 GB + 1 x 1 TB disks, this is the output I receive:

root@dshecsa01-oi:/opt/pkgs# format
Searching for disks...
Failed to inquiry this logical diskFailed to inquiry this logical diskdone

AVAILABLE DISK SELECTIONS:
0. c2d0
/pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
1. c2d1
/pci@0,0/pci-ide@1f,2/ide@0/cmdk@1,0
2. c3d0 <drive type unknown>
/pci@0,0/pci-ide@1f,2/ide@1/cmdk@0,0
Specify disk (enter its number):

...and if I select disk #2, which is the 1 TB one, I get this message:

AVAILABLE DRIVE TYPES:
0. ?????p(oH?8q???????????pHo0"???Z
1. ?????p(oH?8q???????????pHo0"???Z
2. other
Specify disk type (enter its number):

If in format I select the first disk, this is what I get (it's wrong, it's a 250 GB HD):
root@dshecsa01-oi:/opt/pkgs# format
Searching for disks...
Failed to inquiry this logical diskFailed to inquiry this logical diskdone

AVAILABLE DISK SELECTIONS:
0. c2d0
/pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
1. c2d1
/pci@0,0/pci-ide@1f,2/ide@0/cmdk@1,0
2. c3d0 <drive type unknown>
/pci@0,0/pci-ide@1f,2/ide@1/cmdk@0,0
Specify disk (enter its number): 0
selecting c2d0
NO Alt slice
No defect list found
[disk formatted, no defect list found]

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> p

PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> p
Current partition table (original):
Total disk cylinders available: 4814 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 3 - 4813 36.85GB (4811/0/0) 77288715
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 4813 36.88GB (4814/0/0) 77336910
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0

partition>

Both 250 GB disks have at least one Solaris2 partition, the first has these partitions:

root@dshecsa01-oi:/opt/pkgs# prtpart /dev/rdsk/c2d0p0 -ldevs

Fdisk information for device /dev/rdsk/c2d0p0

  • NOTE **
    /dev/dsk/c2d0p0 - Physical device referring to entire physical disk
    /dev/dsk/c2d0p1 - p4 - Physical devices referring to the 4 primary partitions
    /dev/dsk/c2d0p5 ... - Virtual devices referring to logical partitions

Virtual device names can be used to access EXT2 and NTFS on logical partitions

/dev/dsk/c2d0p1 IFS: NTFS
/dev/dsk/c2d0p2 Linux swap
/dev/dsk/c2d0p3 Linux native
/dev/dsk/c2d0p4 Solaris x86

...and the second has these:
root@dshecsa01-oi:/opt/pkgs# prtpart /dev/rdsk/c2d1p0 -ldevs

Fdisk information for device /dev/rdsk/c2d1p0

  • NOTE **
    /dev/dsk/c2d1p0 - Physical device referring to entire physical disk
    /dev/dsk/c2d1p1 - p4 - Physical devices referring to the 4 primary partitions
    /dev/dsk/c2d1p5 ... - Virtual devices referring to logical partitions

Virtual device names can be used to access EXT2 and NTFS on logical partitions

/dev/dsk/c2d1p1 Solaris x86

What can be making the disks look that strange in OpenIndiana?
Thanks, and best regards,

HeCSa.


Files

bcheck.log (7.9 KB) bcheck.log bcheck output Albert Lee, 2010-12-27 08:08 AM

History

#1

Updated by Albert Lee almost 9 years ago

  • Assignee changed from Alasdair Lumsden to Albert Lee
  • Target version deleted (oi_148)

There is apparently some heap corruption or use of uninitialised memory for the label string. It differs when libumem is used, although it doesn't appear to be the libumem uninitialised memory pattern.

#2

Updated by Albert Lee almost 9 years ago

  • Project changed from OpenIndiana Distribution to illumos gate
  • Category deleted (OS/Net (Kernel and Userland))
#3

Updated by Garrett D'Amore almost 9 years ago

Failed to inquiry this logical diskFailed to inquiry this logical diskdone

That message is probably fairly critical to understanding this bug. Basically, for whatever reason, I think we haven't got inquiry data for the drive in question, and random bytes are displayed instead.

This is just a theory on my part.

Understanding the inquiry failures would be fairly import to resolving this bug, I think.

#4

Updated by Roland Mainz almost 9 years ago

Hernán: Erm... can you run "format" under dbx/bcheck control and see if it reports anything, please ?
For example try this:
$ bcheck -q -access -o /tmp/mylog001.log /usr/sbin/format # and then attach '/tmp/mylog001.log' to this bug as reference.

If you have a bit more time please try to disable the optimiser when building "format" that we can get accurate line number information.

#5

Updated by Albert Lee almost 9 years ago

[trisk@ichiban]% pfexec /opt/sunstudio12.1/bin/bcheck -q -all -o bcheck.log ./format   
Searching for disks...
Failed to inquiry this logical diskdone

AVAILABLE DISK SELECTIONS:
       0. c0d0 < cyl 9726 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@1f,2/ide@1/cmdk@0,0
Specify disk (enter its number): 

[trisk@ichiban]% pfexec pmap `pgrep format`                                   ~
26454:    /export/home/trisk/./format
08044000      16K rw---    [ stack ]
08050000     188K r-x--  /export/home/trisk/format
0808F000      48K rw---  /export/home/trisk/format
0809B000      48K rw---    [ heap ]
B8C00000    8192K rwx--    [ anon ]
BA100000     100K r-x--  /lib/libadm.so.1
BA129000       8K rw---  /lib/libadm.so.1
BA12B000       4K rw---  /lib/libadm.so.1
BB500000      72K r-x--  /opt/sunstudio12.1/prod/lib/sys/disasm.so
BB521000      72K rwx--  /opt/sunstudio12.1/prod/lib/sys/disasm.so
BB533000       4K rwx--  /opt/sunstudio12.1/prod/lib/sys/disasm.so
BC000000    8192K rwx--    [ anon ]
BCC00000    4096K rw---    [ altstack tid=1 ]
BDD00000       4K r-x--  /lib/libdl.so.1
BF100000    1280K r-x--  /usr/lib/libc/libc_hwcap1.so.1
BF240000      32K rwx--  /usr/lib/libc/libc_hwcap1.so.1
BF248000       8K rwx--  /usr/lib/libc/libc_hwcap1.so.1
C0500000       4K r-x--  /opt/sunstudio12.1/prod/lib/dbxruntime/rtcapihook.so
C0510000       4K rwx--  /opt/sunstudio12.1/prod/lib/dbxruntime/rtcapihook.so
C1900000     332K r-x--  /lib/libm.so.2
C1962000       8K rwx--  /lib/libm.so.2
C2D00000       8K r-x--  /usr/lib/libmapmalloc.so.1
C2D12000       4K rw---  /usr/lib/libmapmalloc.so.1
C4100000     220K r-x--  /opt/sunstudio12.1/prod/lib/dbxruntime/librtc.so
C4146000      32K rwx--  /opt/sunstudio12.1/prod/lib/dbxruntime/librtc.so
C414E000     568K rwx--  /opt/sunstudio12.1/prod/lib/dbxruntime/librtc.so
C5500000    1280K r-x--  /usr/lib/libc/libc_hwcap1.so.1
C5640000      32K rwx--  /usr/lib/libc/libc_hwcap1.so.1
C5648000       8K rwx--  /usr/lib/libc/libc_hwcap1.so.1
C6900000       4K r-x--  /lib/libdl.so.1
C7D00000       4K r-x--  /opt/sunstudio12.1/prod/lib/dbxruntime/rtcboot.so
C7D10000       4K rwx--  /opt/sunstudio12.1/prod/lib/dbxruntime/rtcboot.so
C9100000     332K r-x--  /lib/libm.so.2
C9162000       8K rwx--  /lib/libm.so.2
CA500000    1280K r-x--  /usr/lib/libc/libc_hwcap1.so.1
CA640000      32K rwx--  /usr/lib/libc/libc_hwcap1.so.1
CA648000       8K rwx--  /usr/lib/libc/libc_hwcap1.so.1
CB900000       4K r-x--  /lib/libdl.so.1
CCD00000      24K r-x--  /lib/libgen.so.1
CCD16000       4K rw---  /lib/libgen.so.1
CE100000       8K r-x--  /usr/lib/libmapmalloc.so.1
CE112000       4K rw---  /usr/lib/libmapmalloc.so.1
CEBA0000       4K rwx--    [ anon ]
CEBB0000       4K rw---    [ anon ]
CEBBF000     256K rwx--    [ anon ]
CF500000       8K r-x--  /opt/sunstudio12.1/prod/lib/dbxruntime/rtcaudit.so
CF511000       8K rwx--  /opt/sunstudio12.1/prod/lib/dbxruntime/rtcaudit.so
CFE32000     512K rwx--    [ anon ]
CFEB3000       4K rwxs-    [ anon ]
CFEC0000       4K r-x--    [ anon ]
CFED0000       8K rw---    [ anon ]
CFEE0000       4K rwx--    [ anon ]
CFEF0000       4K rwx--    [ anon ]
CFF00000       4K rw---    [ anon ]
CFF10000       4K rwx--    [ anon ]
CFF20000       4K rwx--    [ anon ]
CFF30000      24K rwx--    [ anon ]
CFF40000       4K rwx--    [ anon ]
CFF50000       4K rwx--    [ anon ]
CFF60000       4K rwx--    [ anon ]
CFF70000       4K rwx--    [ anon ]
CFF80000       4K rw---    [ anon ]
CFF90000       4K rw---    [ anon ]
CFFA0000       4K rwx--    [ anon ]
CFFB0000       4K rwx--    [ anon ]
CFFB8000     208K r-x--  /lib/ld.so.1
CFFFC000       8K rwx--  /lib/ld.so.1
CFFFE000       4K rwx--  /lib/ld.so.1
 total     27684K
#6

Updated by Mike Harsch almost 9 years ago

I have a box that is displaying garbage for the disk label string under format. I can make this host available via ssh if someone would like to poke at it. Contact me at mike at harschsystems dot com.

#7

Updated by Mike La Spina almost 9 years ago

FYI
I grabbed a disk that was partitioned on vmware and added it as an rpool mirror dev to one of my Illumos builds. During the process I needed to set the label to SMI because zpool reported it as an unsupported EFI based partition. It was not actually an EFI partition, I believe it was a GPT based one. Thus it was not correctly detected and it was rewritten as one when format is invoked with out -e, I suspect this issue is simply an incorrect assumption in label.c or vtoc.c and is directly related to this bug https://defect.opensolaris.org/bz/show_bug.cgi?id=14295

Running format -e and forcing a label to ether SMI or EFI cleaned up the garbled label.

Regards,
Mike

#8

Updated by Jon Strabala over 8 years ago

  • Difficulty set to Medium
  • Tags set to needs-triage

I see similar issues with a new turn up the 'format' display the funny garbage characters but most every thing seems to work.

But prtvtoc piped into fmthard will toast a SSD disk label. Perhaps this is related to the "corruption issue". - I will describe this in detail.

AVAILABLE DISK SELECTIONS:
0. c5t0d0 <påþÐûäþÀ(´äþ®8@åþpåþÐûäþàH äþõ cyl 14586 alt 2 hd 255 sec 63>
/pci@0,0/pci15d9,631@1f,2/disk@0,0
1. c5t1d0 <påþÐûäþ´äþ®@åþpåþÐûäþÀ( äþõ cyl 14586 alt 2 hd 255 sec 63>
/pci@0,0/pci15d9,631@1f,2/disk@1,0
Specify disk (enter its number): ^D

However I did run into a real show stopping bug when adding a mirrored drive. Basically I did an 'fdisk' made sure that the drive to add to my rpool was exactly the same as my rpool disk.

fdisk /dev/rdsk/c5t0d0p0

Total disk size is 14593 cylinders
Cylinder size is 16065 (512 byte) blocks

Cylinders
Partition Status Type Start End Length % ========= ====== ============ ===== === ====== ===
1 Active Solaris2 5 14592 14588 100

I adjust the starting cylinder 5 to ensure a 4K block alignment of my SSD (in some cases this improves performance by 8X). For this geometry the GUI oi_148b install then will partition and slice 0 starting at an additional offset of 3 giving my a 4096 alignment.

The calculation below MUST be a whole integer.

8 (5 cyl fdisk + 3 cly slice0) X 16065 (cly sz) X 512 (bytes/block) / 4096

No issues here (above install of the OS works great).

I add the second SSD in the chasis / reboot and ran fdisk as above on this drive (same primary partition now - details ommited)

fdisk /dev/rdsk/c5t1d0p0

Then I moved on to the easy way to clone a partition table via prtvtoc piped into fmthard ( I have used this dozens of times).

root@lab10:/home/admin/setup# prtvtoc /dev/rdsk/c5t0d0s2
/dev/rdsk/c5t0d0s2 partition map

Dimensions:
512 bytes/sector
63 sectors/track
255 tracks/cylinder
16065 sectors/cylinder
14588 cylinders
14586 accessible cylinders
Flags:
1: unmountable
10: read-only
Unallocated space:
First Sector Last
Sector Count Sector
0 48195 48194
First     Sector    Last
Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 48195 234275895 234324089
2 5 01 0 234324090 234324089
8 1 01 0 16065 16064
root@lab10:/home/admin/setup#

WARNING!!! THE BELOW COMMAND MAY MESS UP YOUR DRIVE.

prtvtoc /dev/rdsk/c5t0d0s2 | fmthard -s - /dev/rdsk/c5t1d0s2


Basically the above command "nuked' my virtual drive geometry before I ran the above command my drive geometry was as follows:

Drive was good ...

root@lab10:/home/admin/install_setup# fdisk -G /dev/rdsk/c5t0d0p0
Physical geometry for device /dev/rdsk/c5t0d0p0
PCYL NCYL ACYL BCYL NHEAD NSECT SECSIZ
14593 14593 0 0 255 63 512
root@lab10:/home/admin/install_setup# fdisk -g /dev/rdsk/c5t0d0p0
Label geometry for device /dev/rdsk/c5t0d0p0
PCYL NCYL ACYL BCYL NHEAD NSECT SECSIZ
14586 14586 2 0 255 63 512

Drive now bad ...

BAD drive - (has odd geometries):

root@lab10:/home/admin/install_setup# fdisk -G /dev/rdsk/c5t1d0p0
Physical geometry for device /dev/rdsk/c5t1d0p0
PCYL NCYL ACYL BCYL NHEAD NSECT SECSIZ
18689 18689 0 0 224 56 512
root@lab10:/home/admin/install_setup# fdisk -g /dev/rdsk/c5t1d0p0
Label geometry for device /dev/rdsk/c5t1d0p0
PCYL NCYL ACYL BCYL NHEAD NSECT SECSIZ
18680 18680 2 0 224 56 512

The Supermicro X9SCA-F has a C204 chipset and the SSD is on a 6Gbps SATA-3 connection from the mobo. The really odd thing is that it was impossible to fix the label on this system. However when I took the SSD that was messed up onto another oi_148b system (a Compaq different mobo). I could fix the label problem and get the format -G and format -g outputs right again. I repeated this 3 times as I thought no way it was the same OS - so this might also be somehow related to SATA speed and/or the chipset.

================== my system ===================

root@lab10:~# cat /etc/release
OpenIndiana Development oi_148b X86 (powered by illumos)
Copyright 2010 Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
Assembled 11 April 2011

root@lab10:~# uname -a
SunOS openindiana 5.11 oi_148b i86pc i386 i86pc Solaris

root@lab10:~# prtdiag
System Configuration: Supermicro X9SCI/X9SCA
BIOS Configuration: American Megatrends Inc. 4.6.4 02/24/2011
BMC Configuration: IPMI 2.0 (KCS: Keyboard Controller Style)

==== Processor Sockets ====================================

Version Location Tag
-------------------------------- --------------------------
Intel(R) Xeon(R) CPU E31280 @ 3.50GHz SOCKET 0

==== Memory Device Sockets ================================

Type Status Set Device Locator Bank Locator
----------- ------ --- ------------------- ----------------
Unknown in use 0 DIMM_1A BANK0
Unknown in use 0 DIMM_2A BANK0
Unknown in use 0 DIMM_1B BANK0
Unknown in use 0 DIMM_2B BANK0

==== On-Board Devices =====================================
To Be Filled By O.E.M.

==== Upgradeable Slots ====================================

ID Status Type Description
--- --------- ---------------- ----------------------------
0 in use PCI Express J6B2
1 in use PCI Express J6B1
2 in use PCI Express J6D1
3 in use PCI Express J7B1
4 in use PCI Express J8B4
root@lab10:~#

#9

Updated by Eric Schrock over 8 years ago

  • Status changed from New to Resolved

changeset: 13415:cc04348bbc51
tag: tip
user: Gary Mills <>
date: Fri Jul 29 14:40:45 2011 -0700

description:
561 Strange characters when executing "format"
Reviewed by: Gordon Ross <>
Reviewed by: Garrett D'Amore <>
Reviewed by: Jason King <>
Approved by: Eric Schrock <>

Also available in: Atom PDF