HanG321 Blog
Be Shine, Be Smile, Be Wild
  • Home
  • Blog
    • 好文閱讀 readings
    • 生活記事 diary
    • 時事評論 commentary
    • 科技資訊 technology
    • 電腦編程 programming
    • 金融財經 finance
    • 音樂電影 music/movie
  • About
Debian chroot on DSM 5.2

Debian chroot on DSM 5.2

June 9, 2015|chroot, DSM, XPEnology|科技資訊, 電腦編程

similar to previous blog: http://35.233.158.97/2014/08/16/debian-chroot-on-dsm/

Prerequisite:

add custom source:  Package Centre > Settings > Package Sources > add

Name: SynoCommunity
Location:  https://packages.synocommunity.com/

Installation:

– select Debian Chroot and click install

– select yes to install python (SynoCommunity version) as well.

– after installation completed, ssh to DSM as root

Shell
1
2
3
root@diskstation> /var/packages/debian-chroot/scripts/start-stop-status chroot
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
root@diskstation:/#

– now under chroot

Shell
1
2
3
4
5
6
7
8
9
10
##backup and update source list. e.g. from France to Australia
##see https://www.debian.org/mirror/list
sed -i.`date +%Y%m%d` 's/fr.debian.org/au.debian.org/g' /etc/apt/sources.list
aptitude update
aptitude upgrade
aptitude install locales
dpkg-reconfigure locales
dpkg-reconfigure tzdata
# optional: packages to install
aptitude install less vim curl rsync screen openssh-server bash-completion

– enable home for users: Control Panel > User > Advance, “Enable user home services”, Apply.
ls -al /var/services/homes  symbolic link updated and pointed correctly

– some additional directories want to be mount by startup script

Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff -u /var/packages/debian-chroot/scripts/start-stop-status.org /var/packages/debian-chroot/scripts/start-stop-status
--- /var/packages/debian-chroot/scripts/start-stop-status.org
+++ /var/packages/debian-chroot/scripts/start-stop-status
@@ -19,6 +19,7 @@
grep -q "${CHROOTTARGET}/sys " /proc/mounts || mount -t sysfs sys ${CHROOTTARGET}/sys
grep -q "${CHROOTTARGET}/dev " /proc/mounts || mount -o bind /dev ${CHROOTTARGET}/dev
grep -q "${CHROOTTARGET}/dev/pts " /proc/mounts || mount -o bind /dev/pts ${CHROOTTARGET}/dev/pts
+ grep -q "${CHROOTTARGET}/home " `realpath /var/services/homes` || mount -o bind `realpath /var/services/homes` ${CHROOTTARGET}/home
 
# Start all services
${INSTALL_DIR}/app/start.py
@@ -35,6 +36,7 @@
umount ${CHROOTTARGET}/dev
umount ${CHROOTTARGET}/sys
umount ${CHROOTTARGET}/proc
+ umount ${CHROOTTARGET}/home
}
 
daemon_status ()

– setup users on debian domain

Shell
1
2
3
4
5
6
## find user id
id -u username
id -g username
 
## Debian domain. XXXX YYYY is the id value
adduser username -uid XXXX --gid YYYY --home /home/username

– change Port form 22 to 2222, so Synology still using default port 22, Debian domain will use 2222 port

Shell
1
2
cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config.`date +%Y%m%d`
vim /etc/ssh/sshd_config

 

– config profile

Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#on Debian domain
# enable color for ls and PS1
vim /etc/profile.d/S01_allusers.sh
  export LS_OPTIONS='--color=auto'
  eval "`dircolors`"
  alias ls='ls $LS_OPTIONS'
  alias ll='ls $LS_OPTIONS -la'
  alias l='ls $LS_OPTIONS -lA'
 
  if [ "$BASH" ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
    if [ -f ~/.bashrc ]; then
      . ~/.bashrc
    fi
  fi
  #EOF
 
source /etc/profile && source /root/.profile

– ~/.profile  , different PS1 for both Synology and Debian ssh login

.profile
Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
  . "$HOME/.bashrc"
    fi
fi
 
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
 
if [ ! -r /etc/debian_chroot ]; then
  PS1='\u@\h \W \$ '
fi

– (optional) on Synology domain, edit /etc/profile as well:  PS1='\u@\h \W \$ '

Final

– ssh username@diskstation   for original synology ash shell. Or
– ssh -p 2222 username@diskstation  for debian bash shell

 

upgrade XPEnology 5.1 to 5.2 on ESXi

June 8, 2015|DSM, ESXi, VMware, XPEnology|科技資訊, 電腦編程

Download:

Boot images of XPEnoboot DSM 5.2 from http://xpenology.me/downloads/

Official DSM 5.2 file from https://www.synology.com/en-global/support/download/DS3615xs

Installation:

1. upload XPEnoboot_DS3615xs_5.2-5565.1-9d792e9.vmdk and XPEnoboot_DS3615xs_5.2-5565.1-9d792e9-flat.vmdk to datastore via vSphere client

2. Edit the old boot image hard disk to IDE (0:1)

3. Then add a new Hard disk from the image uploaded above, make it as “Nonpersistent”
DSM5.2-esxi-config

4.  start virtual machine, select “Install/Upgrade” from boot screen, like step 1 in http://www.xpenology.nl/how-to-install-dsm-5-2/

5. click install

DSM5.2-upgarde-1

6. select migration

DSM5.2-upgarde-2

7. upload the official pat file

DSM5.2-upgarde-3

8. after reboot, login, open Control panel, check update. There is an DSM 5.2-5565 Update 1 file, download and upgrade.

9. (optional) after verifying everything okay, remove the old boot image harddisk [IDE(0:1)].

 

Appendix

DSM 5.2 support docker! If I knew it earlier, I may not install ESXi and DSM as vm…

Install XPEnology (DSM) 5.1 on ESXi 6 (HP MicroServer Gen 8)

June 8, 2015|DSM, ESXi, VMware, vSphere, XPEnology|科技資訊, 電腦編程

My installation record. As of today, DSM 5.2 is out. Thanks to XPEnology team, bootloader now support DSM 5.2

Basically follow official documentation:

http://www.xpenology.nl/vmware-esxi-installatie/
http://www.xpenology.nl/installation-dsm-5-1/
http://xpenology.me/downloads/

and somebody’s tutorial

http://seiler.it/vmware-esxi-5-5-installation-hp-proliant-microserver-gen8/
http://www.chiphell.com/thread-867588-1-1.html


 

ESXi (vShpere 6)

For me, my iLo web interface does not support after POST (boot up), so I used unetbootin to expand the HP-VMware ISO file to USB drive.

install vSphere 6 client, manage storage

– got create datastore failure:

Call “HostDatastoreSystem.QueryVmfsDatastoreCreateOptions” for object ‘ha-datastoresystem’ on ESXi [host] failed.

– failure due to my old SSD contains existing partition info: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2007328

solution:
enable SSH access on vshpere
http://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1003808

find disk from #ls -lah /vmfs/devices/disks/ or vSphere client
Then fix and review (should be your own value of naa.xxxxxxx)

Shell
1
2
# partedUtil mklabel /vmfs/devices/disks/naa.60050xxxxxxxxxx msdos
# partedUtil getptbl /vmfs/devices/disks/naa.60050xxxxxxxxxx

reference:

http://www.vexperienced.co.uk/2012/01/02/error-adding-datastores-to-esxi-resolved-using-partedutil/
http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=1008886
http://serverfault.com/questions/537101/how-to-delete-old-linux-partition-with-esxi

 

Installation of DSM 5.1

Then follow the XPEnelogy EXSI version offical installation guide
http://www.xpenology.nl/vmware-esxi-installatie/

– Fail to boot up, “Missing Operating System” error. due to DSM overwrite partition and boot disk info

http://xpenology.com/forum/viewtopic.php?f=15&t=5255
“IDE (0:0) is important because this is the boot disk that starts up XPEnoboot
Non-persistent is important because it prevents the non-booting situation after you do the DSM install. Technical explanation is during DSM install all hard drives get repartitioned including the XPEnoboot drive, the non-persistent setting makes these changes temporary and after a reboot the original XPEnoboot boot partition is returned.”

My fix was delete the VM, re-create VM, set IDE (XPEnoboot_DS3615xs_5.1-5022*) to “non-persistent”, then follow the installation process

after installation complete, boot disk failure again! it’s okay, just shutdown the vm, and start it again, it will load the initial image that boot info does not overwritten by DSM.

– create raw disk mapping

ref: http://xpenology.com/forum/viewtopic.php?f=2&t=2147
use SSH & vsphere client

vsphere: Configuration > Storage Adpaters > HP Dynamic Smart Array B120i RAID Controller > Details
select the targeted disk > right click, copy Identifier to clipboard

SSH to ESXi console.
# vmkfstool --help -z –createrdmpassthru /vmfs/devices/disks/…

Shell
1
# vmkfstools -z /vmfs/devices/disks/naa.60050xxxxxxxxxxxxx /vmfs/volumes/xxxxSSD/DSM/disk2TB.vmdk

– install open-vm-tools
download “open-vm-tools_bromolow-5.1_9.10.0-2476743-1.spk” from http://xpenology.me/downloads/, see link in http://xpenology.com/forum/viewtopic.php?f=2&t=5294

Go to “Package Center” > “Settings” and tick the box “Any Publisher”
Manually install with the downloaded file.

...891011...40...

 

如果你喜歡我的文章,請幫忙按 1-10次 LikeButton 化讚為賞,非常感謝!越喜歡當然可以越按越多 😛

搜尋 Search

簡介 Bio

香港人,現居南十字星空下。

為人貪心,科技、生活、財經、散文 皆有興趣,周身刀冇張利。

思想矛盾,喜歡現在work-life balance 既生活又懷念a city never sleep。

 

每月送我一杯咖啡支持我: liker.land/hang321




分類 Categories

  • 好文閱讀
  • 時事評論
  • 未分類
  • 生活記事
  • 科技資訊
  • 金融財經
  • 電腦編程
  • 音樂電影

文章存檔 Archives




熱門文章 Popular Posts

  • Install XPEnology (DSM) 5.1 on ESXi 6 (HP MicroServer Gen 8)
    Install XPEnology (DSM) 5.1 on ESXi 6 (HP MicroServer Gen 8) June 8, 2015
  • 呢幾日個blogger 有問題….
    呢幾日個blogger 有問題…. October 28, 2004
  • assembly
    assembly February 11, 2006
  • 新工作
    新工作 January 6, 2009
  • 嫁人要嫁工程師
    嫁人要嫁工程師 April 27, 2006

標籤雲 Tag Cloud

CentOS Character chroot Cluster crash cryptography DD-WRT debug Domino DSM Dual Core DWA email ESXi GCP git google HylaFax IE Java Javascript JRE LikeCoin Linux log LotusScript mint MX MySQL nginx PKI PowerShell Qwiklabs srt telent VMware vpn vSphere WinXP wordpress XPEnology 專欄 網絡資訊 選股 風帆

日曆 Calendar

May 2025
M T W T F S S
  « Feb    
 1234
567891011
12131415161718
19202122232425
262728293031  

Follow Me

Follow Us on RSSFollow Us on TwitterFollow Us on YouTube

文章存檔 Archives

Copyright © 2004-2021 hang321.net. All Rights Reserved