Linux RHEL - Find disk type - linux

I have Oracle Linux Server release 5.6 (Red Hat Enterprise Linux Server release 5.6) and I want to check if the disk type is SATA, SCSI, ATA or SAS or any other disk type.
I installed lshw (hardware lister) and executing "lshw -class storage" gives the below output
description: SCSI storage controller
product: 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
vendor: LSI Logic / Symbios Logic
physical id: 10
bus info: pci#0000:00:10.0
logical name: scsi0
version: 01
width: 64 bits
clock: 33MHz
capabilities: scsi bus_master rom scsi-host
configuration: driver=mptspi latency=64 maxlatency=255 mingnt=6
resources: irq:17 ioport:1400(size=256) memory:d8820000-d883ffff memory:d8800000-d881ffff memory:84008000-8400bfff(prefetchable)
Does this mean this is a SCSI disk type?
How do you find out if the disk type is SAS?
Thanks!

Related

Cannot find tape devices in linux

I want to use tape devices to backup in linux. But I can't find the information of that devices in /proc/scsi/scsi. The tape devices is Quantum Scalar i40 and the OS in cluster is Red Hat Enterprise Linux.
Below is some information.
tape devices
# uname -r
2.6.32-504.el6.x86_64
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.6 (Santiago)
# lsscsi
[0:0:0:0] disk HP LOGICAL VOLUME 3.56 /dev/sda
[0:0:0:1] disk HP LOGICAL VOLUME 3.56 /dev/sdb
[0:3:0:0] storage HP P840 3.56 -
# cat /proc/scsi/scsi
Attached devices:
Host:scsi0 Channel: 03 Id: 00 Lun: 00
Vendor: HP Model: P840 Rev: 3.56
Type: RAID ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: LOGICAL VOLUME Rev: 3.56
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 00 Lun: 01
Vendor: HP Model: LOGICAL VOLUME Rev: 3.56
Type: Direct-Access ANSI SCSI revision: 05
# modinfo st
filename: /lib/modules/2.6.32-504.el6.x86_64/kernel/drivers/scsi/st.ko alias: scsi:t-0x01*
alias: char-major-9-*
license: GPL
description: SCSI tape (st) driver
author: Kai Makisara
srcversion: AB519E7875D34CA8D8A68F0
depends:
vermagic: 2.6.32-504.el6.x86_64 SMP mod_unload modversions
parm: buffer_kbs:Default driver buffer size for fixed block mode (KB; 32) (int)
parm: max_sg_segs:Maximum number of scatter/gather segments to use (256) (int)
parm: try_direct_io:Try direct I/O between user buffer and tape drive (1) (int)
parm: try_rdio:Try direct read i/o when possible (int)
parm: try_wdio:Try direct write i/o when possible (int)
#dmesg
................omit............................
st 1:0:0:0: Attached scsi tape st0
st 1:0:0:0: st0: try direct i/o: yes (alignment 4 B)
osst :I: Tape driver with OnStream support version 0.99.4
osst :I: $Id: osst.c,v 1.73 2005/01/01 21:13:34 wriede Exp $
SCSI Media Changer driver v0.25
ch0: type #1 (mt): 0x1+1 [medium transport]
ch0: type #2 (st): 0x1000+39 [storage]
ch0: type #3 (ie): 0x10+0 [import/export]
ch0: type #4 (dt): 0x100+1 [data transfer]
ch0: dt 0x100: ID/LUN unknown
ch0: INITIALIZE ELEMENT STATUS, may take some time ...
ch0: ... finished
ch 1:0:0:1: Attached scsi changer ch0
................omit............................
st0: Block limits 1 - 8388608 bytes.
pci 0000:01:00.1: Invalid ROM contents
tun3: Disabled Privacy Extensions
st0: Error e0000 (driver bt 0x0, host bt 0xe).
rport-1:0-0: blocked FC remote port time out: removing target and saving binding
st 1:0:0:0: rejecting I/O to offline device
st 1:0:0:0: rejecting I/O to offline device
st0: Error on write filemark.
................omit............................
How can I solve the issue? Thanks!

Qemu x86 and Linux 3.12.17 Kernel panic when booting

I have an issue regarding the execution of a custom Openwrt system with Linux 3.12.17 in Qemu 2.0.0. During the boot process, I have a message telling me that the bootloader cannot find my root partition device, which is /dev/sda as you can see in the following image :
Shell:~$ sudo fdisk -l
[sudo] password for :
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0x000f25bd
Device Boot Start End Blocks Id System
/dev/sda1 * 16065 1028159 506047+ 83 Linux
/dev/sda2 1028160 41592284 20282062+ 83 Linux
/dev/sda3 41592285 976773167 467590441+ f W95 Ext'd (LBA)
/dev/sda5 41608350 45608534 2000092+ 82 Linux swap / Solaris
/dev/sda6 45620266 976773167 465576451 83 Linux
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 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
Device Boot Start End Blocks Id System
/dev/sdb1 1 500118191 250059095+ ee GPT
Here is the command that I use to launch the Qemu emulator :
qemu-system-x86_64 -m 512 \
-kernel bin/x86/openwrt-x86-sgc_qemu-vmlinuz \
--append "root=/dev/sda rw" \
-nographic -usb \
-hda bin/x86/openwrt-x86-sgc_qemu-rootfs-ext4.img
Here is the full boot log :
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 3.12.17 (g602882#rmm-p1303101) (gcc version 4.5.2 (GCC) ) #4 SMP PREEMPT Wed Mar 8 15:47:13 CET 2017
e820: BIOS-provided physical RAM map:
BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
BIOS-e820: [mem 0x0000000000100000-0x000000001fffdfff] usable
BIOS-e820: [mem 0x000000001fffe000-0x000000001fffffff] reserved
BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
Notice: NX (Execute Disable) protection cannot be enabled: non-PAE kernel!
SMBIOS 2.4 present.
e820: last_pfn = 0x1fffe max_arch_pfn = 0x100000
PAT not supported by CPU.
found SMP MP-table at [mem 0x000f0b30-0x000f0b3f] mapped at [c00f0b30]
init_memory_mapping: [mem 0x00000000-0x000fffff]
init_memory_mapping: [mem 0x1f800000-0x1fbfffff]
init_memory_mapping: [mem 0x18000000-0x1f7fffff]
init_memory_mapping: [mem 0x00100000-0x17ffffff]
init_memory_mapping: [mem 0x1fc00000-0x1fffdfff]
ACPI: RSDP 000f09a0 00014 (v00 BOCHS )
ACPI: RSDT 1ffffbc1 00034 (v01 BOCHS BXPCRSDT 00000001 BXPC 00000001)
ACPI: FACP 1ffff1c0 00074 (v01 BOCHS BXPCFACP 00000001 BXPC 00000001)
ACPI: DSDT 1fffe040 01180 (v01 BOCHS BXPCDSDT 00000001 BXPC 00000001)
ACPI: FACS 1fffe000 00040
ACPI: SSDT 1ffff234 008DD (v01 BOCHS BXPCSSDT 00000001 BXPC 00000001)
ACPI: APIC 1ffffb11 00078 (v01 BOCHS BXPCAPIC 00000001 BXPC 00000001)
ACPI: HPET 1ffffb89 00038 (v01 BOCHS BXPCHPET 00000001 BXPC 00000001)
511MB LOWMEM available.
mapped low ram: 0 - 1fffe000
low ram: 0 - 1fffe000
Zone ranges:
DMA [mem 0x00001000-0x00ffffff]
Normal [mem 0x01000000-0x1fffdfff]
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x00001000-0x0009efff]
node 0: [mem 0x00100000-0x1fffdfff]
Using APIC driver default
ACPI: PM-Timer IO Port: 0xb008
ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
Using ACPI (MADT) for SMP configuration information
ACPI: HPET id: 0x8086a201 base: 0xfed00000
smpboot: Allowing 1 CPUs, 0 hotplug CPUs
e820: [mem 0x20000000-0xfeffbfff] available for PCI devices
setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:1 nr_node_ids:1
PERCPU: Embedded 13 pages/cpu #dfbed000 s30592 r0 d22656 u53248
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129948
Kernel command line: root=/dev/sda rw
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Initializing CPU#0
allocated 1048552 bytes of page_cgroup
please try 'cgroup_disable=memory' option if you don't want memory cgroups
Memory: 509692K/523888K available (4990K kernel code, 415K rwdata, 1928K rodata, 576K init, 452K bss, 14196K reserved)
virtual kernel memory layout:
fixmap : 0xfff16000 - 0xfffff000 ( 932 kB)
vmalloc : 0xe07fe000 - 0xfff14000 ( 503 MB)
lowmem : 0xc0000000 - 0xdfffe000 ( 511 MB)
.init : 0xc172b000 - 0xc17bb000 ( 576 kB)
.data : 0xc14dfc22 - 0xc172ae00 (2348 kB)
.text : 0xc1000000 - 0xc14dfc22 (4991 kB)
Checking if this processor honours the WP bit even in supervisor mode...Ok.
Preemptible hierarchical RCU implementation.
RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
NR_IRQS:2304 nr_irqs:256 16
console [ttyS0] enabled
tsc: Fast TSC calibration using PIT
tsc: Detected 3092.840 MHz processor
Calibrating delay loop (skipped), value calculated using timer frequency.. 6185.68 BogoMIPS (lpj=12371360)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
Initializing cgroup subsys memory
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Initializing cgroup subsys blkio
Initializing cgroup subsys perf_event
mce: CPU supports 10 MCE banks
Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0
tlb_flushall_shift: 6
Freeing SMP alternatives memory: 24K (c17bb000 - c17c1000)
ACPI: Core revision 20130725
ACPI: All ACPI Tables successfully acquired
ftrace: allocating 25039 entries in 49 pages
Enabling APIC mode: Flat. Using 1 I/O APICs
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
smpboot: CPU0: Intel QEMU Virtual CPU version 2.0.0 (fam: 06, model: 06, stepping: 03)
Performance Events: Broken PMU hardware detected, using software events only.
Failed to access perfctr msr (MSR c1 is 0)
Brought up 1 CPUs
smpboot: Total of 1 processors activated (6185.68 BogoMIPS)
devtmpfs: initialized
NET: Registered protocol family 16
cpuidle: using governor ladder
cpuidle: using governor menu
ACPI: bus type PCI registered
PCI: PCI BIOS revision 2.10 entry at 0xfd3c2, last bus=0
PCI: Using configuration type 1 for base access
pcimode=0x0
bio: create slab <bio-0> at 0
ACPI: Added _OSI(Module Device)
ACPI: Added _OSI(Processor Device)
ACPI: Added _OSI(3.0 _SCP Extensions)
ACPI: Added _OSI(Processor Aggregator Device)
ACPI: Interpreter enabled
ACPI: (supports S0 S5)
ACPI: Using IOAPIC for interrupt routing
PCI: Ignoring host bridge windows from ACPI; if necessary, use "pci=use_crs" and report a bug
ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
acpi PNP0A03:00: ACPI _OSC support notification failed, disabling PCIe ASPM
acpi PNP0A03:00: Unable to request _OSC control (_OSC support mask: 0x08)
acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [bus 00-ff]
pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
pci_bus 0000:00: root bus resource [mem 0x00000000-0xffffffff]
pci 0000:00:01.3: quirk: [io 0xb000-0xb03f] claimed by PIIX4 ACPI
pci 0000:00:01.3: quirk: [io 0xb100-0xb10f] claimed by PIIX4 SMB
ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
ACPI: Enabled 16 GPEs in block 00 to 0F
vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
vgaarb: loaded
vgaarb: bridge control possible 0000:00:02.0
SCSI subsystem initialized
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
PTP clock support registered
PCI: Using ACPI for IRQ routing
NET: Registered protocol family 8
NET: Registered protocol family 20
HPET: 3 timers in total, 0 timers will be used for per-cpu timer
hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 100.000000 MHz counter
Switched to clocksource hpet
pnp: PnP ACPI init
ACPI: bus type PNP registered
pnp: PnP ACPI: found 8 devices
ACPI: bus type PNP unregistered
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
pci 0000:00:00.0: Limiting direct PCI/PCI transfers
pci 0000:00:01.0: PIIX3: Enabling Passive Release
pci 0000:00:01.0: Activating ISA DMA hang workarounds
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11
NatSemi SCx200 Driver
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering unionfs 2.6 (for 3.12.26)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
Installing knfsd (copyright (C) 1996 okir#monad.swb.de).
NTFS driver 2.1.30 [Flags: R/W].
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.22)
msgmni has been set to 995
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 38, base_baud = 921600) is a 16550A
Linux agpgart interface v0.103
[drm] Initialized drm 1.1.0 20060810
SCSI Media Changer driver v0.25
physmap platform flash device: 08000000 at c0000000
physmap-flash physmap-flash.0: map_probe failed
Intel(R) SPI FLASH CONTROLLER Driver built on Mar 8 2017 # 15:45:49
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk#qualcomm.com>
Intel (R) UDMA Driver - 1.0.0
Copyright (c) 2012 Intel Corperation.
UDMA Network Device Driver init
e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
e1000: Copyright (c) 1999-2006 Intel Corporation.
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 10
GBE working in Real Phy Mode
e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 52:54:00:12:34:56
e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:04.0 eth1: (PCI:33MHz:32-bit) 52:54:00:12:34:57
e1000 0000:00:04.0 eth1: Intel(R) PRO/1000 Network Connection
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10
GBE working in Real Phy Mode
tsc: Refined TSC clocksource calibration: 3092.828 MHz
Switched to clocksource tsc
e1000 0000:00:05.0 eth2: (PCI:33MHz:32-bit) 52:54:00:12:34:58
e1000 0000:00:05.0 eth2: Intel(R) PRO/1000 Network Connection
ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11
GBE working in Real Phy Mode
e1000 0000:00:06.0 eth3: (PCI:33MHz:32-bit) 52:54:00:12:34:59
e1000 0000:00:06.0 eth3: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:07.0 eth4: (PCI:33MHz:32-bit) 52:54:00:12:34:5a
e1000 0000:00:07.0 eth4: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:08.0 eth5: (PCI:33MHz:32-bit) 52:54:00:12:34:5b
e1000 0000:00:08.0 eth5: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:09.0 eth6: (PCI:33MHz:32-bit) 52:54:00:12:34:5c
e1000 0000:00:09.0 eth6: Intel(R) PRO/1000 Network Connection
e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
e1000e: Copyright(c) 1999 - 2013 Intel Corporation.
ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver - version 3.15.1-k
ixgbe: Copyright (c) 1999-2013 Intel Corporation.
ixgb: Intel(R) PRO/10GbE Network Driver - version 1.0.135-k2-NAPI
ixgb: Copyright (c) 1999-2008 Intel Corporation.
PPP generic driver version 2.4.2
NET: Registered protocol family 24
i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
mousedev: PS/2 mouse device common for all mice
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input2
rtc_cmos 00:00: RTC can wake from S4
rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
rtc_cmos 00:00: alarms up to one day, 114 bytes nvram, hpet irqs
softdog: Software Watchdog Timer: 0.08 initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
oprofile: using NMI interrupt.
IPv4 over IPSec tunneling driver
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 10
mip6: Mobile IPv6
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
8021q: 802.1Q VLAN Support v1.8
sctp: Hash tables configured (established 16384 bind 16384)
lib80211: common routines for IEEE802.11 drivers
Key type dns_resolver registered
Using IPI No-Shortcut mode
registered taskstats version 1
rtc_cmos 00:00: setting system clock to 2017-03-08 14:51:21 UTC (1488984681)
VFS: Cannot open root device "sda" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.17 #4
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
00000000 00000000 df45beec c14da955 df45bf34 df45bf04 c14da68e 00000000
df45bf34 fffffffa df75e000 df45bf60 c172bd4e c1605306 df45bf34 c16052b5
c1605282 c176906d df45bf34 fffffffa c16053a2 dffecbc0 00008000 6e6b6e75
Call Trace:
[<c14da955>] dump_stack+0x4b/0x7e
[<c14da68e>] panic+0x88/0x184
[<c172bd4e>] mount_block_root+0x17f/0x18f
[<c10e2a19>] ? SyS_mknod+0x1a/0x1c
[<c172be22>] mount_root+0xc4/0xce
[<c10e2b31>] ? SyS_unlink+0x15/0x17
[<c172bf3d>] prepare_namespace+0x111/0x142
[<c172ba87>] kernel_init_freeable+0x186/0x193
[<c14d7308>] kernel_init+0xd/0xb9
[<c14dea3b>] ret_from_kernel_thread+0x1b/0x30
[<c14d72fb>] ? rest_init+0x77/0x77
What is very weird is that I have the same version of OpenWRT system with a Linux 2.6.32 and it works well. Do I have additionnal kernel options to configure for linux 3.12.X for making it works with Qemu 2.0.0 ?
Thank you in advanced for your helps and comments.
There may be something wrong with your bin/x86/openwrt-x86-sgc_qemu-rootfs-ext4.img file. Where did you get that file from?
Also, you're specifying a disk device as the root filesystem for the kernel (root=/dev/sda) . This is wrong. You're suppose to specify a partition not a disk device. So you probably meant to say "root=/dev/sda1". It's safer to specify a UUID instead of a partition name (e.g. root=UUID=3552064b-7e4d-4e3a-ae48-943b333267d9 ) in case your root partition isn't actually /dev/sda1.
You can extract the UUID for your virtual root partition by creating loopback devices from your disk image:
losetup -P /dev/loop1 bin/x86/openwrt-x86-sgc_qemu-rootfs-ext4.img.
You should see new devices created called /dev/loop1p1 , /dev/loop1p2 , etc. Your virtual partition /dev/sda1 will be created as /dev/loop1p1, /dev/sda2 will be /dev/loop1p2 etc. You can then determine the UUID using parted or gparted on /dev/loop1
You may also need to specify something like "format=raw" in your qemu command, if the disk image is a raw disk image, or you may need to convert it first to a qcow2 image (qemu-image convert).

How to send network packets to a particular pci address?

I am working on a server that has multiple dual port NIC cards. Each port has a different address on the PCI bus.
I'm using nping to send packets through network interfaces given their logical names (such as eth0), but I want to be able to send packets through an interface given its PCI address (such as 0000:00:07.0). How can I achieve it ?
sudo lshw -C network gives:
*-network:0 UNCLAIMED
description: Ethernet controller
product: 82599ES 10-Gigabit SFI/SFP+ Network Connection
vendor: Intel Corporation
physical id: 0
bus info: pci#0000:01:00.0
version: 01
width: 64 bits
clock: 33MHz
capabilities: pm msi msix pciexpress vpd bus_master cap_list
configuration: latency=0
resources: memory:dfd20000-dfd3ffff ioport:8020(size=32) memory:dfd44000-dfd47fff memory:def00000-deffffff memory:dee00000-deefffff
You'll have to map the pci address to its logical name. Frankly, I've done that, but it seems that lshw does the trick.
Run sudo lshw -C network
You should get something like this (source):
*-network
description: Wireless interface
product: AR5212 802.11abg NIC
vendor: Atheros Communications, Inc.
physical id: 1
bus info: pci#03:00.0
logical name: ath0
version: 01
serial: 00:11:95:50:be:62
width: 32 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=ath_pci driverversion=0.9.6.0 (EXPERIMENTAL) ip=192.168.1.12 multicast=yes wireless=IEEE 802.11g
resources: iomemory:10800000-1080ffff irq:11
Here you have both the interface's name (logical name: ath0) and its bus info, including address (bus info: pci#03:00.0). Now all you have to do is to parse both, and lookup the logical name of the pci address that interests you.

Init process not found when booting with ramdisk as rootfs

I'm trying to setup a ramdisk for a setup I have with AT91SAM9261 and 2.6.30 kernel.
I know you would say why don't I use initramfs? I will use also that one, as of now I would like to check if I can boot with a ramdisk as rootfs.
I have already a root fs running fine on this system in jffs2 format.
I used below tutorial:
http://www.ibm.com/developerworks/library/l-initrd/
So I created the ramdisk directly on the embedded target, with 4MB size.
I used "dd" and "mkefs" and the ramdisk image works fine if I mount it as loop when rootfs is my jffs2.
I can browse mount_point and do stuff inside.
The content was created according to the section "Manually building initial RAM disk" in the above link.
In /dev I placed null and console, in /bin I copied busybox and created the links.
I set the execute attribute to init script as well, which works fine when I run it here (as loop device with jffs2 as rootfs)
In my kernel config I enabled ramdisk support as follows:
CONFIG_BLK_DEV_INITRD=y
CONFIG_RD_GZIP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
Using tftp I download the ramdisk image to 0x21100000.
At 0x20008000 I have the kernel uncompressed and at 0x22000000 the zImage copied.
However, I'm not able to boot successfully the system as it hangs when checking init process.
As I mentioned, I checked several times that my init can be executed,
I also used in the bootargs init=/bin/busybox or other scripts/binaries to check if any can be used as init.
Command line I use now:
bootargs=64M console=ttyS0,115200 root=/dev/ram0 rw
initrd=0x21100000,4194304 init=/init
For some I set ownership to "nobody" just to check if it makes any difference.
As it can be seen in the log output the ramdisk is mounted, but init fails.
It gives a warning to check the ext2 image, which I did before copying it and I have no error reported.
The tftp server is on Windows7. I though I might have some incompatibility if I copy the ramdisk image from linux to Windows then do tftp from Windows server.
So I copied the image again from Windows to linux, mounted it and checked if the FS reports any error and scripts can be executed - everything looks normal.
So I do have all files in place, attributes set, ramdisk is reported as being mounted ok as rootfs, but init cannot be found.
Uncompressing Linux......................................................................................................... done, booting the kernel.
Linux version 2.6.30-olimex (mishu#KubuntuVM) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #1 Mon Dec 29 13:53:54 CET 2014
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Olimex SAM9-L9261
Ignoring unrecognised tag 0x54410008
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: 64M console=ttyS0,115200 root=/dev/ram0 rw initrd=0x21100000,4194304 init=/init
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttyS0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 57384KB available (2924K code, 246K data, 132K init, 0K highmem)
Calibrating delay loop... 99.12 BogoMIPS (lpj=495616)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 716 bytes
NET: Registered protocol family 16
AT91: Power Management
AT91: Starting after user reset
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (junk in compressed archive); looks like an initrd
Freeing initrd memory: 4096K
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
msgmni has been set to 120
io scheduler noop registered
io scheduler anticipatory registered (default)
atmel_lcdfb atmel_lcdfb.0: backlight control is not available
atmel_lcdfb atmel_lcdfb.0: 225KiB frame buffer at 23140000 (mapped at ffc00000)
Console: switching to colour frame buffer device 40x30
atmel_lcdfb atmel_lcdfb.0: fb0: Atmel LCDC at 0x00600000 (mapped at c4866000), irq 21
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
brd: module loaded
loop: module loaded
ssc ssc.1: Atmel SSC device at 0xc4878000 (irq 15)
Driver 'sd' needs updating - please use bus_type methods
dm9000 Ethernet Driver, V1.31
eth0 (dm9000): not using net_device_ops yet
eth0: dm9000e at c486a000,c486e044 IRQ 107 MAC: 3a:1f:34:08:54:64 (chip)
NAND device: Manufacturer ID: 0xec, Chip ID: 0xdc (Samsung NAND 512MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 1478 at 0x00000b8c0000
Creating 2 MTD partitions on "atmel_nand":
0x000000000000-0x000000040000 : "Partition 1"
0x000000040000-0x000020000000 : "Partition 2"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffc8000 (irq 12)
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: AT91 OHCI
usb usb1: Manufacturer: Linux 2.6.30-olimex ohci_hcd
usb usb1: SerialNumber: at91
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
udc: at91_udc version 3 May 2006
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
mice: PS/2 mouse device common for all mice
input: gpio-keys as /class/input/input0
ads7846 spi0.2: touchscreen, irq 29
input: ADS784x Touchscreen as /class/input/input1
rtc-at91sam9 at91_rtt.0: rtc core: registered at91_rtt as rtc0
IRQ 1/rtc0: IRQF_DISABLED is not guaranteed on shared IRQs
rtc-at91sam9 at91_rtt.0: rtc0: SET TIME!
i2c /dev entries driver
i2c-gpio: probe of i2c-gpio failed with error -16
Registered led device: led1
Registered led device: led2
Registered led device: led3
Advanced Linux Sound Architecture Driver Version 1.0.20.
at73c213 spi0.3: at73c213: supported bitrate is 48500 (64 divider)
usb 1-1: new full speed USB device using at91_ohci and address 2
usb 1-1: New USB device found, idVendor=0457, idProduct=0151
usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=3
usb 1-1: Product: USB Mass Storage Device
usb 1-1: SerialNumber: 8d54bd8186b42c
usb 1-1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
ALSA device list:
#0: SAM9-L9261 external DAC on irq 15
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
rtc-at91sam9 at91_rtt.0: hctosys: unable to read the hardware clock
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 4096KiB [1 disk] into ram disk... done.
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing init memory: 132K
Failed to execute /init. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
[<c002f414>] (unwind_backtrace+0x0/0xdc) from [<c025bd34>] (panic+0x40/0x110)
[<c025bd34>] (panic+0x40/0x110) from [<c0029500>] (init_post+0xd0/0xf8)
[<c0029500>] (init_post+0xd0/0xf8) from [<c00085a0>] (kernel_init+0xbc/0xe4)
[<c00085a0>] (kernel_init+0xbc/0xe4) from [<c0041998>] (do_exit+0x0/0x5ac)
[<c0041998>] (do_exit+0x0/0x5ac) from [<00000001>] (0x1)
I plan to rebuild busybox and try again, but as my current ramdisk image works when I mount it as loop I don't have too much confidence it will change something.
I'm out of ideas. I've been trying the whole day to get this working.
Help is much appreciated.
Thanks.
Missing libraries were the root cause for the non-executable init placed on the ramdisk.
Using chroot turned out to be extremely useful. With this issue I learned how to use chroot and simulate a jail.
Another trick was to use user_debug=31 in the command line so that the kernel will output a message saying that the file is not found.
It looks like the "file not found" does not really point to a missing file, but to a failure to read the file system due to busybox not executing properly (missing libraries).
In parallel I have compiled dynamically the busybox 1.20.02 for my arm architecture and the ramdisk worked properly (without libs).
This user_debug=31 turned out to be again useful when I compiled and ran busybox, as it was also failing after mounting the ramdisk, but it thrown out an "undefined exception" which led me to a wrong "arch" value used for compiling busybox. After changing it everything was fine.

Goal is to pull the video driver version from the display information, then compare it to a list of versions supported

The text file has following information:
System Information
------------------
Time of this report: 5/22/2014, 14:20:52
Machine name: CONFERENCE13
Operating System: Windows 7 Professional 64-bit (6.1, Build 7601) Service Pac
k 1 (7601.win7sp1_gdr.140303-2144)
Language: English (Regional Setting: English)
System Manufacturer: Mario, Inc.
System Model: Mario Virtual Platform
BIOS: PhoenixBIOS 4.0 Release 6.0
Processor: Intel(R) Xeon(R) CPU E5-2680 0 # 2.70GHz (4 CPUs), ~2.7GHz
Memory: 2048MB RAM
Available OS Memory: 2048MB RAM
Page File: 1302MB used, 2792MB available
Windows Dir: C:\Windows
DirectX Version: DirectX 11
DX Setup Parameters: Not found
User DPI Setting: Using System DPI
System DPI Setting: 96 DPI (100 percent)
DWM DPI Scaling: Disabled
DxDiag Version: 6.01.7601.17514 32bit Unicode
------------
DxDiag Notes
------------
Display Tab 1: No problems found.
Sound Tab 1: No problems found.
Input Tab: No problems found.
--------------------
DirectX Debug Levels
--------------------
Direct3D: 0/4 (retail)
DirectDraw: 0/4 (retail)
DirectInput: 0/5 (retail)
DirectMusic: 0/5 (retail)
DirectPlay: 0/9 (retail)
DirectSound: 0/5 (retail)
DirectShow: 0/6 (retail)
---------------
Display Devices
---------------
Card name: Mario SVGA 3D
Manufacturer: Mario, Inc.
Chip type: Mario Virtual SVGA 3D Graphics Adapter
DAC type: n/a
Device Key: Enum\PCI\VEN_15AD&DEV_0405&SUBSYS_040515AD&REV_00
Display Memory: 223 MB
Dedicated Memory: 35 MB
Shared Memory: 188 MB
Current Mode: 1555 x 794 (32 bit) (60Hz)
Monitor Name: Generic Non-PnP Monitor
Monitor Model: unknown
Monitor Id:
Native Mode: unknown
Output Type: HD15
Driver Name: vm3dum64.dll,vm3dum,vm3dgl64.dll,vm3dgl
Driver File Version: 7.14.0001.2032 (English)
Driver Version: 7.14.1.2032
DDI Version: unknown
Driver Model: WDDM 1.0
Driver Attributes: Final Retail
Driver Date/Size: 2/11/2014 03:15:04, 258264 bytes
WHQL Logo'd: n/aWHQL Date Stamp: n/a
Device Identifier: {D7B71B4D-4745-11CF-ED71-0424A1C2CA35}
Vendor ID: 0x15AD
Device ID: 0x0405
SubSys ID: 0x040515AD
Revision ID: 0x0000
Driver Strong Name: oem13.inf:VMware.NTamd64.6.0:VM3D_AMD64:7.14.1.2032:pci\ven_15ad&dev_0405&subsys_040515ad&rev_00
Rank Of Driver: 00F60000
Video Accel:
Deinterlace Caps: n/a
D3D9 Overlay: n/a
DXVA-HD: n/a
DDraw Status: Not Available
D3D Status: Not Available
AGP Status: Not Available
-------------
Sound Devices
-------------
Description: Speakers (Mario Virtual Audio (DevTap))
Default Sound Playback: Yes
Default Voice Playback: Yes
Hardware ID: PNPB009
Manufacturer ID: 1
Product ID: 100
Type: WDM
Driver Name: vmwvaudio.sys
Driver Version: 6.00.0000.3800 (English)
Driver Attributes: Final Retail
WHQL Logo'd: n/a
Date and Size: 11/13/2013 21:22:16, 46672 bytes
Other Files:
Driver Provider: VMware
HW Accel Level: Basic
Cap Flags: 0x0
Min/Max Sample Rate: 0, 0
Static/Strm HW Mix Bufs: 0, 0
Static/Strm HW 3D Bufs: 0, 0
HW Memory: 0
Voice Management: No
EAX(tm) 2.0 Listen/Src: No, No
I3DL2(tm) Listen/Src: No, No
Sensaura(tm) ZoomFX(tm): No**
I am trying to pull card name and driver file version from the display devices and then compare with certain list as follow:
Windows XP Windows Vista Windows 7 Windows 8 Windows 8.1 Windows Server 2008 R2
View 3.1.3 build 252693
VMware SVGA II
Version: 11.6.0.35
Dated: 4/21/2010
VMware SVGA 3D
Version: 17.14.1.42
Dated: 4/21/2010
Not Supported Not Supported Not Supported Not Supported
View 4.0.2 build 294291
VMware SVGA II
Version: 11.6.0.35
Dated: 4/21/2010
Tried awk but is giving me some error, new to awk and bash need some help thank you.
awk 'BEGIN{
FS="="; OFS=" - "; DispalyDevices=""
}
function display(){
print displaydevices,cardname,driverfileversion
}
/DisplayDevices/{
if(cardname!="") display();
cardname=""; driverfileversion=""; display=$0;
gsub("Display.*PLAY"; "Display",display)
}
/cardname/{cardname=$2}
/driverfileversion/{driverfileversion=$2}
END{display}' dx_diag.txt | cat > dx_outputfile.txt
`**
The error is:
awk: syntax error at source line 1
Within this context:
BEGIN{FS="="; OFS=" - "; DispalyDevices=""}function display(){print displaydevices,cardname,driverfileversion}/DisplayDevices/{if(cardname!="") display(); cardname=""; driverfileversion=""; display=$0; >>> gsub("Display.*PLAY"; <<<
awk: illegal statement at source line 1
awk: illegal statement at source line 1**
change
gsub("Display.*PLAY"; "Display",display)
to
gsub("Display.*PLAY", "Display",display)
#-------------------^--- comma, not semi-colon
IHTH

Resources