From owner-freebsd-sparc64@freebsd.org Sat Oct 17 18:32:02 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29807A1745E for ; Sat, 17 Oct 2015 18:32:02 +0000 (UTC) (envelope-from bvasea@gmail.com) Received: from mail-qg0-x22c.google.com (mail-qg0-x22c.google.com [IPv6:2607:f8b0:400d:c04::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDCC8137F for ; Sat, 17 Oct 2015 18:32:01 +0000 (UTC) (envelope-from bvasea@gmail.com) Received: by qgez77 with SMTP id z77so126467994qge.1 for ; Sat, 17 Oct 2015 11:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=tZIPW0TV6ERMrniCXpdC3ktI0lWLa9Q3UlgaPbvHYLc=; b=o4rsJypK9d277MZiuKbzSlE2OrgCYxuwW6pYZlT0/St3D80jK1Mj7O6Ic0inVjQ3aU Dpbh1YRGD7CMXH65qT4e1kLlSTSJzy/kSMdcu4+ozeUwQfORq5eusV4MSHGxEBBNi77W nfSgePBCgqVfVLI7w2ebanxxWqSS9LqemKaAGiLzHx6IiFhXQwA+zeYAgG6/JCXDaG3y J1ldMNb9pbyUzttRNj9gIsfMKSJZHlE3d3/k62GQj8zH/eJZUgovekkIYPMeE0M00XIm 5OwaUtg435vV2HdSCZjM0sJFL4qVvWcAmLPs6QPmcwSMTfM8oc9Gg1w5+u7aS6Xja7vQ 8SOA== MIME-Version: 1.0 X-Received: by 10.140.94.148 with SMTP id g20mr26861866qge.43.1445106720817; Sat, 17 Oct 2015 11:32:00 -0700 (PDT) Received: by 10.55.181.67 with HTTP; Sat, 17 Oct 2015 11:32:00 -0700 (PDT) Date: Sat, 17 Oct 2015 21:32:00 +0300 Message-ID: Subject: UFS mount failure - disk slice created on and64, unable to mount on sparc64 From: Vasile Buruiana To: freebsd-sparc64@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2015 18:32:02 -0000 Hello Found a bug in FreeBSD 10.2. An UFS disk slice created under sparc64 cannot be mounted under amd64. And reverse: UFS disk slice created under amd64 cannot be mounted under sparc64. This also happens with hard disks on both MBR and VTOC8 partition schemes, on both UFS and ZFS filesystems. uname -a ________ sparc64: root@sun:/usr/home/skaarj # uname -a FreeBSD sun.home.com 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Thu Aug 13 01:16:49 UTC 2015 root@releng1.nyi.freebsd.org:/usr/obj/sparc64.sparc64/usr/src/sys/GENERIC sparc64 root@sun:/usr/home/skaarj # and amd64: root@supercow:/usr/home/skaarj # uname -a FreeBSD supercow.rompetrol.ro 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 root@supercow:/usr/home/skaarj # As we can see, both kernels are the generic. This is how you can simply reproduce the bug: _____________________________________ amd64: -> create 400MB disk image with dd, attach to md and format with newfs -> mount, copy some stuff(/bin), unmount, detach from md; -> md5+sh256 check of the image to see if they match when sent to the other side; -> send it with ftp to the sparc64 machine root@supercow:/usr/home/skaarj # dd if=/dev/zero of=/disk.img bs=8M count=50 50+0 records in 50+0 records out 419430400 bytes transferred in 6.336222 secs (66195661 bytes/sec) root@supercow:/usr/home/skaarj # mdconfig -a -u 0 /disk.img root@supercow:/usr/home/skaarj # newfs -U /dev/md0 /dev/md0: 400.0MB (819200 sectors) block size 32768, fragment size 4096 using 4 cylinder groups of 100.03MB, 3201 blks, 12928 inodes. with soft updates super-block backups (for fsck_ffs -b #) at: 192, 205056, 409920, 614784 root@supercow:/usr/home/skaarj # mount /dev/md0 /mnt root@supercow:/usr/home/skaarj # cp -R /bin /mnt root@supercow:/usr/home/skaarj # ls -l /mnt total 8 drwxrwxr-x 2 root operator 512 Oct 18 00:09 .snap drwxr-xr-x 2 root wheel 1024 Oct 18 00:10 bin root@supercow:/usr/home/skaarj # umount /mnt root@supercow:/usr/home/skaarj # md5 /disk.img MD5 (/disk.img) = ba7c649f74ddfce95e312a6f637e4a09 root@supercow:/usr/home/skaarj # sha256 /disk.img SHA256 (/disk.img) = 18d5d318e662cad6c7b20fd15faed33891300d6294835dc822d8099421747c52 root@supercow:/usr/home/skaarj # ftp 1.1.1.19 Connected to 1.1.1.19. 220 sun.home.com FTP server (Version 6.00LS) ready. Name (1.1.1.19:skaarj): skaarj Password: ftp> mput /disk.img 100% |************************************************| 400 MiB 5.08 MiB/s 00:00 ETA 226 Transfer complete. _______________________________________________________________________________ sparc64: -> md5+sha256 of image to compare; -> attach + md and mount root@sun:/usr/home/skaarj # md5 disk.img MD5 (disk.img) = ba7c649f74ddfce95e312a6f637e4a09 root@sun:/usr/home/skaarj # sha256 disk.img SHA256 (disk.img) = 18d5d318e662cad6c7b20fd15faed33891300d6294835dc822d8099421747c52 root@sun:/usr/home/skaarj # mdconfig -a -u 0 disk.img root@sun:/usr/home/skaarj # mount /dev/md0 /mnt mount: /dev/md0: Invalid argument root@sun:/usr/home/skaarj # _____________________________ no error output on /var/log/messages, no error output on dmesg when mount fails on both systems. Dmesgs after mount failure _______________________________________________________________________________ dmesg on sparc64: Copyright (c) 1992-2015 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 10.2-RELEASE #0 r286666: Thu Aug 13 01:16:49 UTC 2015 root@releng1.nyi.freebsd.org:/usr/obj/sparc64.sparc64/usr/src/sys/GENERIC sparc64 gcc version 4.2.1 20070831 patched [FreeBSD] real memory = 268435456 (256 MB) avail memory = 234143744 (223 MB) cpu0: Sun Microsystems UltraSparc-IIi Processor (400.00 MHz CPU) random: initialized kbd1 at kbdmux0 nexus0: pcib0: mem 0x1fe00000000-0x1fe0000ffff,0x1fe01000000-0x1fe0 10000ff irq 2032,2030,2031,2021 on nexus0 pcib0: Sabre, impl 0, version 0, IGN 0x1f, bus A, 66MHz pcib0: DVMA map: 0xc0000000 to 0xc3ffffff 8192 entries pcib0: [GIANT-LOCKED] pci0: on pcib0 pcib1: at device 1.1 on pci0 pci1: on pcib1 pcib1: device (null) requested unsupported I/O range 0x0-0xff ebus0: mem 0xf0000000-0xf0ffffff,0xf1000000-0xf17fffff at dev ice 1.0 on pci1 pcib2: at device 1.0 on pci0 pci2: on pcib2 auxio0: addr 0x1400726000-0x1400726003,0x1400728000-0x140072 8003,0x140072a000-0x140072a003,0x140072c000-0x140072c003,0x140072f000-0x140072f0 03 on ebus0 ebus0: addr 0x1400724000-0x1400724003 irq 37 (no driver attached) ebus0: addr 0x1400504000-0x1400504002 (no driver attached) scc0: addr 0x1400400000-0x140040007f irq 43 on ebus0 uart0: on scc0 uart0: CTS oflow uart1: on scc0 uart1: CTS oflow uart2: <16550 or compatible> addr 0x14003083f8-0x14003083ff irq 41 on ebus0 uart2: keyboard (1200,n,8,1) kbd0 at sunkbd0 uart3: <16550 or compatible> addr 0x14003062f8-0x14003062ff irq 42 on ebus0 ebus0: addr 0x14003043bc-0x14003043cb,0x140030015c-0x140030015d,0x1400700 000-0x140070000f irq 34 (no driver attached) ebus0: addr 0x14003023f0-0x14003023f7,0x1400706000-0x140070600f,0x1400 720000-0x1400720003 irq 39 (no driver attached) eeprom0: addr 0x1400000000-0x1400001fff on ebus0 eeprom0: model mk48t59 ebus0: addr 0x1000000000-0x10000fffff (no driver attached) pcm0: addr 0x1400200000-0x14002000ff,0x1400702000-0x140070200f,0x1 400704000-0x140070400f,0x1400722000-0x1400722003 irq 35,36 on ebus0 pcm0: hme0: mem 0xe0000000-0xe0007fff at device 1.1 on pci1 miibus0: on hme0 nsphy0: PHY 1 on miibus0 nsphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto hme0: Ethernet address: 08:00:20:ff:6e:88 machfb0: mem 0xe1000000-0xe1ffffff,0xe2000000-0xe2000fff at de vice 2.0 on pci1 machfb0: console machfb0: 16 MB aperture at 0xfe000000 not swapped machfb0: 4096 KB SGRAM 98.924 MHz, maximum RAMDAC clock 230 MHz, DSP machfb0: resolution 1152x900 at 8 bpp atapci0: port 0xc00000-0xc00007,0xc00008-0xc000 0b,0xc00010-0xc00017,0xc00018-0xc0001b,0xc00020-0xc0002f at device 3.0 on pci1 ata2: at channel 0 on atapci0 ata3: at channel 1 on atapci0 syscons0: on nexus0 syscons0: Unknown <16 virtual consoles, flags=0x300> Timecounter "tick" frequency 400000000 Hz quality 1000 Event timer "tick" frequency 400000000 Hz quality 1000 Timecounters tick every 1.000 msec interrupt storm detected on "vec2016:"; throttling interrupt source ada0 at ata2 bus 0 scbus0 target 0 lun 0 ada0: ATA-6 device ada0: Serial Number WD-WCAM9N419109 ada0: 16.700MB/s transferscd0 at ata3 bus 0 scbus1 target 0 lun 0 cd0: Removable CD-ROM SCSI device cd0: Serial Number 6AD0AA149275 cd0: 16.700MB/s transfers (WDMA2, ATAPI 12bytes, PIO 65534bytes) cd0: Attempt to query device size failed: NOT READY, Medium not present (WDMA2, PIO 8192bytes) random: unblocking device. ada0: 76319MB (156301488 512 byte sectors: 16H 63S/T 16383C) ada0: Previously was known as ad0 ada1 at ata2 bus 0 scbus0 target 1 lun 0 ada1: ATA-6 device ada1: Serial Number WD-WCAM9V150577 ada1: 16.700MB/s transfers (WDMA2, PIO 8192bytes) ada1: 76319MB (156301488 512 byte sectors: 16H 63S/T 16383C) ada1: Previously was known as ad1 Trying to mount root from ufs:/dev/ada0a [rw]... _______________________________________________________________________ dmesg on amd64: _______________________________________________________________________ Copyright (c) 1992-2015 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 CPU: Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz (2594.16-MHz K8-class CPU) Origin="GenuineIntel" Id=0x306a9 Family=0x6 Model=0x3a Stepping=9 Features=0xbfebfbff Features2=0x7fbae3bf AMD Features=0x28100800 AMD Features2=0x1 Structured Extended Features=0x281 XSAVE Features=0x1 VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID TSC: P-state invariant, performance statistics real memory = 4294967296 (4096 MB) avail memory = 3777761280 (3602 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 SMT threads cpu0 (BSP): APIC ID: 0 cpu1 (AP): APIC ID: 1 cpu2 (AP): APIC ID: 2 cpu3 (AP): APIC ID: 3 ioapic0 irqs 0-23 on motherboard random: initialized kbd1 at kbdmux0 acpi0: on motherboard acpi_ec0: port 0x62,0x66 on acpi0 acpi0: Power Button (fixed) cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 attimer0: port 0x40-0x43 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 950 Event timer "HPET" frequency 14318180 Hz quality 550 Event timer "HPET1" frequency 14318180 Hz quality 440 Event timer "HPET2" frequency 14318180 Hz quality 440 Event timer "HPET3" frequency 14318180 Hz quality 440 Event timer "HPET4" frequency 14318180 Hz quality 440 atrtc0: port 0x70-0x71 irq 8 on acpi0 Event timer "RTC" frequency 32768 Hz quality 0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 acpi_lid0: on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 vgapci0: port 0x6000-0x603f mem 0xf0000000-0xf03fffff,0xe0000000-0xefffffff irq 16 at device 2.0 on pci0 agp0: on vgapci0 agp0: aperture size is 256M, detected 65532k stolen memory vgapci0: Boot video device xhci0: mem 0xf2520000-0xf252ffff irq 16 at device 20.0 on pci0 xhci0: 32 bytes context size, 64-bit DMA xhci0: Port routing mask set to 0xffffffff usbus0 on xhci0 pci0: at device 22.0 (no driver attached) em0: port 0x6080-0x609f mem 0xf2500000-0xf251ffff,0xf253b000-0xf253bfff irq 20 at device 25.0 on pci0 em0: Using an MSI interrupt em0: Ethernet address: 28:d2:44:10:3f:ae ehci0: mem 0xf253a000-0xf253a3ff irq 16 at device 26.0 on pci0 usbus1: EHCI version 1.0 usbus1 on ehci0 hdac0: mem 0xf2530000-0xf2533fff irq 22 at device 27.0 on pci0 pcib1: irq 16 at device 28.0 on pci0 pci2: on pcib1 sdhci_pci0: mem 0xf1d00000-0xf1d000ff irq 16 at device 0.0 on pci2 sdhci_pci0: 1 slot(s) allocated pcib2: irq 17 at device 28.1 on pci0 pci3: on pcib2 pci3: at device 0.0 (no driver attached) pcib3: irq 18 at device 28.2 on pci0 pci4: on pcib3 ehci1: mem 0xf2539000-0xf25393ff irq 23 at device 29.0 on pci0 usbus2: EHCI version 1.0 usbus2 on ehci1 isab0: at device 31.0 on pci0 isa0: on isab0 ahci0: port 0x60a8-0x60af,0x60b4-0x60b7,0x60a0-0x60a7,0x60b0-0x60b3,0x6060-0x607f mem 0xf2538000-0xf25387ff irq 19 at device 31.2 on pci0 ahci0: AHCI v1.30 with 6 6Gbps ports, Port Multiplier not supported ahcich0: at channel 0 on ahci0 ahcich1: at channel 1 on ahci0 ahcich4: at channel 4 on ahci0 ahciem0: on ahci0 acpi_tz0: on acpi0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model Generic PS/2 mouse, device ID 0 battery0: on acpi0 acpi_acad0: on acpi0 orm0: at iomem 0xc0000-0xcffff on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 ppc0: cannot reserve I/O port range est0: on cpu0 est1: on cpu1 est2: on cpu2 est3: on cpu3 Timecounters tick every 1.000 msec hdacc0: at cad 0 on hdac0 hdaa0: at nid 1 on hdacc0 pcm0: at nid 20,21 and 24 on hdaa0 pcm1: at nid 18 on hdaa0 hdacc1: at cad 3 on hdac0 hdaa1: at nid 1 on hdacc1 pcm2: at nid 5 on hdaa1 pcm3: at nid 6 on hdaa1 pcm4: at nid 7 on hdaa1 random: unblocking device. usbus0: 5.0Gbps Super Speed USB v3.0 usbus1: 480Mbps High Speed USB v2.0 usbus2: 480Mbps High Speed USB v2.0 ugen1.1: at usbus1 uhub0: on usbus1 ugen0.1: <0x8086> at usbus0 uhub1: <0x8086 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 ugen2.1: at usbus2 uhub2: on usbus2 ses0 at ahciem0 bus 0 scbus3 target 0 lun 0 ses0: SEMB S-E-S 2.00 device ses0: SEMB SES Device ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA8-ACS SATA 2.x device ada0: Serial Number W0Q9KW2S ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 305245MB (625142448 512 byte sectors: 1H 63S/T 16383C) ada0: quirks=0x1<4K> ada0: Previously was known as ad4 cd0 at ahcich1 bus 0 scbus1 target 0 lun 0 cd0: Removable CD-ROM SCSI device cd0: Serial Number S45N7602Z1ZM1R00KBEN cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes) cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed SMP: AP CPU #1 Launched! SMP: AP CPU #2 Launched! SMP: AP CPU #3 Launched! Timecounter "TSC-low" frequency 1297082444 Hz quality 1000 uhub1: 8 ports with 8 removable, self powered Root mount waiting for: usbus2 usbus1 uhub0: 3 ports with 3 removable, self powered uhub2: 3 ports with 3 removable, self powered Root mount waiting for: usbus2 usbus1 ugen1.2: at usbus1 uhub3: on usbus1 ugen2.2: at usbus2 uhub4: on usbus2 Root mount waiting for: usbus2 usbus1 uhub3: 6 ports with 6 removable, self powered uhub4: 8 ports with 8 removable, self powered ugen1.3: at usbus1 Root mount waiting for: usbus1 ugen1.4: at usbus1 ugen1.5: at usbus1 Trying to mount root from ufs:/dev/ada0s4a [rw]... ____________________________________________________ Please advise Best wishes, Vasile