====== My xpenology ====== arc loader | date ^ name ^ code ^ comment ^ | | | | | | 2024-04-21 | xpen-test2 | FGENUHQKL | after update | | 2024-04-21 | xpen-test2 | BBMLK4Z49 | before backup | Backup ====== Idea ====== * Собираем бюджетный домашний NAS на 14 ТБ [[https://habr.com/ru/companies/ruvds/articles/837642/]] * купить [[https://habr.com/ru/articles/775240/|корпус habr]] [[https://www.avito.ru/moskva/tovary_dlya_kompyutera/nas_svoimi_rukami_konstruktor_dlya_sborki_3842504445?utm_campaign=native&utm_medium=item_page_ios&utm_source=soc_sharing|NAS своими руками (конструктор для сборки)]] * купить [[https://aliexpress.ru/item/1005003432672849.html?gatewayAdapt=glo2rus&sku_id=12000025764423059|Ethernet-адаптер 2500 Мбит/с, USB Type-C на RJ45]] * купить низкопрофильный вентилятор [[https://aliexpress.ru/item/1005004565570220.html?sku_id=12000033659734064&spm=a2g2w.productlist.search_results.9.d0671277tFw1ON|Thermalright AXP-90 X36 ]] * низкопрофильный вентилятор [[https://aliexpress.ru/item/1005004058903247.html?aff_platform=true&aff_short_key=_eNJs8N&feed_id=12&isdl=y&sku_id=12000027894253313&src=yandexfree|innovision fan]] ====== Synology News ====== ** Find synology ** http://find.synology.com или http://synologynas:5000 ( synologynas.local:5000 apple) -- Script # Temp and fan echo fan && cat /sys/class/hwmon/hwmon1/device/fan*_input && echo 'temp' && cat /sys/class/hwmon/hwmon0/temp*_input # UPS upsc ups | grep load # Smart get data smartctl -a /dev/sda -d sat lvs -a -o +devices * https://bafista.ru/ * https://nascompares.com/news/synology-2023-nas-confirmed-releases-predictions/ ===== Synology proxmox install ===== \\ ===== Synology Install ===== *Synology on proxmox https://hotstuff.asia/2023/01/03/xpenology-with-arpl-on-proxmox-the-easy-way/ \\ virtual dsm in docker https://xpenology.com/forum/topic/68136-new-virtual-dsm-in-docker/page/4/ - Install community packages source https://packages.synocommunity.com - install packages and dev tools ++ BASH| sh-4.4# synopkg list --name # https://linuxcommandlibrary.com/man/synopkg man of synopkg Docker synocli-kernel ActiveInsight synocli-misc OAuthService synokernel-usbserial SynoFinder synocli-net exFAT-Free HybridShare ScsiTarget synocli-disk Virtualization SMBService PlexMediaServer FileStation Python2 synocli-monitor synocli-file SecureSignIn DownloadStation ReplicationService SnapshotReplication StorageAnalyzer sh-4.4# synopkg install_from_server Node.js_v12 ++ - Diagnostic toold ''sudo synogear install'' ++ BASH| Run iotop tcpdump, pidstat -dlh 20 etc. on Synology DiskStation or RackStation with Synogear without ipkg # https://blog.spaps.de/run-iotop-tcpdump-etc-on-synology-diskstation-or-rackstation-with-synogear/ addr2name kill pidstat sar arping killall ping sid2ugid.sh bash ldd ping6 slabtop cifsiostat log-analyzer.sh pkill sockstat clockdiff lsof pmap speedtest-cli.py dig ltrace prtstat strace domain_test.sh mpstat ps sysctl file name2addr pstree sysstat fix_idmap.sh ncat pwdx tcpdump free ndisc6 rarpd tcpdump_wrapper fuser nethogs rdisc tcpspray gcore nfsiostat-sysstat rdisc6 tcpspray6 gdb nmap rltraceroute6 tcptraceroute6 gdbserver nping rview telnet iftop nslookup rvim time iostat peekfd sa1 tload iotop perf-check.py sa2 top iperf pgrep sadc tracepath iperf3 pidof sadf ++ - Install entware - https://github.com/Entware/Entware/wiki/Install-on-Synology-NAS - Notification to telegram - <''https://api.telegram.org/bot(Токен)/sendMessage?chat_id=(IDчата)&text=Hello+world&user=NAS920&password=Password&to=12345678''> <''https://api.telegram.org/bot(Токен)/getUpdates''> - UPS ++ config| {{:hardware:hardware:synology:pasted:20231125-053835.png?600}} ++ - Synology – Moving a package between volumes - https://bartlaarhoven.nl/posts/synology-move-packages/ [[https://veducate.co.uk/synology-moving-a-package-between-volumes/|DSM6]] ===== Synology boot Loader ===== * update xpenology * Arc Loader https://auxxxilium.tech/redpill/ ====== Synology ====== * loaders https://xpenology.com/forum/topic/61634-dsm-7x-loaders-and-platforms/#comment-281190 * loader https://xpenology.com/forum/topic/65408-automated-redpill-loader-arpl/ * basic command lines CLI synology - https://mariushosting.com/synology-basic-command-lines-for-dsm-7/ * manual https://global.download.synology.com/download/Document/Hardware/HIG/DiskStation/18-year/DS918+/rus/Syno_QIG_DS918_Plus_rus.pdf * https://xpenology.com/forum/topic/62547-tutorial-install-dsm-7x-with-tinycore-redpill-tcrp-loader-on-esxi/ * https://xpenology.com/forum/topic/62221-tutorial-installmigrate-to-dsm-7x-with-tinycore-redpill-tcrp-loader/ * https://www.youtube.com/watch?v=7npsbNCEW2g&ab_channel=%D0%94%D0%9C%D0%98%D0%A2%D0%A0%D0%98%D0%99%D0%9C%D0%90%D0%9A%D0%A1%D0%98%D0%9C%D0%9E%D0%92 ====== Synology monitoring ====== * synology monitoring https://github.com/kernelkaribou/synology-monitoring ====== Synology hardware ====== * find out cpu type https://kb.synology.com/en-uk/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have * [[https://aliexpress.ru/item/1005004158071127.html?spm=a2g0o.store_pc_groupList.8148356.3.3d985f84qFoJGX&pdp_npi=2%40dis%21RUB%219%C2%A0391%2C80%20%D1%80%D1%83%D0%B1.%219%C2%A0391%2C80%20%D1%80%D1%83%D0%B1.%21%21%21%21%21%40211675d216704452085871137ea311%2112000028227145556%21sh&sku_id=12000028227145556|материнская плата]] Innovision atx sata 6.0 * реобас - устройство для подключения и управления вентиляторами ====== CPU mutants - мутанты ====== * https://xeon-e5450.ru/socket-1151/ql2x-ql3x/ * https://www.youtube.com/watch?v=gb5fmwju8yg * https://overclockers.ru/blog/NuJIevik/show/60758/modifikaciya-bios-dlya-processorov-mutantov-6-9-pokoleniya ====== Synology problems resolving ====== * [[https://xpenology.com/forum/topic/50758-let-synology-photos-face-recognition-works-without-gpu-support-forces-with-cpu-in-ds918/#comment-225634|face recognition patch]] * thumbnails in explorer windows - https://github.com/bruhov/WinThumbsPreloader/ * https://www.synology.com/en-us/support/RAID_calculator? * !!! DSM7 918+ NVME cache patch - https://nguyenvinh-net.translate.goog/xpenology-mod-driver-de-nhan-o-nvme-tren-ds918-chay-dsm-7.html?_x_tr_sl=vi&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=sc * !!! grub sata sas configuration https://xpenology.com/forum/topic/32867-sata-and-sas-config-commands-in-grubcfg-and-what-they-do/ * using external disk as internal https://www.droider.org/content/dobavlenie-bolshego-kolichestva-diskov-xpenologysynology https://www.youtube.com/watch?v=eWQCdC1hIow&list=PLhMEv36usktPbSAHaZB-bXjuozcyHyzfn * sata not showing https://www.reddit.com/r/Xpenology/comments/vq2xv6/redpill_71_sata_drives_not_showing/ * example synology commands https://xpenology.com/forum/topic/58072-how-to-have-ds3622xs-recognize-nvme-ssd-cache-drive-maybe-works-on-other-models/ * blog about https://mariushosting.com/category/synology-hardware/ * install on not synology hardware - https://xpenology.com/forum/topic/7848-links-to-loaders/ * tutorial install https://xpenology.com/forum/topic/13333-tutorialreference-6x-loaders-and-platforms/ * **Synology Compile kernel module** https://github.com/jim3ma/synology-igc#3-load-module * instruction https://github.com/robertklep/dsm7-usb-serial-drivers * **Synology ds3622xs Fix nvme ssd cache** https://xpenology.com/forum/topic/58072-how-to-have-ds3622xs-recognize-nvme-ssd-cache-drive-maybe-works-on-other-models/ ====== Synology virtualization ====== * nested virtualization - https://www.reddit.com/r/homelab/comments/tfdw6s/nested_vms_on_a_synology_nas/ * working with disks on direct convert to qcow2 https://www.bjoerns-techblog.de/2019/02/migration-von-synology-vms/ ===== manual expand volume ===== * red hat resize lvm - https://www.redhat.com/sysadmin/resize-lvm-simple * fsck + tunefs help https://baks.dev/article/terminal/fsck-command-in-linux-repair-file-system https://phoenixnap.com/kb/fsck-command-linux # https://web.archive.org/web/20160116172554/http://idmedia.no/projects/xpenology/expand-volume-synolgy-dsm-doesnt-want/ # on linux not synology mdadm --assemble --scan modprobe dm-mod vgscan vgchange -ay vg1000 lvs sudo fsck.ext4 -fvp /dev/vg1000/lv sudo resize2fs -fpF /dev/vg1000/lv # on synology # get information synodisk --enum synodisk --detectfs /volume1 cat /etc/fstab cat /proc/mdstat ++++DSM7 online | # on DSM7 #ame problem here. I finally figured out a workaround. If you look at the help for synostgvolume it'll tell you it can "unmount volume with stopping service". I did synostgvolume --unmount -p /volume1 #Though the NAS did send me an email saying "Volume 1 has crashed", so it clearly didn't safely stop any other processes first. Oops. #But at least once it was unmounted I was able to do everything else as necessary: vgchange -ay fsck.ext4 -vf /dev/mapper/cachedev_0 # to kill all except ssh synpoweroff -d #which looks like it should do what syno_poweroff_task -d did; the help says "will not stop sshd" but it immediately shuts off the NAS so it's useless.) ++++ ++++DSM6 online| # on SYNOLOGY DSM6 process to resize https://web.archive.org/web/20161114073829/http://www.mauchle.name/blog/?p=235 # forum synology https://xpenology.com/forum/topic/1957-guide-how-to-expand-the-volume-if-dsm-doesnt-want-to/page/3/ # 1.enable ssh open winscp with root user: syno_poweroff_task -d # (turns everything off except ssh) vgchange -ay vg1 # (this is the volume name from cat /etc/fstab) fsck.ext4 -v -n -f /dev/mapper/vg1-volume_2 # (no changes) cat /etc/fstab umount /volume1 mount # (check if volume is unmounted) fsck.ext4 -fvp /dev/mapper/vg1-volume_2 fsck.ext4 -v -n -f /dev/mapper/vg1-volume_2 dmesg lvextend -l +100%FREE /dev/mapper/vg1-volume_2 resize2fs -fpF /dev/mapper/vg1-volume_2 tune2fs -l /dev/mapper/vg1-volume_2 ++++ ===== Synology Move packages to another volume ===== * base script https://github.com/JeffersonDing/SynologyMerge * cmds # find symbolic links find . -type l -ls # recursive links find -type l -not \( -path "./volume*" -o -path "./sys*" -o -path "./dev*" -o -path "./proc*" -o -path "./tmp*" -prune \) -ls > /tmp/links.txt # find broken symbolic links find . -type l ! -exec test -e {} \; -print # if has stat b=$(find / -type l); for i in $(echo $b); do stat $i ; done |grep -i broken 2> /dev/null ===== Cloning single disk drive to multiple drives simultaneously ===== tools for clone disk like dc3dd and clonezilla ++++or bash dd| #https://superuser.com/questions/145516/cloning-single-disk-drive-to-multiple-drives-simultaneously You can use bash's "process substitution" along with the tee command to do this: cat drive.image | tee >(dd of=/dev/sda) >(dd of=/dev/sdb) >(dd of=/dev/sdc) | dd of=/dev/sdd or for clarity (at the expense of a little efficiency) you can make the last dd be called the same way as the others and send the stdout of tee to /dev/null: cat drive.image | tee >(dd of=/dev/sda) >(dd of=/dev/sdb) >(dd of=/dev/sdc) >(dd of=/dev/sdd) | /dev/null and if you have it installed you can use pipe viewer instead of cat to get a useful progress indicator: pv drive.image | tee >(dd of=/dev/sda) >(dd of=/dev/sdb) >(dd of=/dev/sdc) | dd of=/dev/sdd This reads ++++ ====== Synology Restore ====== * https://kb.synology.com/ru-ru/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC ====== Synology Diagnostic tool ====== * DSM7 install Entware https://github.com/Entware/Entware/wiki/Install-on-Synology-NAS * DSM7 ''sudo synogear install'' https://mariushosting.com/synology-how-to-install-diagnosis-tool/ * hot swap manual delete - rescan - https://blog.kihltech.com/2012/12/sata-hotswap-drive-in-mdadm-raid-array/ ++++Linux sata manual rescan| #When a drive has failed in some circumstances Linux won't realise you've actually pulled it physically from the array. If you have that problem (as I did this morning) #you can do the following: echo 1 > /sys/block//device/delete #e.g., in my case, /dev/sda had failed and I didn't want to reboot the server, so I did: echo 1 > /sys/block/sda/device/delete #After I did that, the new drive (which had actually been physically added already) was immediately visible. #If it is not visible at this point, you can also do this to force a re-scan: echo "- - -" > /sys/class/scsi_host/host/scan # That "- - -" is wildcards for channel, id & LUN respectively, so you can restrict the scan to some subset if you want by specifying numbers instead. # Before you start, you could also: readlink /sys/block/ # Which will show you the path with the right host number to check in /proc/scsi/scsi for disappearence after removal. ++++ ====== Synology photo ====== one of best choice * https://www.photoprism.app/ - one of best for synology * https://immich.app/ ====== Synology packages ====== https://packages.synocommunity.com/ \\ https://synology.sysco.ch \\ https://www.cphub.net \\ https://packages.pcloadletter.co.uk \\ https://packages.jdel.org/ \\ https://synopackage.com/repository/spk/All \\ http://synology.acmenet.ru \\ http://packages.pcloadletter.co.uk ====== Synology package creation ====== * https://www.blackvoid.club/wireguard-spk-for-your-synology-nas/ ====== Synology destroy drive from superblock and meta data ====== # удалить superblock + meta data $ SIZE=$(( $(blockdev --getsz $YOUR_DEV) - 10240 )) $ dd if=/dev/zero of=$YOUR_DEV bs=512 count=10240 $ dd if=/dev/zero of=$YOUR_DEV bs=512 seek=$SIZE count=10240 ====== Synology surveillance CCTV ====== * https://saniaowner.space/2021/12/04/synology-surveillance-station-vzlomannaya-versiya/ * https://habr.com/ru/post/700484/ photo - to telegram https://www.reddit.com/r/homeassistant/comments/ue3p0m/home_assistant_synology_surveillance_station/ https://www.reddit.com/r/synology/comments/a1smun/surveillance_station_to_telegram/ * https://bafista.ru/xpenology-surveillance-station-patch-liczenzij-na-56-kamer/ ====== Synology DSM ====== * Cross compilation framework to create native packages - https://github.com/SynoCommunity/spksrc/wiki/FAQ-SynoCliDisk * synology source code https://xpenology.com/forum/topic/56098-dsm-70-kernel-source-missed-for-over-half-a-year/#comment-263382 * synology kernel module compilation example - https://github.com/kyzia/Xpenology/blob/master/README.md ([[https://yulistic.gitlab.io/2017/10/compiling-kernel-module-only-w/o-whole-kernel-compilation/| onlu module without kernel]]) ([[https://github.com/jim3ma/synology-igc#build-in-synology-develop-environment|Intel igc]] ====== Interesting ====== for synology * dashy * nodered * z2m * mosquitto * syncthing * influxdb/grafana/chronograf/telegraf * gitea * freshrss * rsshub * vaultwarden * traefik * esphome * minio * kms_server * photoprism scheme {{:hardware:pasted:20230826-085115.png}} ====== My Xpen ====== {{gallery>hardware:pasted:?20231014*&4&150x150&lightbox }} ===== My hardware ===== * [[https://aliexpress.ru/item/1005004540711069.html?sku_id=12000029536295506&spm=a2g2w.stores.seller_list.1.e5762a00fC0993|корзина hot-swap]] * вентиляторы - [[https://ozon.ru/t/AM6wy6Z|Arctic P8 PWM ]]4 + [[https://aliexpress.ru/item/4000774030622.html?spm=a2g2w.orderdetail.0.0.980e4aa660SnhC&sku_id=12000018441074112|ШИМ PWM Fan Speed governor]] - для температурного управления и остановки * БП flex -> 500 watt - текущее потребление ~50w * отдельно стоит отметить отличную [[https://aliexpress.ru/item/1005004158038236.html|MB от innovision]] * LGA-1151 - b360 * 6*SATA 3.0 + 2*M.2 nvme на борту * +2 x 2.5 GB ethernet штатно **по ощущения от корпуса 4/5 от MB 5/5** ==== Fan ==== * приличные вентиляторы не шумят <30 db , слышно шпиндели и головки ранее использовал sunon(подшипник с магнитным подвесом) - надёжнее но громче, noctua дорого и после переехал в рабочее место оно ближе и должно быть тише ==== Scheme ==== {{ :hardware:synology:network_diagram.svg |}} ==== conclusion ==== * блок питания flex дорого и экономить на нём нельзя, * верхних вентиляторов штатно нет - доработка, * индикации под LCD экран нет, - готовлю отдельный вырез на морде.