Tutorial: Install/Migrate DSM 5.2 to 6.0 (Jun's loader)

Tutorial: Install/Migrate DSM 5.2 to 6.0 (Jun's loader)

Postby Polanskiman » 28 Oct 2016 16:18

I created a tutorial for the French section so I thought, what the heck, let's do it for the English one as well. Here it goes.

As most of you know by now Jun was able to find a way to install DSM 6 on non Synology boxes. Here is the thread that I recommend reading. At least make an effort and read the OP: http://xpenology.com/forum/viewtopic.php?f=2&t=20216

Below is what you need for the operation. I will assume you are doing all this under Windows 10, 8, 7 or XP. If you are on a MAC computer have a look at this post I made on how to burning the image to a USB drive and then mounting the USB drive for editing the content. The rest of the tutorial still applies.

- If you are in 5.1 or below first update to 5.2. If you are doing a fresh install of DSM 6.0 then carry on with the tutorial and omit references to 5.2.
- Win32 Disk Imager to make a bootable USB drive;
- A 4GB (or any size really) USB drive (flash drive) to install the loader. Not that this is necessary but use preferably a brand name (Kingston, SanDisk...);
- A way to read your USB drive VID/PID. Here is a how >>> VID and PID;
- A good text editor: Notepad++ I really don't recommend using Windows's Notepad;
- DSM 6.0.2. The file comes straight from Synology servers;
- Jun's official v.1.01 loader (mirror). This is the latest hybrid UEFI/BIOS loader so it should work for most bare-metal/VM install/migrations. This loader supports Intel and AMD based hardware;
- Make sure your drives are plugged in direct succession starting from the 1st SATA port. Usually the first port is described as SATA0 on motherboards. Check with your MB manufacturer for exact nomenclature.
OSFMount to modify the grub.cfg file within the loader's image. This is not strictly necessary as Jun has made it possible to configure what needs to be modified via the Grub Boot Menu. I recommend you use OSFMount for now although it adds an extra step. If you prefer using Jun's new feature simply skip Point 5read Note 4 instead and pick up at Point 6.


PLEASE READ EVERYTHING PRIOR ATTEMPTING ANYTHING


Use this loader at your own risk. I wont be held responsible for any loss of data or black smokes that may result in the use of this loader. Please note that this loader is based on DSM 6.0 Beta 2 branch 7274 and that a limited amount of drivers are included in the loader. If it is fundamental for you to have a NAS operating as quick as possible I recommend you look at the included drivers first at the bottom of this tutorial. If they are not there you will have to compile your own drivers. One last thing: DO NOT UPDATE DSM TO VERSION 6.1 with loader v1.01. You have been warned.


Here we go:

1 - BACKUP your data and save your configuration prior any attempts to migrate from DMS 5.2 to DSM 6.0. I can't stress this enough. JUST DO IT, as Nike likes to say. Also, print this tutorial if you can. It will make your life easier.

2 - Turn off your NAS and unplug the USB drive you are currently using with DSM 5.2. I recommend you put this USB drive aside in case migration to DSM 6.0 doesn’t go as expected and you need to revert to DSM 5.2. It will just make your life easier.

3 - Now go to your workstation/PC, plug a new USB drive (or the old one if you really don’t have any spare USB drives). Use the link I provided earlier to check your USB drive VID/PID. Write down the info somewhere as we will need it later.

4 - Unzip the loader you downloaded earlier. You will end up with a folder containing several files. Since we are installing on bare-metal you will only need the image file "synoboot.img". 

5 - Now launch OSFMount. Select Mount New, then select the image file (i.e. synoboot.img) to open. Now select partition 0 (the one that is 30 MB). Click Ok. Then at the bottom of the window make sure to un-tick the "Read only drive". Click Ok. The EFI partition of the image file should now be mounted in file explorer. You can now navigate to the grub folder and edit the grub.cfg file. Below is what you will see in the file. (I am only putting below the portion of the code that is relevant for the purpose of this tutorial)

Code: Select all
[...]

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'

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'

[...]


:!: You need to modify the following:  :!:

Change vid=0x090C to vid=0x[your usb drive vid]
Change pid=0x1000 to pid=0x[your usb drive pid]
Change sn=C7LWN09761 to sn=[your sn]
Change mac1=0011322CA785 to mac1=[your mac address] You can also add set mac2=[your mac address] and so on if you have multiple NICs.
Optional: Change set timeout='1' to set timeout='3' - This will allow you more time to make a selection in the Grub Boot Menu when it appears. 

Once you are done editing the grub.cfg file, save it and close your text editor. Now in OSFMount click on Dismount all & Exit.
You are now ready to burn the image to your USB drive.

6 - Now use Win32 Disk Imager to burn the image file onto the USB drive. This will also make the USB drive bootable.

7 - Eject and unplug the USB drive from your workstation. Plug it in your NAS (avoid USB 3.0 ports. Use USB 2.0 port if available). Boot your NAS and before doing anything fancy, access your BIOS so to make your USB drive the 1st boot drive if it's not the case. The loader can boot in UEFI or in legacy BIOS, so you chose what suits you best. Also, make sure your HDDs are booting in AHCI mode and not in IDE, else it wont work. Finally, if disabled, also enable the serial port in BIOS. Some BIOS don't have this option so don't get too cranky on this if you can't find it. Save changes to the BIOS and REBOOT the NAS.

8 - Once rebooted, if you have a monitor connected to your NAS you will see the following Grub Boot Menu:
Image
If you are on an Intel based machine you can simply let it be and the loader will automatically start. However, if you are on a AMD based machine you will need to select the 4th line and then press enter. ADVICE: even before you see the Grub Boot Menu press the up/down key. This will stop the countdown so you will be able to select the desired line. You won’t see much other than the following after you press enter:
Image
If you booted the USB drive in EFI mode then you will see the same text without the last 3 lines but that's ok.

9 - Now go back to your workstation, and launch Synology Assitant or go to http://find.synology.com. Within one minute or so you should normally be able to see your NAS on the local network (it took 55 seconds on a test I did on a VM). Just follow the instructions and either chose "Install" if you wish to have a clean install or chose “Migration” if you are coming from DMS 5.2 and wish to update while retaining your data. You will be asked to provide the .PAT file you downloaded earlier (DSM_DS3615xs_8451.pat).

10 - When the migration is finished you will most probably have to update some of your packages. You can then proceed and update DSM 6.0 up to DSM 6.0.2-8451 update 8. You can actually update up to Update 9 but you might either need to hard reboot or re-image your usb drive. For those who wish to stay on Update 8 you can manually download it here. DO NOT UPDATE DSM TO VERSION 6.1 with loader v1.01

11 - Enjoy. If you have questions or recommendations leave a comment.

--------------
Note 1: If after following the tutorial you can’t find your NAS through http://find.synology.com ou Synology Assistant it is highly possible that the drivers of your NIC are not included in the ramdisk of the loader. In doubt, just ask.

Note 2: Synology increased security in DSM 6.0. Root access through SSH is no longer available out of the box. You can however use your admin account and elevate permissions with the following command
Code: Select all
sudo -i

Note 3: Please check you have the right VID/PID prior proceeding. If you get the following error ”Failed to install the file. The file is probably corrupted. (13)" it means your VID and/or PID is wrong. If you are 200% sure that your VID/PID is correct and you still get that error message then try to 'Force Install'.

Note 4: Changes made to the grub.cfg file can also be done directly during the Grub Boot Menu, so technically you can skip Point 5 and burn the image on the USB drive without editing anything (read Point 6 onward first). If you wish to do the changes from the Grub Boot Menu directly you need to press the letter 'C' when you see the Boot Menu. You will literally only have one second, so be fast. Once you press C you will be in a Grub command line environment. To change your VID enter the following:
Code: Select all
vid 0xYOUR 4 DIGITS USB DRIVE VID

Do the same for pid, sn and mac1. Press enter at each command. The commands are:
Code: Select all
pid 0xYOUR 4 DIGITS USB DRIVE PID
sn YOUR NAS SERIAL NUMBER
mac1 YOUR NAS MAC1 ADDRESS

If you have multiple NICs you can also issue mac2, mac3 and mac4 as commands. Maximum is mac4. See below:
Code: Select all
mac2 YOUR NAS MAC2 ADDRESS
mac3 YOUR NAS MAC3 ADDRESS
mac4 YOUR NAS MAC4 ADDRESS


If you think you made a mistake in the numbers simply re-issue the command. When you are done press esc and select the appropriate menu entry. Below is an example of how it looks under the Grub command line environment:

Image

Note 5: If your encounter the "We've detected errors on your hard drives [drive number] and the SATA ports have also been disabled" error during installation, try the Force Install menu entry in the Grub Boot Menu. If this does not work then you have to fallback to adding SataPortMap to the grub environment. Press the letter 'C' at the Grub Boot Menu and then add the following:

Code: Select all
append SataPortMap=XX

where XX is the number of drives. Don’t forget to update this parameter if you add additional drives to your machine.
If you use Force Install, don't forget to re-select the first line of the Boot Menu once the NAS has rebooted after the installation else the Loader will re-select Force Install and you will be faced with some issues so please beware of this.

@@@@@@@@ What does SataPortMap mean? @@@@@@@
setsunakawa wrote:SataPortMap=4 means first 4 ports of 1st controler.
SataPortMap=44 means first 4 ports of 1st controler and first 4 ports of 2nd controler.
SataPortMap=422 means first 4 ports of 1st controler, first 2 ports of 2nd controler and first 2 ports of 3rd controler.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


############## Know Issues #####################
- When running on a slow single core machine, there is a race condition that causes the patcher to load too late. The most obvious sign is that console is not working properly.
- Some ethernet drivers crash when set MTU above about 4096 (Jumbo frame).


############# Included Modules in Loader #############
Trantor » 23 Oct 2016 20:50 - Original Post
Modules/Drivers
Change log:

Updated broadcom tg3, bnx2, bnx2x, cnic
Updated intel e1000e (I219 support)
Add/Updated realtek r8168, r8169 and r8101 (r8169 from realtek website no the one inside the kernel tree)

Arcao » 25 Oct 2016 20:22 - Original Post
Modules/Drivers
Change log:

Added below kernel modules:
r8101: RTL8100E/RTL8101E/RTL8102E-GR/RTL8103E(L) RTL8102E(L)/RTL8101E/RTL8103T RTL8401/RTL8401P/RTL8105E RTL8402/RTL8106E/RTL8106EUS
r8168: RTL8111B/RTL8168B/RTL8111/RTL8168 RTL8111C/RTL8111CP/RTL8111D(L) RTL8168C/RTL8111DP/RTL8111E
r8168: RTL8168E/RTL8111F/RTL8411 RTL8111G/RTL8111GUS/RTL8411B(N) RTL8118AS
* Note: r8169 from Trantor archive doesn't work with my on-board Realtek RTL8111GR. So I kept the existing which is also much bigger.

e1000e: 82573L/82572EI/82571EB/82573E/82573V/82567/82574L/82566MM/82566MC
e1000e: 82566DM/82566DC/82563EB/82574IT/82583V/82579LM/82579V/82577LC/82577LM
e1000e: 82578DC/82578DM/Gigabit CT Desktop Adapter/PRO/1000 PT/PF/I217-LM/V/I218-V/LM/I219 LM/V

bnx2: Broadcom NetXtremeII BCM5706/BCM5708/5709/5716
bnx2x: Broadcom NetXtremeII 10Gb BCM57710/BCM57711/BCM57711E/BCM57712
tg3: Broadcom Tigon3 BCM5705/BCM5703/BCM5702/BCM5701/BCM5700/BCM5721/BCM5751/BCM5788/BCM5704/BCM5752/BCM5789
tg3 : BCM5723/BCM5761/BCM5787/BCM5755/BCM5722/BCM5754/BCM57781/BCM57785/BCM5718BCM57765/BCM57761
tg3: BCM5719/BCM5725/BCM5762/BCM5720/BCM57790/BCM57795/BCM57766/BCM57780
* Note: Existing modules updated with version from Trantor archive. I also added missing firmware files.

ax88179_178a : ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet

mpt2sas: LSI SAS 6Gb/s Host Adapters SAS2004, SAS2008, SAS2108, SAS2116, SAS2208, SAS2308 and SSS6200
* Note: It's already included in existing ramdisk but not loaded. By dmesg it's started correctly.

evdev, button: for acpid

Arcao » 28 Oct 2016 10:47 - Original Post
Modules/Drivers
Change log:

* Fixed loading modules after installation step and upgrading from previous ramdisk version
* Fixed order of loading kernel modules (cause not loading cnic)

--------------------------------------------------------------------------------
Recompiled kernel modules:

r8169: r8169-6.022.00 sources
* Note: Compiled by Trantor

igb: igb-5.3.5.4 sources
ixgbe: ixgbe-4.4.6 sources
* Note: Compiled from latest sources at intel.com

megaraid_sas: megaraid_sas-06.812.07.00 sources
mpt2sas: mpt2sas-20.00.04.00 sources
* Note: Compiled from latest sources at lsi.com/avagotech.com

--------------------------------------------------------------------------------
Added kernel modules:

mpt3sas: mpt3sas-14.00.00.00 sources
* Note: Compiled from latest sources at lsi.com/avagotech.com

ftdi_sio, cp210x, ch341, pl2303
* Note: ftdi_sio is compiled by Synology, others are compiled from 7274 kernel sources


############## Tutorial UPDATES ##################
[30/10/2016] Updated loader to latest version. Jun Loader v.1 This loader now has AMD support.
[03/11/2016] Updated Jun's loader to latest version v1.0.1.
[18/11/2016] Overhaul of the tutorial to reflect new features and fixes in the loader.
[19/11/2016] Minor edits and clarifications.
[20/11/2016] Minor edits. Added link on how to burn & mount image in MAC OS. 3rd Paragraph.
[05/12/2016] Added note about SATA0. Modified/improved warning. Detailed note 5 (Force Install).
[09/12/2016] Title changed from "Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal" to "Tutorial: Install/Migrate DSM 5.2 to 6.0 (Jun's loader)"
[19/01/2017] Point 10. Added following comment: "Update 9 seems to be causing some issues, so stay on update 8 until further notice"
[20/01/2017] Minor edits.
[30/01/2017] Note 5 clarified.
[22/02/2017] Edit Warning message due to inaccuracy: DSM 6.0.2 Beta branch 7274 to DSM 6.0 Beta 2 branch 7274
[23/02/2017] Point 10. Added following comment: DO NOT UPDATE DSM TO VERSION 6.1.
[27/02/2017] Trantor added a mirror to loader
[02/03/2017] Link to Loader updated
[08/03/2017] Added following comment to Warning message: DO NOT UPDATE DSM TO VERSION 6.1 with loader v1.01 + Minor edits
Last edited by Polanskiman on 08 Mar 2017 03:51, edited 49 times in total.
CASE: Lian Li PC-Q25B MB: Gigabyte H97N-WIFI (rev. 1.0) CPU: Intel G3220 PSU: Seasonic Platinum-860 HDD: WD RED 2 x 2TB RAM: 16GB
BOOT USB: SanDisk Ultra Fit 16GB LOADER: Jun's v1.01 loader DSM: DSM 6.0.2-8451 Update 9 HOWTO: Tutorial DSM 6.0
User avatar
Polanskiman
 
Posts: 776
Joined: 09 Aug 2014 05:15

Re: Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal

Postby Elpee » 28 Oct 2016 17:45

I have some questions.

1. I have a Xpeno Nas DSM 5.2 currently running on bare metal AMD PC. Can I migrate to DSM 6.0?
2. I saw your instruction how to setup SataPortMap. It's useful.
I'm however just confused how we call which one is controller 1, 2, 3, blah..blah... :oops:
let say I have a mobo that has 3 sata ports. I attached 2 more sata cards that has 2 ports and the other 4 ports to build my 9 HDDs nas. So, in this case, which one should I setup for SataPortMap?
It should be SataPortMap=234, SataPortMap=243, SataPortMap=324, SataPortMap=342, SataPortMap=432, or SataPortMap=423?
An extra question. What if I set it wrong?
3. What's wrong if I use Windows Notepad instead of Notepad++ to edit grub.cfg?
4. Because the value "console=ttyS0,115200n8" is unique, people don't have to change console=uart,io,0x3f8,115200n8 to console=ttyS0,115200n8 if you originally changed and posted?

Finally, thank you very much for the tutorial. It helps me as a newbie a lot.
Elpee
 
Posts: 130
Joined: 18 Feb 2014 15:22

Re: Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal

Postby CtrlAltDel » 28 Oct 2016 20:20

Elpee wrote:I have some questions.

1. I have a Xpeno Nas DSM 5.2 currently running on bare metal AMD PC. Can I migrate to DSM 6.0?


The new loader doesn't work with AMD based mother boards at the moment. It would require the kernel to be recompiled from the source. That can't be done because the source isn't available. The new system is a Dynamic patch and it can only work based on the core of the kernel which is Intel based. That's my understanding of how things stand at present using Jun's method and the associated derivatives.

AMD is now supported.
Last edited by CtrlAltDel on 29 Oct 2016 14:39, edited 1 time in total.
CtrlAltDel
 
Posts: 381
Joined: 12 Feb 2014 21:37

Re: Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal

Postby imaleecher » 28 Oct 2016 21:09

Are there any issues with migrating from DSM 5.2 SHR/SHR-2 RAID to DSM 6.0?
Synology: DS213 2x4TB RAID1
XPEnology: DS3615xs i3-4370 Gigabyte GA-H97N-WIFI 6x4TB SHR2
imaleecher
 
Posts: 29
Joined: 04 May 2015 22:36

Re: Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal

Postby CtrlAltDel » 28 Oct 2016 21:36

No not that I'm aware of. My first install was a migration from 5.2 to with shr and the shr was recognised in DSM 6 no problem. After that I did a fresh install on the same box and by default shr isn't an option under DSM 6. You can edit the config file to re-enable shr which works perfectly. I have drives using shr with btrfs on the new DSM 6 build. I can't say for sure about shr 2 as I have no first hand knowledge, but my guess would be that it should be fine. I'm not sure if a migrated system would allow a new disk group/volume to use shr by default, but editing the config file should soon fix that problem.
CtrlAltDel
 
Posts: 381
Joined: 12 Feb 2014 21:37

Re: Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal

Postby imaleecher » 29 Oct 2016 00:08

CtrlAltDel wrote:No not that I'm aware of. My first install was a migration from 5.2 to with shr and the shr was recognised in DSM 6 no problem. After that I did a fresh install on the same box and by default shr isn't an option under DSM 6. You can edit the config file to re-enable shr which works perfectly. I have drives using shr with btrfs on the new DSM 6 build. I can't say for sure about shr 2 as I have no first hand knowledge, but my guess would be that it should be fine. I'm not sure if a migrated system would allow a new disk group/volume to use shr by default, but editing the config file should soon fix that problem.

That sounds good to hear. Thank you for the information. I'll need to do some testing myself as YMMV of course. How would one edit the config file for SHR? You said soon so I'm guessing it's not possible as of now?
Synology: DS213 2x4TB RAID1
XPEnology: DS3615xs i3-4370 Gigabyte GA-H97N-WIFI 6x4TB SHR2
imaleecher
 
Posts: 29
Joined: 04 May 2015 22:36

Re: Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal

Postby jun » 29 Oct 2016 00:40

Elpee wrote:I have some questions.

1. I have a Xpeno Nas DSM 5.2 currently running on bare metal AMD PC. Can I migrate to DSM 6.0?
2. I saw your instruction how to setup SataPortMap. It's useful.
I'm however just confused how we call which one is controller 1, 2, 3, blah..blah... :oops:
let say I have a mobo that has 3 sata ports. I attached 2 more sata cards that has 2 ports and the other 4 ports to build my 9 HDDs nas. So, in this case, which one should I setup for SataPortMap?
It should be SataPortMap=234, SataPortMap=243, SataPortMap=324, SataPortMap=342, SataPortMap=432, or SataPortMap=423?
An extra question. What if I set it wrong?
3. What's wrong if I use Windows Notepad instead of Notepad++ to edit grub.cfg?
4. Because the value "console=ttyS0,115200n8" is unique, people don't have to change console=uart,io,0x3f8,115200n8 to console=ttyS0,115200n8 if you originally changed and posted?

Finally, thank you very much for the tutorial. It helps me as a newbie a lot.


I've uploaded a patched kernel for AMD users on the original post, but its not tested at the moment, you could have a try if you are brave enough :D
jun
 
Posts: 49
Joined: 19 Sep 2016 08:52

Re: Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal

Postby Polanskiman » 29 Oct 2016 02:18

jun wrote:
I've uploaded a patched kernel for AMD users on the original post, but its not tested at the moment, you could have a try if you are brave enough :D


Thanks Jun. Was going to mention that but you were faster!
CASE: Lian Li PC-Q25B MB: Gigabyte H97N-WIFI (rev. 1.0) CPU: Intel G3220 PSU: Seasonic Platinum-860 HDD: WD RED 2 x 2TB RAM: 16GB
BOOT USB: SanDisk Ultra Fit 16GB LOADER: Jun's v1.01 loader DSM: DSM 6.0.2-8451 Update 9 HOWTO: Tutorial DSM 6.0
User avatar
Polanskiman
 
Posts: 776
Joined: 09 Aug 2014 05:15

Re: Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal

Postby jun » 29 Oct 2016 03:50

Polanskiman wrote:
jun wrote:
I've uploaded a patched kernel for AMD users on the original post, but its not tested at the moment, you could have a try if you are brave enough :D


Thanks Jun. Was going to mention that but you were faster!


I am waiting for volunteers :D .
BTW, good tutorial, this would help many people.
jun
 
Posts: 49
Joined: 19 Sep 2016 08:52

Tutorial: Migrate from DSM 5.2 to 6.0 - Baremetal

Postby Polanskiman » 29 Oct 2016 07:04

jun wrote:
Polanskiman wrote:
jun wrote:
I've uploaded a patched kernel for AMD users on the original post, but its not tested at the moment, you could have a try if you are brave enough :D


Thanks Jun. Was going to mention that but you were faster!


I am waiting for volunteers :D .
BTW, good tutorial, this would help many people.


Thanks, hopefully it will alivate your thread from basic questions that can be answered here. I think I saw one person who tried your new bzimage in your thread. It seems it was successful. I was going to try it myself but I am lacking a hardrive. I'll put my hands on one that I have in the office next week.
CASE: Lian Li PC-Q25B MB: Gigabyte H97N-WIFI (rev. 1.0) CPU: Intel G3220 PSU: Seasonic Platinum-860 HDD: WD RED 2 x 2TB RAM: 16GB
BOOT USB: SanDisk Ultra Fit 16GB LOADER: Jun's v1.01 loader DSM: DSM 6.0.2-8451 Update 9 HOWTO: Tutorial DSM 6.0
User avatar
Polanskiman
 
Posts: 776
Joined: 09 Aug 2014 05:15

Next

Return to XPEnology General discussion



x