Jump to content
XPEnology Community

Cannot migrate data after building new 6.2 VM


SirIanthe3rd

Recommended Posts

Hello all, I've been trying to migrate to a new version of Xpenology and after giving up on migrating the existing one, I went ahead and built a new server on Jun's 1.03b loader with DSM 3615 6.2.3. I'm running this on ESXi 6.7.

 

i7-3770, 16Gb RAM, in a U-NAS case.

 

I was able to get it up and running just fine without my LSI 9211-8i attached, but when I attach it and then go to migrate data, I get the dreaded corrupt file 13 error. I read that this is an issue with the PID and VID of a USB stick, but I don't have one in this case. I've tried multiple versions of DSM.

 

What am I doing wrong?

Link to comment
Share on other sites

I think I understand that you are saying you built up a new loader and a test VM under ESXi on 6.2.3.  If you were able to do that successfully, you override the loader default during bootup, or used an ISO that already had the "third" grub entry (ESXi) selected.

 

Now I think you are trying to apply a new, clean 1.03b loader on your VM for migration, and you are receiving error 13.  This is usually because you missed the step to override the loader default like you did in your test.  It happens quick, so you might want to set the VM boot option to enter the BIOS configuration first to make it easier to hit the down-arrow key to select the ESXi boot option.

Edited by flyride
Link to comment
Share on other sites

I commented out everything except the ESXi loader option in GRUB config. The guide I was using said to edit the synoboot.img file and open the grub.cfg and edit the file. I changed the MAC to my VM's MAC, and commented out all options except for the ESXi one. Is that to what you're referring?

 

I didn't have a problem booting the new VM and getti8ng to the "desktop" of xpenology, but when I added my LSI card as PCI passthrough on the VM it offers to migrate data on boot, then it fails no matter what option I choose (migrate or reinstall).

Link to comment
Share on other sites

So you did a clean install to 6.2.3 and a VM that was working, and you have ADDED an LSI card and tried to boot up with no reinstallation of your loader.  Right?

 

If so, DSM is having to choose between the functional 6.2.3 DSM on your virtual disk, and whatever broken DSM is on your array. And it is choosing the array and ignoring the good DSM install on your virtual disk, realizing that it isn't valid mid-boot and then offering to migrate/upgrade.

 

You have a conflict and some options.  First, did you build a Storage Group and volume on your virtual disk?  If so, that will conflict with what is already on your array.  So you want to boot up the virtual disk without the LSI and then delete the volume and storage group off the virtual disk.

 

Do you have DiskIdxMap and SataPortMap already from your previous setup?  If not, you need to figure out how the controllers are mapped. You (should) have three different disk controllers. You have a hot pluggable array, so unplug all your disks (just unlatch them and allow them to spin down) and boot your VM back up with the LSI in passthrough and look at Storage Manager.  What is the arrangement of the disks and slots?  You MIGHT see the loader disk, you SHOULD see the VM disk. Take your #1 hot plug drive and temporarily replace it with a blank HDD.  What slot does it show up as?  Record all this information and then report back so we can calculate DiskIdxMap and SataPortMap or report the values you are already using.

 

The issue you are encountering with the boot selecting the wrong DSM can be addressed by changing DiskIdxMap once we know exactly what it is doing.

Edited by flyride
Link to comment
Share on other sites

Quote

First, did you build a Storage Group and volume on your virtual disk? 

No I did not. Simply there to allow DSM to install.

 

Quote

Do you have DiskIdxMap and SataPortMap already from your previous setup? 

I'm not sure what this is. 

 

Quote

You have a hot pluggable array, so unplug all your disks (just unlatch them and allow them to spin down) and boot your VM back up with the LSI in passthrough and look at Storage Manager.  What is the arrangement of the disks and slots?  You MIGHT see the loader disk, you SHOULD see the VM disk. Take your #1 hot plug drive and temporarily replace it with a blank HDD.  What slot does it show up as?  Record all this information and then report back so we can calculate DiskIdxMap and SataPortMap or report the values you are already using.

I have it back up and running with the old DSM for now. Although the array didn't import perfectly and two of the drives in the RAID6 dropped out, so I'm currently rebuilding it.

 

Is this what you're looking for?

 

image.png.52f7d60479e85a57af16350561f367e7.png

 

 

Link to comment
Share on other sites

Not exactly, but we can get there.  If you are up and running on your old DSM, then we should be able to resolve whatever problem you had that was preventing you from upgrading.

 

What DSM version are you on now?

What loader?

 

Please post snapshots of the Disk Manager Overview and HDD/SSD screens.

Edited by flyride
Link to comment
Share on other sites

This leads to a lot of questions, but you did not answer the others I asked yet:

  • What DSM version are you on now?
  • What loader version?
  • If this is your system pre-upgrade, did you always have a virtual disk with nothing partitioned on it?
  • Are you trying to upgrade your system while you are having a disk integrity problem, or is this something that just happened during the upgrade?
  • In your VM, you should have one SATA controller with the loader vdisk attached to it (0:0), and a second SATA controller with the 50MB vdisk attached to it (1:0).  Correct?
Edited by flyride
Link to comment
Share on other sites

Apologies,

DSM 6.1.7

Loader 1.02b

Yes, always had the 50Mb disk show up. However, now that you mention it, I remember that I had to disconnect the 20GB disk to get the old VM to boot. I would imagine it had something to do with you're referring to about it choosing the wrong boot order. I would imagine that it's booting from the system partition on the degraded array now.

 

I'm upgrading because I thought there might be a bug that is causing my disks to drop out. I've replaced the controller and the cables. It was fine for almost a month, but now it's happening again. I did have to do the pin modification for the HGST drives, but this was happening before then.

 

Once the array finishes rebuilding I'm going to shut it down and test the memory next. This thing was stable for 2+ years and all of the sudden this started about 2 months ago.

Link to comment
Share on other sites

Sounds good.  I'm not 100% clear on your configuration now.  Did you get rid of disk 5 and Volume 1?

 

Three preparatory steps:

 

1. Please print output of cat /proc/mdstat

 

2. Install FixSynoboot.sh per the instructions here: https://xpenology.com/forum/topic/28183-running-623-on-esxi-synoboot-is-broken-fix-available/

 

3. Retrieve the current grub.cfg from your loader and upload it.  You can do that by mounting your USB key using OSFMount or you can mount /dev/synoboot1 using the procedure below:

$ sudo -i
# mkdir /mnt/synoboot1
# cd /dev
# mount synoboot1 /mnt/synoboot1
# cd /mnt/synoboot1/grub
# cat grub.cfg

 

Link to comment
Share on other sites

Quote

1. Please print output of cat /proc/mdstat

 

admin@ismhomenas:/$ cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [raidF1]
md4 : active raid6 sde3[4] sdh3[7] sdd3[6] sdf3[8] sdg3[5]
      23427613632 blocks super 1.2 level 6, 64k chunk, algorithm 2 [5/5] [UUUUU]

md1 : active raid1 sdh2[4] sdg2[3] sdf2[2] sde2[1] sdd2[0]
      2097088 blocks [12/5] [UUUUU_______]

md0 : active raid1 sdd1[2] sde1[3] sdf1[4] sdg1[5] sdh1[6]
      2490176 blocks [12/5] [__UUUUU_____]

unused devices: <none>

 

Quote

2. Install FixSynoboot.sh per the instructions here: https://xpenology.com/forum/topic/28183-running-623-on-esxi-synoboot-is-broken-fix-available/

This is complete:

admin@ismhomenas:/etc$ ls -l /usr/local/etc/rc.d/
total 4
-rwxr-xr-x 1 admin users 2161 Jun  4 11:43 FixSynoboot.sh

 

 

Quote

3. Retrieve the current grub.cfg from your loader and upload it.  You can do that by mounting your USB key using OSFMount or you can mount /dev/synoboot1 using the procedure below:

if serial --port=0x3F8 --speed=115200;then
        set has_serial=true
        terminal_input --append serial
        terminal_output --append serial
else
        clear
fi

terminal_input --append console
terminal_output --append console

if [ x"${grub_platform}" = xefi ]; then
        insmod efi_gop
        insmod efi_uga
else
        insmod vbe
fi

set extra_initrd="extra.lzma"
set info="info.txt"

set vid=0x058f
set pid=0x6387
set sn=C7LWN09761
set mac1=0011322CA785
set rootdev=/dev/md0
set netif_num=1
set extra_args_3615=''

set common_args_3615='syno_hdd_powerup_seq=0 HddHotplug=0 syno_hw_version=DS3615xs vender_format_version=2 console=ttyS0,115200n8 withefi elevator=elevator quiet syno_port_thaw=1'

set sata_args='sata_uid=1 sata_pcislot=5 synoboot_satadom=1 DiskIdxMap=0C SataPortMap=1 SasIdxMap=0'

set default='0'
set timeout='1'
set fallback='1'

if [ -s $prefix/grubenv ]; then
        load_env
        if [ -n "$saved_entry" ]; then
                set default="${saved_entry}"
        fi
fi

VERSION="with Jun's Mod v1.02b"

search --file -s /zImage

function savedefault {
        if [ -s $prefix/grubenv  ]; then
                saved_entry="${chosen}"
                save_env saved_entry
        fi
}

function do_option {
        if [ $# -lt 2 ]; then
                eval "set value=\"\$$1\""
                echo "current $1: $value"; return;
        fi
        set key=$1
        shift
        set $key="$*"
        if [ -s $prefix/grubenv  ]; then
                save_env $key
        fi
}

function vid { do_option vid $@; }
function pid { do_option pid $@; }
function sn { do_option sn $@; }
function mac1 { do_option mac1 $@; }
function mac2 { do_option mac2 $@; }
function mac3 { do_option mac3 $@; }
function mac4 { do_option mac4 $@; }
function rootdev { do_option rootdev $@; }
function append { do_option extra_args_3615 $@; }

function vidpid {
        if [ $# -lt 2 ]; then
                echo "usage: vidpid 0xVVVV 0xPPPP"; return;
        fi
        set usb_args="vid=$1 pid=$2"
        if [ -s $prefix/grubenv  ]; then
                save_env usb_args
        fi
}

function showtips {
        if [ -n "$has_serial" ]; then
                terminal_output --remove serial
        fi
        echo "Screen will stop updating shortly, please open http://find.synology.com to continue."
        echo
        echo
        if [ -n "$has_serial" ]; then
                terminal_output --append serial
        fi
}

function loadinitrd {
        if [ -s $img/$info ]; then
                if [ -n "$has_serial" ]; then
                        terminal_output --remove serial
                fi
                cat $img/$info
                if [ -n "$has_serial" ]; then
                        terminal_output --append serial
                fi
        fi
        if [ -s $img/$extra_initrd ]; then
                initrd $img/rd.gz $img/$extra_initrd
        else
                initrd $img/rd.gz
        fi
}

function common_add_option {
        eval "set value=\"\$$1\""
        if [ -z $value ]; then return 1; fi
        set common_args="$common_args $1=$value"
}

function common_add_option_ex {
        eval "set value=\"\$$1\""
        if [ -z $value ]; then return 1; fi
        set common_args="$common_args $2=$value"
}

function loadlinux {
        set model=$1
        set bootdev=$2
        shift 2
        if [ -n $vid -a -n $pid ]; then
                set usb_args="vid=$vid pid=$pid"
        fi
        eval "set common_args=\"\$common_args_$model\""
        eval "set extra_args=\"\$extra_args_$model\""
        eval "set bootdev_args=\"\$${bootdev}_args\""
        common_add_option_ex rootdev root
        common_add_option sn
        if common_add_option mac1; then set netif_num=1; fi
        if common_add_option mac2; then set netif_num=2; fi
        if common_add_option mac3; then set netif_num=3; fi
        if common_add_option mac4; then set netif_num=4; fi
        common_add_option netif_num
        if [ -z $zImage ]; then
                set zImage=zImage
        fi
        linux $img/$zImage $common_args $bootdev_args $extra_args $@
}

menuentry "DS3615xs 6.1 Baremetal $VERSION" --class os {
        set img=
        savedefault
        loadlinux 3615 usb
        loadinitrd
        showtips
}

menuentry "DS3615xs 6.1 Baremetal $VERSION Reinstall" --class os {
        set img=
        loadlinux 3615 usb mfg
        loadinitrd
        showtips
}

#menuentry "DS3615xs 6.1 Baremetal AMD $VERSION" --class os {
#        set img=
#        set zImage=bzImage
#        savedefault
#        loadlinux 3615 usb
#        loadinitrd
#        showtips
#}

menuentry "DS3615xs 6.1 VMWare/ESXI $VERSION" --class os {
        set img=
        savedefault
        loadlinux 3615 sata
        loadinitrd
        showtips
}

 

Link to comment
Share on other sites

Ok, the line we are interested in grub.cfg is this:

set sata_args='sata_uid=1 sata_pcislot=5 synoboot_satadom=1 DiskIdxMap=0C SataPortMap=1 SasIdxMap=0'

 

Specifically DiskIdxMap and SataPortMap. These really need to be set for DSM to survive a major version upgrade with a multi-controller environment such as yours.

 

In your VM, you should have a SATA Controller #0 with the loader vmdk attached to it as dev 0:0

You should have a 50MB vmdk which should be attached to SATA Controller #1 as dev 1:0 - if this is not correct, please advise.

The 50MB vmdk is not strictly necessary, but it's a good insurance because it has a copy of DSM on it in case something happens to your passthrough HBA.

 

Then you have your passthrough HBA, for a total of three different controllers in the system.  These controllers are in PCIe bus slot order (SATA 0, SATA 1, HBA).

 

SataPortMap helps DSM know how many slots to attribute to controllers.  Your SATA 0 has 1 drive attached, SATA 1 has 1 drive attached, and HBA supports up to 8 (correct?).  Therefore, your SataPortMap=118.  If you delete SATA Controller 1 and its vmdk, SataPortMap=18

 

DiskIdxMap helps DSM know how to map drives to drive letters.  We don't need access to the loader (nor do we want it in the Disk Manager) so it is mapped beyond the allowable slots by default (0C = 12, which is > MaxDisks enumerated from 0).  The SATA 1 vmdk needs to be accessible as /dev/sda, so it's value is 00, and the HBA needs to be accessible starting with /dev/sdb, so it's value is 01.  That makes DiskIdxMap=0C0001.  If you delete SATA Controller 1 and its vmdk, DiskIdxMap=0C00

 

You can edit grub.cfg with nano or vi using the mount synoboot command in the prior post in order to make these changes.  The net effect you should see is in Disk Manager Overview, the gap between your virtual disk and HBA disks should disappear.

Edited by flyride
Link to comment
Share on other sites

7 minutes ago, flyride said:

ou should have a 50MB vmdk which should be attached to SATA Controller #1 as dev 1:0 - if this is not correct, please advise.

The 50MB vmdk is not strictly necessary, but it's a good insurance because it has a copy of DSM on it in case something happens to your passthrough HBA.

This is what I had the 20GB disk for before. It's removed now. I went ahead and added a new one. 

 

I had the VMware settings using a SCSI controller before, so I changed it to SATA and moved the disks to the new controllers. I booted the VM successfully to make sure it didn't affect anything.

 

I made the changes as you suggested, but it did not like them.

 

image.thumb.png.2e2693ea07616d2a5106b057c2392b82.png

 

 

image.thumb.png.77604937c7a9a9b14c972dbd7e36c2c2.png

 

Link to comment
Share on other sites

Also for what it's worth, the SCSI virtual controllers don't work in 6.2.x so that is one of the reasons your upgrade failed.  Using SATA controllers for 6.2.x is clearly covered in all the tutorials.

Edited by flyride
Link to comment
Share on other sites

if serial --port=0x3F8 --speed=115200;then
        set has_serial=true
        terminal_input --append serial
        terminal_output --append serial
else
        clear
fi

terminal_input --append console
terminal_output --append console

if [ x"${grub_platform}" = xefi ]; then
        insmod efi_gop
        insmod efi_uga
else
        insmod vbe
fi

set extra_initrd="extra.lzma"
set info="info.txt"

set vid=0x058f
set pid=0x6387
set sn=C7LWN09761
set mac1=0011322CA785
set rootdev=/dev/md0
set netif_num=1
set extra_args_3615=''

set common_args_3615='syno_hdd_powerup_seq=0 HddHotplug=0 syno_hw_version=DS3615xs vender_format_version=2 console=ttyS0,115200n8 withefi elevator=elevator quiet syno_port_thaw=1'

set sata_args='sata_uid=1 sata_pcislot=5 synoboot_satadom=1 DiskIdxMap=0C0001 SataPortMap=118 SasIdxMap=0'

set default='0'
set timeout='1'
set fallback='1'

if [ -s $prefix/grubenv ]; then
        load_env
        if [ -n "$saved_entry" ]; then
                set default="${saved_entry}"
        fi
fi

VERSION="with Jun's Mod v1.02b"

search --file -s /zImage

function savedefault {
        if [ -s $prefix/grubenv  ]; then
                saved_entry="${chosen}"
                save_env saved_entry
        fi
}

function do_option {
        if [ $# -lt 2 ]; then
                eval "set value=\"\$$1\""
                echo "current $1: $value"; return;
        fi
        set key=$1
        shift
        set $key="$*"
        if [ -s $prefix/grubenv  ]; then
                save_env $key
        fi
}

function vid { do_option vid $@; }
function pid { do_option pid $@; }
function sn { do_option sn $@; }
function mac1 { do_option mac1 $@; }
function mac2 { do_option mac2 $@; }
function mac3 { do_option mac3 $@; }
function mac4 { do_option mac4 $@; }
function rootdev { do_option rootdev $@; }
function append { do_option extra_args_3615 $@; }

function vidpid {
        if [ $# -lt 2 ]; then
                echo "usage: vidpid 0xVVVV 0xPPPP"; return;
        fi
        set usb_args="vid=$1 pid=$2"
        if [ -s $prefix/grubenv  ]; then
                save_env usb_args
        fi
}

function showtips {
        if [ -n "$has_serial" ]; then
                terminal_output --remove serial
        fi
        echo "Screen will stop updating shortly, please open http://find.synology.com to continue."
        echo
        echo
        if [ -n "$has_serial" ]; then
                terminal_output --append serial
        fi
}

function loadinitrd {
        if [ -s $img/$info ]; then
                if [ -n "$has_serial" ]; then
                        terminal_output --remove serial
                fi
                cat $img/$info
                if [ -n "$has_serial" ]; then
                        terminal_output --append serial
                fi
        fi
        if [ -s $img/$extra_initrd ]; then
                initrd $img/rd.gz $img/$extra_initrd
        else
                initrd $img/rd.gz
        fi
}

function common_add_option {
        eval "set value=\"\$$1\""
        if [ -z $value ]; then return 1; fi
        set common_args="$common_args $1=$value"
}

function common_add_option_ex {
        eval "set value=\"\$$1\""
        if [ -z $value ]; then return 1; fi
        set common_args="$common_args $2=$value"
}

function loadlinux {
        set model=$1
        set bootdev=$2
        shift 2
        if [ -n $vid -a -n $pid ]; then
                set usb_args="vid=$vid pid=$pid"
        fi
        eval "set common_args=\"\$common_args_$model\""
        eval "set extra_args=\"\$extra_args_$model\""
        eval "set bootdev_args=\"\$${bootdev}_args\""
        common_add_option_ex rootdev root
        common_add_option sn
        if common_add_option mac1; then set netif_num=1; fi
        if common_add_option mac2; then set netif_num=2; fi
        if common_add_option mac3; then set netif_num=3; fi
        if common_add_option mac4; then set netif_num=4; fi
        common_add_option netif_num
        if [ -z $zImage ]; then
                set zImage=zImage
        fi
        linux $img/$zImage $common_args $bootdev_args $extra_args $@
}

menuentry "DS3615xs 6.1 Baremetal $VERSION" --class os {
        set img=
        savedefault
        loadlinux 3615 usb
        loadinitrd
        showtips
}

menuentry "DS3615xs 6.1 Baremetal $VERSION Reinstall" --class os {
        set img=
        loadlinux 3615 usb mfg
        loadinitrd
        showtips
}

#menuentry "DS3615xs 6.1 Baremetal AMD $VERSION" --class os {
#        set img=
#        set zImage=bzImage
#        savedefault
#        loadlinux 3615 usb
#        loadinitrd
#        showtips
#}

menuentry "DS3615xs 6.1 VMWare/ESXI $VERSION" --class os {
        set img=
        savedefault
        loadlinux 3615 sata
        loadinitrd
        showtips
}

image.thumb.png.44f44e2bd9e99e9631d71fdef6d09a4f.png

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...