If you are reading this you problebly already knew what is Xpenology. I havn’t had a chance to try it. Recently jun released the Xpenology boot loader 1.02b for DSM 6.1. I tried it on my ESXi 6.5 and found it works quite well so I am going to try it on a bare metal PC.
To setup the Xpenology NAS, the first thing you need to do is making the boot loader onto an USB stick so your NAS will boot from it. Then it will guide you to install the DSM 6.1.
There are lots tutorials on how to makethe USB boot loader from a Windows PC. The process is simple but still needs you to get on Windows and download/install few programs to have the job done. We all know that Xpenology is based on Linux system, so why not just make the boot loader on Linux?
Here I’ll show you how to make the boot loader from Ubuntu. For this we need:
- A computer with Ubuntu installed. (Other Linux OS should also works.)
- An USB drive
Following the link provided by jun’s post on the Xpenology Forum, download the boot loader ISO file.
I am going to try the DS3617xs build so I downloaded this file and saved it at /home/pztop/xpenology/:
DS3617xs 6.1 Jun’s Mod V1.02b.iso
I connect an USB external DVD-ROM to my NAS and boot up with an Ubuntu Live DVD. Then I use ifconfig command to find the MAC addesss.
eno1 Link encap:Ethernet HWaddr 54:04:a6:19:21:a2
inet addr:192.168.1.77 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::5604:a6ff:fe19:21a2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9375 errors:0 dropped:3 overruns:0 frame:0
TX packets:4558 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:12211676 (12.2 MB) TX bytes:464897 (464.8 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1087 errors:0 dropped:0 overruns:0 frame:0
TX packets:1087 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:116687 (116.6 KB) TX bytes:116687 (116.6 KB)
I see the MAC address (HWaddr) is 54:04:a6:19:21:a2.
Plug in the USB stick (I got an old 1GB USB drive), then issue command lsusb
Bus 001 Device 015: ID 0204:6025 Chipsbank Microelectronics Co., Ltd CBM2080 / CBM2090 Flash drive controller
Bus 001 Device 002: ID 0409:013e NEC Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
I noticed the two numbers I needed:
Vendor ID(VID) is 0204. Product ID(PID) is 6025.
I used the serial number generator at here to get my SN.
Select DS3617xs as the model then click on “Generate” then I got the SN.
The ISO image file jun provided is just an example ISO image. We need customize it according to our own system. This involves to modify a single file grub.cfg inside the ISO image I just downloaded. So lets begin.
First I analyzed the ISO image file. Switch to root user and show the image layout. Here is the output:
fdisk -lu DS3617xs\ 6.1\ Jun\'s\ Mod\ V1.02b.iso
Disk DS3617xs 6.1 Jun's Mod V1.02b.iso: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: C94E55EA-A4D2-4E78-9D73-46CBAE7A03EF
Device Start End Sectors Size Type
DS3617xs 6.1 Jun's Mod V1.02b.iso1 2048 32767 30720 15M EFI System
DS3617xs 6.1 Jun's Mod V1.02b.iso2 32768 94207 61440 30M Linux filesystem
DS3617xs 6.1 Jun's Mod V1.02b.iso3 94208 102366 8159 4M BIOS boot
Here we got some importabt infomation: (1) The Sector size is 512 bytes; (2) The first partition (15MB size) start at cylinder 2048; (3)The first partition is the EFI partition.
Now I calculated the offset from the start of the image to the partition start:
Sector size x Start = 512 x 2048 = 1048576
Mount it on /dev/loop0 using this offset number:
# losetup -o 1048576 /dev/loop0 DS3617xs\ 6.1\ Jun\'s\ Mod\ V1.02b.iso
Now the partition resides on /dev/loop0. mount it:
# mkdir /mnt/xpeboot
# mount /dev/loop0 /mnt/xpeboot
The boot partition is mounted and I am able to edit the grub.cfg file:
Modify the file using the infomation I’ve got:
As showed above, I changed vid, pid, sn and mac1 accordingly. I also set the timeout to 5 sec. (If you want use the boot loader on ESXi, you may also want to set the default to “2”.)
Save the file when done.
Unmount the image:
umount /mnt/xpeboot losetup -d /dev/loop0
Now I got my customized ISO image. To confirm this, use command ls -l or stat you can check the timestamp of the iso file, it should be a newly modified file.
With the customized image iso file ready, I can start make the bootable USB stick.
Insert the USB stick and check dmesg ,
look at the lines on the bottom and I see the system recognized the USB drive as /dev/sdd (NOTE: Yours may be different! Check it carefully or you may accidentally wipe the wrong drive.)
Still as root user,navigate to the iso file reside directory, then use dd command to burn the ISO image to the USB stick:
dd if=DS3617xs\ 6.1\ Jun\'s\ Mod\ V1.02b.iso of=/dev/sdd bs=512
Now I have the USB boot loader drive ready!
I am not going to go to details about this. You can find lots instructions online. Just insert the USB stick just made, then boot NAS from it, finish the DSM installation and ENJOY!