5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post Reply
rirazvan
Posts: 5
Joined: Tue Jan 03, 2012 2:15 pm

5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post by rirazvan » Tue Jan 03, 2012 2:30 pm

Hello everyone,

I am trying to install a set of two new disks in Lacie 5big Network ( first version), after writing the image on one disk I have the following error:

===INITRAMFS: Product ID = '5Big'
===INITRAMFS: minRaidDevices=4
===INITRAMFS: maxRaidDevices=5
===INITRAMFS: Waiting for the master disk to spin up
===INITRAMFS: Waiting for 1 to 1 disks to spin up
===INITRAMFS: We finally have 1 disks, updating /dev
===INITRAMFS: Found available BootFS partition: /dev/sdc7
===INITRAMFS: Normal boot, starting bootfs system array
mdadm: No md superblock detected on /dev/sdc7.
===INITRAMFS: Device '/dev/sdc7' is not valid. Select another one.
mdadm: No md superblock detected on /dev/sdc7.
===INITRAMFS: Device '/dev/sdc7' is not valid too. Select next one.
===INITRAMFS: Warning: No valid device for this product. A claim is necessary...

===INITRAMFS: =========FIND AND CLAIM A COMPATIBLE DEVICE=========
===INITRAMFS: Signature for device '/dev/sdc' = 'LaCieFirstBootLaCie'
===INITRAMFS: Device '/dev/sdc' has not a good signature : REJECTED
===INITRAMFS: No valid bootfs found!

I also try with Lacie recovery mode and the loader clanged the image on the hdd with the one contained in the file "capsule-5Big-upgrade-2.2.3-r1802"
The only difference was the signature has been modified by the recovery file to:

===INITRAMFS: Signature for device '/dev/sdc' = 'FAN FirstBootLaCie'
===INITRAMFS: Device '/dev/sdc' has not a good signature : REJECTED
===INITRAMFS: No valid bootfs found!

I do not have any Lacie original HDD.

I do not understand why the " fresh disk signature" is not accepted.

Any idea would be great to try.

Thank you,
Razvan

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: 5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post by Mijzelf » Tue Jan 03, 2012 3:47 pm

The problem starts earlier.
From the initramfs init:

Code: Select all

   # Handle the case of a RAID system
    #==================================
    if [ `isRaidRequired` -eq $TRUE ]; then

        # Handle first boot
        #===================
        if [ $firstBoot -eq $TRUE ]; then
            debug_msg "First boot. Creating bootfs system array with $bootPartition"
            createBootfsArray $bootPartition

        # Handle normal boot
        #====================
        else
            debug_msg "Normal boot, starting bootfs system array"
So your output 'Normal boot, starting bootfs system array' shouldn't be there. How did you terminate the string? 'LaCieFirstBootLaCie' is 19 characters, but it's checked for 20 characters.

Code: Select all

firstboot_signature="LaCieFirstBootLaCie"
firstboot_signature_device="/dev/sda"
firstboot_signature_offset=1536
firstboot_signature_size=20
I *think* the 20th character should be a \n. (0x0A).

BTW, I don't think you will get the box running this way. I *think* on a first boot there need to be 5 disks.

rirazvan
Posts: 5
Joined: Tue Jan 03, 2012 2:15 pm

Re: 5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post by rirazvan » Wed Jan 04, 2012 9:03 am

Hello,
Thank you for the answer. If I am installing the fresh disk in bay number 3 and another disk in bay 1 the unit is pass trough disk verification to signature verification.
Waiting for 1 to 1 disks to spin up
===INITRAMFS: We finally have 1 disks, updating /dev
===INITRAMFS: Found available BootFS partition: /dev/sdc7

If the disks are installed in other bay the unit waits to have minimum four disk before passing to bootfs.
In the meantime I applied the capsule recovery file to the disk.

I will change the signature to 20 characters.

Razvan

rirazvan
Posts: 5
Joined: Tue Jan 03, 2012 2:15 pm

Re: 5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post by rirazvan » Wed Jan 04, 2012 10:21 am

It seems that the signature stored in eeprom as UUID for disk 4 ( bay 3) on my unit is :

# /sbin/md_eeprog -g /dev/md4
07f72892:4743f3f6:cdfc5109:3c757632

and the signature written on the hdd by lacie soft is :
===INITRAMFS: Signature for device '/dev/sdc' = 'FAN FirstBootLaCie'

I did try to change the boot signature using Lacie internal BusyBox:

BusyBox v1.9.2 (2009-04-09 16:01:34 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

# echo "LaCieFirstBootLaCie\n" | dd bs=1 skip=1536 of=/dev/sdc
0+0 records in
0+0 records out

It seems that the boot signature remains unchanged after command :

===INITRAMFS: =========FIND AND CLAIM A COMPATIBLE DEVICE=========
===INITRAMFS: Signature for device '/dev/sdc' = 'FAN FirstBootLaCie'
===INITRAMFS: Device '/dev/sdc' has not a good signature : REJECTED
===INITRAMFS: No valid bootfs found!

Is there another way to change the signature without any external Linux PC?
Thank you,
Razvan

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: 5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post by Mijzelf » Wed Jan 04, 2012 6:43 pm

Those signatures are different beasts. The signature in eeprom is the UUID of the RAID array. I *think* this is used to check which disk is the 'real one' when you exchange one.
The signature checked by initramfs is some string which is used to determine if it's a first boot.

The firmware uses this code to write a signature:

Code: Select all

            # Write the signature
            #--------------------
              echo -n "$l_signature" \
            | dd if=/dev/stdin       \
                 of=$l_device        \
                 bs=1                \
                 seek=$l_offset      \
                 count=$l_size       \
                 > /dev/null 2>&1
0+0 records in
This is wrong, I think. It shouldn't be 0. Maybe the 'dd' is broken? The firmware code uses 'if=/dev/stdin'.

rirazvan
Posts: 5
Joined: Tue Jan 03, 2012 2:15 pm

Re: 5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post by rirazvan » Wed Jan 04, 2012 8:21 pm

Hello,

So the syntax " # echo "LaCieFirstBootLaCie\n" | dd bs=1 skip=1536 of=/dev/sdc" would be the correct one to wrote the signature LaCieFirstBootLaCie for the first boot check?

I do not intend to use raid on my unit, I only need to create a media server. Because of that I will try at the beginning to use only one 1.5TB ST disk . If it is not working I will buy another 4x 500GB disks

Thank you,
Razvan

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: 5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post by Mijzelf » Thu Jan 05, 2012 1:27 pm

No. You used skip, and it should be seek.

But it would write the wrong string, I think. Lacie uses 'echo -n identifier', the -n means that echo won't output the trailing newline. So on second thought I think '\n' (newline) shouldn't be added (BTW, you need to add -e to let echo interpret \n).
Instead Lacie adds a count of 20. Don't know what trailer that will give. Maybe a zero.

So the command could be

Code: Select all

echo -n "LaCieFirstBootLaCie" | dd if=/dev/stdin bs=1 seek=1536 count=20 of=/dev/sdc

rirazvan
Posts: 5
Joined: Tue Jan 03, 2012 2:15 pm

Re: 5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post by rirazvan » Tue Jan 10, 2012 8:12 am

Hello again,

Issued "echo -n "LaCieFirstBootLaCie" | dd if=/dev/stdin bs=1 seek=1536 count=20 of=/dev/sdc"

reeing init memory: 356K
===INITRAMFS: =======================================INITRAMFS================================
===INITRAMFS: Initializing filesystem
===INITRAMFS: Mounting /proc
===INITRAMFS: Mounting /sys
===INITRAMFS: Populating /dev
===INITRAMFS: Mounting /dev/pts
===INITRAMFS: Product ID = '5Big'
===INITRAMFS: minRaidDevices=4
===INITRAMFS: maxRaidDevices=5
===INITRAMFS: Waiting for the master disk to spin up
===INITRAMFS: Waiting for 1 to 1 disks to spin up
===INITRAMFS: We finally have 3 disks, updating /dev
===INITRAMFS: Found available BootFS partition: /dev/sdc7
===INITRAMFS: Normal boot, starting bootfs system array
===INITRAMFS: Device '/dev/sdc7' is not valid. Select another one.
===INITRAMFS: Device '' is not valid too. Select next one.
===INITRAMFS: Device '' is not valid too. Select next one.
===INITRAMFS: Device '/dev/sdc7' is not valid too. Select next one.
===INITRAMFS: Warning: No valid device for this product. A claim is necessary...
===INITRAMFS: =========FIND AND CLAIM A COMPATIBLE DEVICE=========
===INITRAMFS: Signature for device '/dev/sda' = ''
===INITRAMFS: Device '/dev/sda' has not a good signature : REJECTED
===INITRAMFS: Signature for device '/dev/sdb' = ''
===INITRAMFS: Device '/dev/sdb' has not a good signature : REJECTED
===INITRAMFS: Signature for device '/dev/sdc' = 'LaCieFirstBootLaCie'
===INITRAMFS: Device '/dev/sdc' has not a good signature : REJECTED
===INITRAMFS: No valid bootfs found!


BusyBox v1.9.2 (2010-10-18 13:09:24 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.

I relay do not understand why it rejects the signature.

Thank you,
Razvan

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: 5Big Network fresh disk signature "LaCieFirstBootLaCie"

Post by Mijzelf » Tue Jan 10, 2012 9:48 am

It's not necessarily /dev/sdc which is checked.

From initramfs/init:

Code: Select all

    # Check the first disk to see if we are in the first boot
    #=========================================================
    firstDisk="`getAvailableDisks | head -n 1`"
    firstBoot=`isFirstBoot $firstDisk`

<snip>

    # Get the first available bootfs partition
    #==========================================
    bootPartition=`getFirstAvailableBootPartition`
    if [ -z "$bootPartition" ]; then
        fallback "FATAL: Failed to find a BootFS partition"
    else
        debug_msg "Found available BootFS partition: $bootPartition"
    fi

Code: Select all

#==============================================================================
# getFirstAvailableBootPartition: returns the first available boot partition
#==============================================================================
getFirstAvailableBootPartition()
{
    local l_firstBootPart=""

    # Get the first boot partition by asking for the next one but without
    # previous reference.
    #--------------------------
    l_firstBootPart=`getNextBootPartition`

    echo $l_firstBootPart
}

#==============================================================================
# getNextBootPartition: returns the next boot partition after the one given as
# a parameter
#
# $1 : [OPTIONAL] Reference boot partition whose root device should be present
#      before the next one hosting the next boot partition.
#==============================================================================
getNextBootPartition()
{
    local l_refBootPart="$1"
    local l_refDev
    local l_nextBootDev
    local l_nextBootPart

    # Check if a reference boot partition has been provided
    if [ -z "$l_refBootPart" ]; then
        # Get the first boot device
        #--------------------------
        l_nextBootDev=`getFirstAvailableBootDevice`
    else

Code: Select all

#=====================================================================
# getFirstAvailableBootDevice: returns the first available boot device
#=====================================================================
getFirstAvailableBootDevice()
{
    local l_bootDevice
    local l_foundValidBoot
    local l_disk

    # Get the root value given in the boot command line
    #--------------------------------------------------

    #-----------------------------------------------------------------------------
    # N.B.: The boot device should be declared in argument 'bootdev'. In case this
    #       field is missing, the field 'root' is used but without the partition
    #       number.
    #-----------------------------------------------------------------------------

    l_bootDevice=`cat /proc/cmdline | sed -n -e "s/.*bootdev=\([a-zA-Z0-9\/]\+\).*/\1/p"`
    if [ -z "$l_bootDevice" ]
    then
        l_bootDevice=`cat /proc/cmdline | sed -n -e "s/.*root=\([a-zA-Z\/]\+\)[0-9]*.*/\1/p"`
    fi

    # If this device if invalid (missing disk), we try to find a valid one
    # on the available disks

Code: Select all

#==============================================================================
# getAvailableDisks: returns the list of available disks on the system
#
# $1 : (optional) A boolean value indicating if the output must be flatten.
#==============================================================================
getAvailableDisks()
{
    local l_flattenOpt

    if [ -n "$1" -a "$1" -eq "$TRUE" ]
    then
        l_flattenOpt="-n"
    else
        l_flattenOpt=""
    fi

    cat /proc/partitions \
        | grep "sd[a-z]$" \
        | sed -e "s/^.* \(sd[a-z]\)$/\/dev\/\1/" \
        2> /dev/null \
        | ( while read S; do echo $l_flattenOpt "$S "; done) \
        | sort
}
So the boot device is dictated by the cmdline, while the first boot signature is tested on the first disk showing up in /proc/partitions (or maybe the last. I cannot really decode the getAvailableDisks() function)

Post Reply