D2 Network 2 esata support

Re: D2 Network telnet refused.

Postby Aled72 » Fri Feb 16, 2018 3:35 pm

esata case:
Code: Select all
root@BackupNas:/ # /etc/api/nasapi.php "mrvlGetDisk high all"
Array
(
    [0] => Array
        (
            [diskid] => JK1105B8GYG4VX
            [name] => sda
            [blockdev] => /dev/sda
            [isusb] => 0
            [isformated] => 1
            [isinternal] => 1
            [issystem] => 1
            [totalsize] => 1860.24
            [freesize] => 0
            [table] => gpt
            [partitions] => Array
                (
                    [0] => Array
                        (
                            [size] => 1860.24909163
                            [volid] => 1000
                            [color] => #9d773e
                            [lvname] => /dev/sda8
                        )

                )

        )

)
root@BackupNas:/ # /etc/api/nasapi.php "mrvlGetVolume high all"
Array
(
    [0] => Array
        (
            [volid] => 1000
            [totalsize] => 1860.24909163
            [freesize] => 1812.2517128
            [usedsize] => 47.9973788309
            [name] => Default
            [md] => /dev/sda8
            [color] => #9d773e
            [formatting] => 0
            [status] => active
            [busy] => 0
            [raidtype] => single
            [devices] =>
        )

)
root@BackupNas:/ # echo > /var/log/messages
root@BackupNas:/ # debugon
root@BackupNas:/ # debugoff
root@BackupNas:/ # cat /var/log/messages

Feb 16 16:31:39 BackupNas syslog.info syslogd started: BusyBox v1.21.0
Feb 16 16:34:04 BackupNas syslog.info syslogd exiting
root@BackupNas:/ #
Aled72
Donator VIP
Donator VIP
 
Posts: 73
Joined: Sun Feb 04, 2018 3:27 pm

Re: D2 Network telnet refused.

Postby Aled72 » Fri Feb 16, 2018 3:42 pm

USB case:
Code: Select all
root@BackupNas:/ # /etc/api/nasapi.php "mrvlGetDisk high all"               
Array                                                                       
(                                                                           
    [0] => Array                                                             
        (                                                                   
            [diskid] => JK1105B8GYG4VX                                       
            [name] => sda                                                   
            [blockdev] => /dev/sda                                           
            [isusb] => 0                                                     
            [isformated] => 1                                               
            [isinternal] => 1                                               
            [issystem] => 1                                                 
            [totalsize] => 1860.24                                           
            [freesize] => 0                                                 
            [table] => gpt                                                   
            [partitions] => Array                                           
                (                                                           
                    [0] => Array                                             
                        (                                                   
                            [size] => 1860.24909163                         
                            [volid] => 1000                                 
                            [color] => #9d773e                               
                            [lvname] => /dev/sda8                           
                        )                                                   
                                                                             
                )                                                           
                                                                             
        )                                                                   
                                                                             
    [1] => Array                                                             
        (                                                                   
            [diskid] => 00D04BA71808948A-0:0_LaCie_d2_quadra                 
            [name] => USB-B                                                 
            [blockdev] => /dev/sdb                                           
            [isusb] => 1                                                     
            [isformated] => 1                                               
            [isinternal] => 1                                               
            [issystem] => 0                                                 
            [totalsize] => 1863.01                                           
            [freesize] => 0                                                 
            [table] => gpt                                                   
            [partitions] => Array                                           
                (                                                           
                    [0] => Array                                             
                        (                                                   
                            [size] => 1863.01471663                         
                            [volid] => 2000                                 
                            [color] => #a1503c
                            [lvname] => /dev/sdb1
                        )

                )

        )

)
root@BackupNas:/ # /etc/api/nasapi.php "mrvlGetVolume high all"
Array
(
    [0] => Array
        (
            [volid] => 1000
            [totalsize] => 1860.24909163
            [freesize] => 1812.2517128
            [usedsize] => 47.9973788309
            [name] => Default
            [md] => /dev/sda8
            [color] => #9d773e
            [formatting] => 0
            [status] => active
            [busy] => 0
            [raidtype] => single
            [devices] =>
        )

    [1] => Array
        (
            [volid] => 2000
            [totalsize] => 1863.01471663
            [freesize] => 1814.94458389
            [usedsize] => 48.0701327372
            [name] => USB-B-1
            [md] => /dev/sdb1
            [color] => #a1503c
            [formatting] => 0
            [status] => active
            [busy] => 0
            [raidtype] => single
            [devices] =>
        )

)
root@BackupNas:/ # usb_id -x /block/sdb|tr "\n" " "|awk -F '[ =]' '{print $10"-"$14"_"$2"_"$4}'
00D04BA71808948A-0:0_LaCie_d2_quadra
root@BackupNas:/ #
Aled72
Donator VIP
Donator VIP
 
Posts: 73
Joined: Sun Feb 04, 2018 3:27 pm

Re: D2 Network telnet refused.

Postby Jocko » Fri Feb 16, 2018 3:56 pm

:mrgreen:Please to use bbcode when you paste some output! See the difference... :mrgreen:
Jocko wrote:root@BackupNas:/ # debugon
root@BackupNas:/ # debugoff
So there is an issue with the udev rules. Need to deepen this

About usb case, it seems the disk id builds by the script is the same as this one saved in the nas database.

You should have some files in /etc/.setup.fs, so
Code: Select all
cat /etc/.setup.fs/setupjob.log
cat /etc/.setup.fs/makeraid.sh
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: D2 Network telnet refused.

Postby Aled72 » Fri Feb 16, 2018 4:19 pm

Code: Select all
root@BackupNas:/ # cat /etc/.setup.fs/setupjob.log                           
<b>Setup task makeraid.sh is now running</b><br>                             
Found disk: sda(JK1105B8GYG4VX) <br>                                         
<span style="color:red;"><b>serial number does not match the expected device : sdb</b></span><br>                                                         
<br><span style="color:red;">NAS restarting on user's request</span><br>     
Restore the regular boot mode...<br>                                         
OK<br></span>                                                               
NAS is restarting...OK<br>                                                   
root@BackupNas:/ # cat /etc/.setup.fs/makeraid.sh                           
#!/bin/sh                                                                   
                                                                             
# Jocko : version 1.3 19/01/2017                                             
                                                                             
. /etc/.setup.fs/setupjob.ini                                               
. /etc/.setup.fs/dic_setup.ini                                               
                                                                             
LOG=/etc/.setup.fs/setupjob.log                                             
                                                                             
stopjob(){                                                                   
 stop=$(date '+%s')                                                         
 [ -n "$1" ] && error=$@ || error=                                           
 sed -rie "s/.*(stop=).*/\1$stop/g;s/.*(status=).*/\1$status/g;s/.*(error=).*/\1\"$error\"/g" /etc/.setup.fs/setupjob.ini                                 
 [ $status -eq 3 ] && echo '<span style="color:red;"><b>'$@'</b></span><br>'>> $LOG                                                                       
}                                                                           
                                                                             
check_mode(){                                                               
 if ps x -o cmd|grep -v grep|grep -c noflushd > /dev/null                   
 then                                                                       
  status=3                                                                   
  stopjob 'setup mode is not available !'                                   
  exit 1                                                                     
 fi                                                                         
}                                                                           
                                                                             
unlink /rw_fs/tmp/setup 2>/dev/null                                         
check_mode                                                                   
                                                                             
status=0                                                                     
stop=                                                                       
error=                                                                       
                                                                             
if [ -z "$start" ] || [ $start -eq 0 ]                                       
then                                                                         
 start=$(date '+%s')                                                         
 sed -rie "s/.*(start=).*/\1$start/g;s/.*(stop=).*/\1$stop/g;s/.*(status=).*/\1$status/g" /etc/.setup.fs/setupjob.ini
 echo -e '<b>'$task_start"</b><br>"> $LOG
else
 echo -e '<br><b>'$task_restart"</b><br>">> $LOG
 sed -rie "s/.*(stop=).*/\1$stop/g;s/.*(status=).*/\1$status/g" /etc/.setup.fs/setupjob.ini
fi

if [ -f /etc/.setup.fs/check_disk ]
then
 . /etc/.setup.fs/check_disk 'sda,JK1105B8GYG4VX,0 sdb,00D04BA71808948A-0:0_LaCie_d2_quadra,0 '

 if [ -e '/etc/.setup.fs/set_raid' ]
 then
  src=$(readlink -f '/etc/.setup.fs/set_raid')
  . $src "level=raid1;nbdev=2;members='/dev/sda8 /dev/sdb1';md=/dev/md0"
  unlink "$src"
 fi
 sleep 1
 if [ -e '/etc/.setup.fs/set_fs' ]
 then
  src=$(readlink -f '/etc/.setup.fs/set_fs')
  . $src md0 ext4 Raid
  unlink "$src"
 fi
 if [ -e '/etc/.setup.fs/set_partid.0' ]
 then
  src=$(readlink -f '/etc/.setup.fs/set_partid.0')
  . $src sda8
  unlink "$src"
 fi
 if [ -e '/etc/.setup.fs/set_partid.1' ]
 then
  src=$(readlink -f '/etc/.setup.fs/set_partid.1')
  . $src sdb1
  unlink "$src"
 fi
 status=1
 stopjob
 echo '<b>'$task_end'</b><br>'>> $LOG
 # unlink "$0"
 /etc/leds_switch off
 sleep 5
 /etc/leds_bootup
else
 status=3
 stopjob $err_missing_info
fi
root@BackupNas:/ #



Yes, is better with code :thumbup
Aled72
Donator VIP
Donator VIP
 
Posts: 73
Joined: Sun Feb 04, 2018 3:27 pm

Re: D2 Network 2 telnet refused.

Postby Jocko » Fri Feb 16, 2018 8:26 pm

So I found where is the issue when you make a raid with usb disk.

In make raid shell script, the usb disk is not handled like an usb disk and then the script checks badly their diskid. I need to test my changes before sending some new files (it seems we did not included the last version of some files in firmware version)

About esata, I understood why udev rule does not run on add event. With your kernel version, their kernel device name is /dev/sd[a-z] instead of /dev/se[a-z].
So a new compile must be done. I found also errors with your platform type, I need to write some additional code lines.
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: D2 Network telnet refused.

Postby Aled72 » Fri Feb 16, 2018 8:38 pm

Many thanks for help. ;)
Aled72
Donator VIP
Donator VIP
 
Posts: 73
Joined: Sun Feb 04, 2018 3:27 pm

Re: D2 Network 2 telnet refused.

Postby Jocko » Fri Feb 16, 2018 9:31 pm

So I fixed the issue with usb disk:
Here my try to make a raid with sda and an usb disk (sek) :
Code: Select all
<b>Setup task makeraid.sh is now running</b><br>
Found disk: sda(WD-WMAM9HA06840) <br>
Found disk: sek(6352FFFFFFFF-0:0_ST380815_AS) <br>
Create raid device md1<br>=>OK: md1 created (raid1)
Format partition md1 with file system ext4: <br>
=>mke2fs 1.43.4 (31-Jan-2017)
Creating filesystem with 18715696 4k blocks and 4685824 inodes
Filesystem UUID: 66404470-6f62-4e28-aac1-5fd031faea99
Superblock backups stored on blocks:
   32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
   4096000, 7962624, 11239424

Allocating group tables:   done                           
Writing inode tables:   done                           
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information:   done

set label on the data volume successful (ESSAI)
=>Formatting md1 succeeded<br>
Update partition type on sda8:fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
 OK<br>
Remove orphan shares: OK<br>
Update partition type on sek1:fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
 OK<br>
Remove orphan shares: OK<br>
<b>Setup task makeraid.sh is ended</b><br>
<br><span style="color:red;">NAS restarting on user's request</span><br>
Restore the regular boot mode...<br>
OK<br></span>
NAS is restarting...OK<br>
and then in web-interface raid1 volume is available
mix-usb-raid.jpg


So put the tar file in the share 'fvdw' (create it if it does not exist yet) that I go to send you on your pm,
open a shell terminal and do
Code: Select all
tar -xf /direct-usb/fvdw/fvdw-sl-17-0-usb-diskid-fix-16feb18.tar.gz -C /

Then if you try to create the raid you should have no longer issue.

Next step : fix the esata issue. I need to talk with fvdw (as he should compile a new kernel)
You do not have the required permissions to view the files attached to this post.
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: D2 Network 2 telnet refused.

Postby Jocko » Sat Feb 17, 2018 12:51 am

Additional output for fixing esata issue,
can you post when you have your disk plugged in the esata port, this command
Code: Select all
 udevadm info -a -p /sys/class/block/sdb
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: D2 Network 2 telnet refused.

Postby fvdw » Sat Feb 17, 2018 8:22 am

@Aled72. Seems we need to adapt the kernel to get correct name assignment of esata disk. For this I need some information on the sata driver host and bust numbers used on this device.
Would it be possible to post output of the command
Code: Select all
dmesg

For two situations.
1. with only internal disk installed an no esata disk connected
2. With internal and esata disk connected

Thks
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: D2 Network 2 telnet refused.

Postby Jocko » Sat Feb 17, 2018 10:14 am

Hi Aled72,

on the user land, I fixed the issue to restore esata support but to get it you need to wait the new kernel version that fvdw is compiling.

To update the firmware, use the same way, store the 2d tar file in the share 'fvdw' that I go to send you on your pm,
open a shell terminal and do
Code: Select all
tar -xf /direct-usb/fvdw/fvdw-sl-17-x-esata-raidusb-fix-17feb18.tar.gz -C /

and wait the new kernel.
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

PreviousNext

Return to Lacie D2 network vs2

Who is online

Users browsing this forum: No registered users and 3 guests