Bug#403846: infos about losetup

DEMAINE Benoit-Pierre benoit at demaine.info
Wed Dec 20 21:23:25 UTC 2006


The system have been set up by building first the raid.1=sda+sdg, then 
partitioning md0; the advantage is that in case of big failure, it is 
possible to mount RO only one disk; if mounting RW, sync will be 
required. The advantage over standard raid+lvm is that partitions can be 
readed without bothering LVM, using any simple bootable system.

It requires to use offset for mkfs and mount stages: all commands take 
as argument the same device file: md0, but with various values for offset.

Thus, my strange fstab and kernel options:

kernel option:
/boot/vmlinuz-2 ro initrd= /boot/initrd.img-2 root=/dev/md0 
rootflags=offset=2564014080

fstab:
proc     /proc           proc    defaults                         0 0
/dev/md0 / ext3 defaults,errors=remount-ro,loop,offset=2564014080 0 0
/dev/md0 /boot           ext2    defaults,loop,offset=1000960     0 0

/dev/scd0 /media/cdrom0   udf,iso9660     user,noauto             0 0
/dev/md0  /mnt/extrd      ext3    defaults,loop,offset=6564020224 0 0

So, below, you will find the log when system tries to boot with the 
default initrd: it fails.

To get my system bootable, I "just" need to add to /etc/initramfs-tools/ 
the following files:
./scripts/dhp/libc-2.3.6.so
./scripts/dhp/libc.so.6.1
./scripts/dhp/losetup
./scripts/local-top/z.sh

and rebuild the RD with:
$ update-initramfs -u -t -k 2.6.18-3-alpha-smp

Libs and losetup are taken from "live system".

The main part of ./scripts/local-top/z.sh is:
/scripts/dhp/losetup -o 2564014080 /dev/loop6 /dev/md0
mount -o ro /dev/loop6 /root

If I just call
losetup -o 2564014080 /dev/loop6 /dev/md0
mount -o ro /dev/loop6 /root
then it fails (and this is why I know losetup in RD is broken).

(Yes I spent days rebuilding dozens or RD, and rebooting each of them; 
and rebooting an AS4100 takes *ages* !!!)

With my update, / get mounted, and boot process does find the init 
program and can start the main system. My system is now patched to work; 
problem is that Debian distributes incompleet softwares:
http://www.faqs.org/docs/Linux-HOWTO/BootPrompt-HOWTO.html#s3 clearly 
states that `rootflags=' is a legitimate argument for the kernel; so, I 
do consider that any argument that is valid for a pure kernel should 
also be valid for an initrd. In short, the concept of a fix is simple: 
read the rootflags value in the command line (available under 
/proc/cmdline quiet early while processing initrd scripts), and pass it 
to the mount command. Then, make sure that all tools are available in 
the ramdisk to support all options passable to mount, or at least the 
ones the kernel should normally understand.

***

Here come logs of serial port:
$ cat /dev/ttyS1 >a2
$ cat a2 | tr -d "\000\007" |sed s_^$'\x20'\$_REMOVETHISLINE_g |sed 
s_^\$_REMOVETHISLINE_g | grep -v "REMOVETHISLINE" |uniq |xclip

************************************************************ Begin

Linux version 2.6.18-3-alpha-smp (Debian 2.6.18-7) (waldi at debian.org) 
(gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)) #1 SMP Mon 
Dec 4 17:35:43 UTC 2006
Booting GENERIC on Rawhide variation Dodge using machine vector Rawhide 
from SRM
Major Options: SMP MAGIC_SYSRQ
Command line: ro  root=/dev/md0 rootflags=offset=2564014080 console=tty0 
console=ttyS1,9600n8
memcluster 0, usage 1, start        0, end      256
memcluster 1, usage 0, start      256, end   262139
memcluster 2, usage 1, start   262139, end   262144
freeing pages 256:2048
freeing pages 3147:262139
reserving pages 3147:3151
Initial ramdisk at: 0xfffffc007f76c000 (7898705 bytes)
4096K Bcache detected; load hit latency 31 cycles, load miss latency 121 
cycles
SMP: 2 CPUs probed -- cpu_present_map = 3
Built 1 zonelists.  Total pages: 262139
Kernel command line: ro  root=/dev/md0 rootflags=offset=2564014080 
console=tty0 console=ttyS1,9600n8
mcpcia_init_hoses: found 2 hoses
PID hash table entries: 4096 (order: 12, 32768 bytes)
HWRPB cycle frequency bogus.  Estimated 532828624 Hz
Using epoch = 2000
Turning on RTC interrupts.
Console: colour VGA+ 80x25
Dentry cache hash table entries: 262144 (order: 8, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 7, 1048576 bytes)
Memory: 2058056k/2097112k available (2106k kernel code, 36368k reserved, 
436k data, 448k init)
Security Framework v1.0.0 initialized
Capability LSM initialized
Mount-cache hash table entries: 512
SMP starting up secondaries.
Brought up 2 CPUs
SMP: Total of 2 processors activated (1818.09 BogoMIPS).
migration_cost=3906
checking if image is initramfs... it is
Freeing initrd memory: 7713k freed
NET: Registered protocol family 16
EISA bus registered
pci: enabling save/restore of SRM state
Linux Plug and Play Support v0.97 (c) Adam Belay
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 65536 (order: 6, 524288 bytes)
TCP established hash table entries: 262144 (order: 9, 4194304 bytes)
TCP bind hash table entries: 65536 (order: 7, 1048576 bytes)
TCP: Hash tables configured (established 262144 bind 65536)
TCP reno registered
No per-cpu room for modules.
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 8192 bytes)
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory 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 $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: PS/2 mouse device common for all mice
EISA: Probing bus 0 at 0000:00:01.0
EISA: Mainboard DEC6400 detected.
Cannot allocate resource for EISA slot 8
EISA: Detected 0 cards.
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 8
NET: Registered protocol family 20
Freeing unused kernel memory: 448k freed
ed kernelLoading, please wait...
  memory: 448k freed
ed kernelLoading, please wait...
  memory: 448k freed
ed kernelLoading, please wait...
  memory: 448k freed
ed kernelLoading, please wait...
  memory: 448k freed
input: AT Translated Set 2 keyboard as /class/input/input0
sym0: <810> rev 0x2 at pci 0001:01:01.0 irq 56
sym0: No NVRAM, ID 7, Fast-10, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.2.3
Begin: Loading essential drivers... ...
  memory: 448k freed
input: AT Translated Set 2 keyboard as /class/input/input0
sym0: <810> rev 0x2 at pci 0001:01:01.0 irq 56
sym0: No NVRAM, ID 7, Fast-10, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.2.3
Begin: Loading essential drivers... ...
  memory: 448k freed
   Vendor:
D
E
C
input: AT Tra nslated Set 2 ke  Model: yboard as /classR/input/input0
R
D
4
6
(
C
)
D
E
C
   Rev:
1
3
sym30: <810> rev 0x27 at pci 0001:01:
01.0 irq 56
   Type:   CD-ROM
                  ANSI SCSI revision: 02
  target0:0:5: Beginning Domain Validation
  target0:0:5: asynchronous
  target0:0:5: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 8)
  target0:0:5: Domain Validation skipping write tests
  target0:0:5: Ending Domain Validation
sym0: No NVRAM, ID 7, Fast-10, SE, parity checking
sym1: <875> rev 0x14 at pci 0001:01:04.0 irq 48
sym0: SCSI BUS has sym1: Symbios NVRAM, ID 7, Fast-20, HVD, parity checking
been reset.
sym1: open drain IRQ line driver, using on-chip SRAM
sym1: using LOAD/STORE-based firmware.
scsi0sym1: SCSI BUS has been reset.
  : sym-2.2.3
scsi1 : sym-2.2.3
sym2: <875> rev 0x14 at pci 0001:01:04.1 irq 49
sym2: Symbios NVRAM, ID 7, Fast-20, HVD, parity checking
sym2: open drain IRQ line driver, using on-chip SRAM
sym2: using LOAD/STORE-based firmware.
sym2: SCSI BUS has been reset.
scsi2 : sym-2.2.3
qla1280: QLA1040 found on PCI bus 0, dev 5
scsi(3:0): Resetting SCSI BUS
scsi3 : QLogic QLA1040 PCI to SCSI Host Adapter
        Firmware version:  7.65.06, Driver version 3.26
   Vendor: DEC       Model: RZ2DA-LA (C) DEC  Rev: N1H1
   Type:   Direct-Access                      ANSI SCSI revision: 02
scsi(3:0:0:0): Sync: period 10, offset 12, Wide
SCSI device sda: 17773524 512-byte hdwr sectors (9100 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write through w/ FUA
SCSI device sda: 17773524 512-byte hdwr sectors (9100 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write through w/ FUA
  sda: sda1 sda2 sda3 sda4 sda5
sd 3:0:0:0: Attached scsi disk sda
   Vendor: COMPAQ    Model: BB01811C9C        Rev: 3B05
   Type:   Direct-Access                      ANSI SCSI revision: 02
scsi(3:0:1:0): Sync: period 10, offset 12, Wide
SCSI device sdb: 35565080 512-byte hdwr sectors (18209 MB)
sdb: Write Protect is off
SCSI device sdb: drive cache: write through w/ FUA
SCSI device sdb: 35565080 512-byte hdwr sectors (18209 MB)
sdb: Write Protect is off
SCSI device sdb: drive cache: write through w/ FUA
  sdb: sdb1 sdb2 sdb3 sdb4
sd 3:0:1:0: Attached scsi disk sdb
   Vendor: IBM-PSG   Model: DPSS-318350M  F   Rev: S9AA
   Type:   Direct-Access                      ANSI SCSI revision: 03
scsi(3:0:2:0): Sync: period 10, offset 12, Wide
SCSI device sdc: 35548320 512-byte hdwr sectors (18201 MB)
sdc: Write Protect is off
SCSI device sdc: drive cache: write back
SCSI device sdc: 35548320 512-byte hdwr sectors (18201 MB)
sdc: Write Protect is off
SCSI device sdc: drive cache: write back
  sdc:
sd 3:0:2:0: Attached scsi disk sdc
   Vendor: DEC       Model: RZ1CB-CS (C) DEC  Rev: 0844
   Type:   Direct-Access                      ANSI SCSI revision: 02
scsi(3:0:3:0): Sync: period 10, offset 12, Wide
SCSI device sdd: 8380080 512-byte hdwr sectors (4291 MB)
sdd: Write Protect is off
SCSI device sdd: drive cache: write through w/ FUA
SCSI device sdd: 8380080 512-byte hdwr sectors (4291 MB)
sdd: Write Protect is off
SCSI device sdd: drive cache: write through w/ FUA
  sdd: sdd1 sdd2
sd 3:0:3:0: Attached scsi disk sdd
   Vendor: DEC       Model: RZ1CD-CS (C) DEC  Rev: 0306
   Type:   Direct-Access                      ANSI SCSI revision: 02
scsi(3:0:4:0): Sync: period 10, offset 12, Wide
SCSI device sde: 8380080 512-byte hdwr sectors (4291 MB)
sde: Write Protect is off
SCSI device sde: drive cache: write back w/ FUA
SCSI device sde: 8380080 512-byte hdwr sectors (4291 MB)
sde: Write Protect is off
SCSI device sde: drive cache: write back w/ FUA
  sde:
sd 3:0:4:0: Attached scsi disk sde
   Vendor: DEC       Model: RZ1CB-CS (C) DEC  Rev: 0844
   Type:   Direct-Access                      ANSI SCSI revision: 02
scsi(3:0:5:0): Sync: period 10, offset 12, Wide
SCSI device sdf: 8380080 512-byte hdwr sectors (4291 MB)
sdf: Write Protect is off
SCSI device sdf: drive cache: write through w/ FUA
SCSI device sdf: 8380080 512-byte hdwr sectors (4291 MB)
sdf: Write Protect is off
SCSI device sdf: drive cache: write through w/ FUA
  sdf: sdf1 sdf2 sdf3 sdf4 sdf5 sdf6 sdf7 sdf8 sdf9
sd 3:0:5:0: Attached scsi disk sdf
qla1280: QLA1040 found on PCI bus 1, dev 2
scsi(4:0): Resetting SCSI BUS
scsi4 : QLogic QLA1040 PCI to SCSI Host Adapter
        Firmware version:  7.65.06, Driver version 3.26
   Vendor: DEC       Model: RZ2DA-LA (C) DEC  Rev: N1H1
   Type:   Direct-Access                      ANSI SCSI revision: 02
scsi(4:0:0:0): Sync: period 10, offset 12, Wide
SCSI device sdg: 17773524 512-byte hdwr sectors (9100 MB)
sdg: Write Protect is off
SCSI device sdg: drive cache: write through w/ FUA
SCSI device sdg: 17773524 512-byte hdwr sectors (9100 MB)
sdg: Write Protect is off
SCSI device sdg: drive cache: write through w/ FUA
  sdg: sdg1 sdg2 sdg3 sdg4 sdg5
sd 4:0:0:0: Attached scsi disk sdg
   Vendor: SGI       Model: IBM DNES-318350Y  Rev: SA30
   Type:   Direct-Access                      ANSI SCSI revision: 03
scsi(4:0:1:0): Sync: period 10, offset 12, Wide
SCSI device sdh: 35563040 512-byte hdwr sectors (18208 MB)
sdh: Write Protect is off
SCSI device sdh: drive cache: write through
SCSI device sdh: 35563040 512-byte hdwr sectors (18208 MB)
sdh: Write Protect is off
SCSI device sdh: drive cache: write through
  sdh:
sd 4:0:1:0: Attached scsi disk sdh
   Vendor: SEAGATE   Model: ST318305LC        Rev: 2203
   Type:   Direct-Access                      ANSI SCSI revision: 03
scsi(4:0:2:0): Sync: period 10, offset 12, Wide
SCSI device sdi: 35566478 512-byte hdwr sectors (18210 MB)
sdi: Write Protect is off
SCSI device sdi: drive cache: write through w/ FUA
SCSI device sdi: 35566478 512-byte hdwr sectors (18210 MB)
sdi: Write Protect is off
SCSI device sdi: drive cache: write through w/ FUA
  sdi:
sd 4:0:2:0: Attached scsi disk sdi
   Vendor: DEC       Model: RZ1CB-CS (C) DEC  Rev: 0844
   Type:   Direct-Access                      ANSI SCSI revision: 02
scsi(4:0:3:0): Sync: period 10, offset 12, Wide
SCSI device sdj: 8380080 512-byte hdwr sectors (4291 MB)
sdj: Write Protect is off
SCSI device sdj: drive cache: write through w/ FUA
SCSI device sdj: 8380080 512-byte hdwr sectors (4291 MB)
sdj: Write Protect is off
SCSI device sdj: drive cache: write through w/ FUA
  sdj: unknown partition table
sd 4:0:3:0: Attached scsi disk sdj
   Vendor: DEC       Model: RZ1CB-CS (C) DEC  Rev: 0844
   Type:   Direct-Access                      ANSI SCSI revision: 02
scsi(4:0:4:0): Sync: period 10, offset 12, Wide
SCSI device sdk: 8380080 512-byte hdwr sectors (4291 MB)
sdk: Write Protect is off
SCSI device sdk: drive cache: write through w/ FUA
SCSI device sdk: 8380080 512-byte hdwr sectors (4291 MB)
sdk: Write Protect is off
SCSI device sdk: drive cache: write through w/ FUA
  sdk: unknown partition table
sd 4:0:4:0: Attached scsi disk sdk
   Vendor: DEC       Model: RZ1CB-CA (C) DEC  Rev: LYJ0
   Type:   Direct-Access                      ANSI SCSI revision: 02
scsi(4:0:5:0): Sync: period 10, offset 12, Wide
SCSI device sdl: 8380080 512-byte hdwr sectors (4291 MB)
sdl: Write Protect is off
SCSI device sdl: drive cache: write through w/ FUA
SCSI device sdl: 8380080 512-byte hdwr sectors (4291 MB)
sdl: Write Protect is off
SCSI device sdl: drive cache: write through w/ FUA
  sdl: unknown partition table
sd 4:0:5:0: Attached scsi disk sdl
loop: loaded (max 8 devices)
md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: bitmap version 4.39
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
raid5: measuring checksumming speed
    8regs     :   507.904 MB/sec
    32regs    :  1105.920 MB/sec
    alpha     :  1302.528 MB/sec
    alpha prefetch:  1589.248 MB/sec
raid5: using function: alpha prefetch (1589.248 MB/sec)
raid6: int64x1    160 MB/s
raid6: int64x2    268 MB/s
raid6: int64x4    324 MB/s
raid6: int64x8    264 MB/s
raid6: using algorithm int64x4 (324 MB/s)
md: raid6 personality registered for level 6
md: raid5 personality registered for level 5
md: raid4 personality registered for level 4
Done.
Begin: Running /scripts/init-premount ...
3c59x: Donald Becker and others. www.scyld.com/network/vortex.html
0000:00:03.0: 3Com PCI 3c905B Cyclone 100baseTx at fffffcf902241000.
Linux Tulip driver version 1.1.13-NAPI (May 11, 2002)
tulip0:  EEPROM default media type Autosense.
tulip0:  Index #0 - Media MII (#11) described by a 21140 MII PHY (1) block.
tulip0:  MII transceiver #5 config 0000 status 7809 advertising 01e1.
eth1: Digital DS21140 Tulip rev 34 at fffffcfb80009000, 
00:00:F8:10:48:36, IRQ 44.
Done.
Begin: Mounting root file system... ...
Begin: Running /scripts/local-top ...

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
md0 stopped.
Begin: Loading MD modules ...
Success: loaded module raid1.
Done.
Begin: Assembling MD array /dev/md0 ...
md: bind<sdg>
md: bind<sda>
raid1: raid set md0 active with 2 out of 2 mirrors
mdadm: /dev/md0 has been started with 2 drives.
Success: started /dev/md0
Done.
device-mapper: ioctl: 4.7.0-ioctl (2006-06-24) initialised: 
dm-devel at redhat.com
Done.
/dev/md0: unknown volume type
Begin: Running /scripts/local-premount ...
Done.
mount: Mounting /dev/md0 on /root failed: No such device
Begin: Running /scripts/local-bottom ...
Done.
Begin: Running /scripts/init-bottom ...
mount: Mounting /root/dev on /dev/.static/dev failed: No such file or 
directory
Done.
mount: Mounting /sys on /root/sys failed: No such file or directory
mount: Mounting /proc on /root/proc failed: No such file or directory
Target filesystem doesn't have /sbin/init
BusyBox v1.1.3 (Debian 1:1.1.3-3) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
/bin/sh: can't access tty; job control turned off
(initramfs) ed kernel memory: 448k freed
/bin/sh: ed: not found
(initramfs)
(initramfs) ed kernelLoading, please wait...
/bin/sh: ed: not found
(initramfs)
(initramfs)  memory: 448k freed
/bin/sh: memory:: not found
(initramfs)

************************************************************ END

at the end, there are some side effect of busybox prompt with serial 
line; some "memory" problems are inherent to my architecture.

-- 
  >o_/ DEMAINE Benoit-Pierre (aka DoubleHP) http://benoit.demaine.info/
If computing were an exact science, IT engineers would not havework \_o<

"So all that's left, Is the proof that love's not only blind but deaf."
(FAKE TALES OF SAN FRANCISCO, Arctic Monkeys)




More information about the pkg-mdadm-devel mailing list