要修改MAC/SN,需要修改启动配置文件grub.cfg,有两种方法: 直接PE启动,然后加载ssd第一个分区就能找到文件
SSH在线修改
个人觉得SSH在线修改更方便,具体操作如下: 1. 开放SSH端口 在控制面板里面–>终端机和SNMP下,启动SSH功能.
2. SSH工具挂载synoboot1分区用ssh工具如putty连接到群晖的ip地址,用创建群晖的管理用户登陆.
例如,用户名:admin 密码 123456
输入如下命令: [url=][/url]
1 sudo -i //获取root超级权限2 mkdir -p /tmp/boot //在/tmp目录下创建一个临时目录,名字随意,如:boot3 cd /dev //切换到dev目录4 mount -t vfat synoboot1 /tmp/boot/ //将synoboot1 分区挂载到boot5 cd /tmp/boot/grub //切换到grub目录6 vim grub.cfg //修改grub.cfg文件[url=][/url]
按键盘上的 i 键(小写状态),进入文档编辑模式,此时就可以输入新的SN,MAC1的新值,删除旧值. 修改完成后. 按键盘上的Esc键,返回到命令模式,输入:wq,然后回车保存并退出.如果修改乱了,想不保存并退出,则是输入:q,然后回车. 此时可以再 vi grub.cfg 进去看看是否修改成功. 最后重启主机即可: 1 reboot
硬盘显示
针对问题2,硬盘盘符乱,这款B款蜗牛有两个SATA控制器,有6个SATA接口(包含一个mSATA接口).处理器控制2个能引导的接口(内存旁边的一个和mSATA),板载控制器控制4个硬盘架的接口但不能引导.
1. 硬盘位的顺序 装好DSM后硬盘顺序应该是处理器控制的两个接口在前(假设为1、2),控制硬盘架上的四个接口在后(假设为3、4、5、6).所以只要是放在硬盘架上的硬盘在DSM都会标识在3号到6号盘之间. 若需要将硬盘架上的顺序改为1、2、3、4号标识,可以修改引导盘里的grub.conf配置文件来实现.
修改盘序号需要在extra_args_918变量里增加两个值SataPortMap=24和DiskIdxMap=0400.
即: [url=][/url]
1 # /grub/grub.conf2 # 从第31行开始3 ......4 set extra_args_918='SataPortMap=24 DiskIdxMap=0400' #将两项加在这后面5 6 set common_args_918='syno_hdd_powerup_seq=0 HddHotplug=0 syno_hw_version=DS918+ vender_format_version=2 console=ttyS0,115200n8 withefi elevator=elevator quiet syno_port_thaw=1'7 # for testing on VM8 set sata_args='SataPortMap=1'9 ......[url=][/url]
修改完成后保存重启,我的硬盘是从左至右放在左边两个盘位中的所以是3号和4号位.
如果盘位顺序还是有误,需要把主板连接的SATA物理更换一下,交换位置就正常了. 简单解释下这两个值:
具体的含义可以参考此处的第229行和249行: 1 SataPortMap=24
配置系统有两个SATA控制器,第一个控制器有2个接口,第二个控制器有4个接口. 1 DiskIdxMap=0400
将第一个SATA控制器的接口序号设置为从5开始,第二个SATA控制器的接口号从1开始(04和00都为16进制).
2. 用SSD引导后隐藏启动盘 直接把启动镜像写入到mSATA盘里面,存储空间管理员里面会有一个14G左右的盘始于未使用状态,就是mSATA盘里除开启动分区后的剩余空间,像下面一样: 可以将其初始化并利用起来,但14G的空间利用起来也没什么价值,且本来自带的SSD就很弱,用来存资料也有一定崩盘的风险.为了防止看着碍眼,可以用上面的方法把这个盘隐藏掉.
还是需要通过修改引导盘里的grub.conf配置文件来实现.
需要在sata_args变量里增加DiskIdxMap=1000这个值,且在启动时选择第三项启动项(VMware/ESXI)启动.
即: [url=][/url]
1 # /grub/grub.conf2 # 从第31行开始3 ......4 set extra_args_918=''5 6 set common_args_918='syno_hdd_powerup_seq=0 HddHotplug=0 syno_hw_version=DS918+ vender_format_version=2 console=ttyS0,115200n8 withefi elevator=elevator quiet syno_port_thaw=1'7 # for testing on VM8 set sata_args='SataPortMap=24 DiskIdxMap=1000'# 将两项加在这后面(10,00都为16进制)9 ......[url=][/url]
3. 信息中心显示的处理器的型号 装好DSM系统以后,信息中心显示的是白群晖机器的处理器信息,比如DS3617系统就显示的是Xeon D处理器的信息,很明显是直接写死的.
- 下载ch_cpuinfo_en.tar在电脑上,[这里下载]
- 通过FileStation将下载好的文件上传到DSM上
- 用Putty或者其他SSH工具连接上DSM
- 在SSH工具中操作
[url=][/url]
1 # 切换到root账户; 2 sudo -i 3 4 # 打开ch_cpuinfo.tar文件所在目录; 5 cd /volume1/tmp 6 7 # 解压ch_cpuinfo.tar文件; 8 tar xvf ch_cpuinfo.tar 9 10 # 运行ch_cpuinfo文件;11 ./ch_cpuinfo12 13 # 运行后,按“1”选择“First Run”,再按“y”键;14 15 # 关闭SSH工具,重新登陆后信息中心显示J1900信息;[url=][/url]
休眠 1. 打开休眠调试日志 这个选项藏得比较深,在左上角菜单→技术支持中心→左边技术支持服务→启动系统休眠调试模式 2. 等待触发休眠问题 保持 NAS 空闲到设定的时间即可.记得把 NAS 的网页和各种客户端都关掉,不然接下来的日志可能会很长没法分析.我自己是在睡觉之前打开日志,起来分析.睡觉的时候除了 NAS 和路由器就没有其他设备开机了,日志很准确. 3. 分析日志 会产生两份日志,分别是 /var/log/hibernation.log 和 /var/log/hibernationFull.log. 后者是原始数据,前者是去除了一些无价值“连锁性”操作的精简版,但它有的时候会精简过头,所以我这里以后者为例来分析. 首先,将脏块写入磁盘的日志手动排除掉.通常内核不会自发进行大量的磁盘操作,大多数 write block 是用户态 dirty block 导致的结果,因此可以把包含 WRITE block 和 sync 的行删除,节省大量的版面. 其次,将非硬盘的写入排除掉.将包含 on tmpfs 或 on proc 的行删除即可,剩下的非硬盘文件系统肉眼忽略. 剩下的条目可以进入分析了.比如我这里在午睡时每段记录都差不多是这个样子: [url=][/url]
1 ***********Clear********* 2 [140146.388709] btsync(15253): dirtied inode 11404 (sync.log) on md2 3 [140146.388721] btsync(15253): dirtied inode 11404 (sync.log) on md2 4 [140146.388723] btsync(15253): dirtied inode 11404 (sync.log) on md2 5 [140151.820668] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md0 6 [140151.820682] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md0 7 [140151.820684] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md0 8 [140152.332689] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md0 9 [140152.332696] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md010 [140152.332698] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md011 [140153.783855] btsync(15253): dirtied inode 11404 (sync.log) on md212 [140153.783870] btsync(15253): dirtied inode 11404 (sync.log) on md213 [140153.783872] btsync(15253): dirtied inode 11404 (sync.log) on md214 [140170.602870] synologrotated(4963): dirtied inode 28083 (.SYNOSYSDB-wal) on md015 [140170.602888] synologrotated(4963): dirtied inode 29789 (.SYNOSYSDB-shm) on md016 [140170.603221] synologrotated(4963): dirtied inode 21538 (.SYNOCONNDB-wal) on md017 [140170.603235] synologrotated(4963): dirtied inode 22044 (.SYNOCONNDB-shm) on md018 [140173.443684] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md019 [140173.443696] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md020 [140173.443698] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md021 [140173.955999] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md022 [140173.956006] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md023 [140173.956009] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md024 [140272.465248] btsync(15253): dirtied inode 11404 (sync.log) on md225 [140272.465265] btsync(15253): dirtied inode 11404 (sync.log) on md226 [140272.465267] btsync(15253): dirtied inode 11404 (sync.log) on md227 [140278.386378] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md028 [140278.386390] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md029 [140278.386393] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md030 [140278.898561] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md031 [140278.898569] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md032 [140278.898571] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md033 [140631.564198] btsync(15253): dirtied inode 11404 (sync.log) on md234 [140631.564209] btsync(15253): dirtied inode 11404 (sync.log) on md235 [140631.564211] btsync(15253): dirtied inode 11404 (sync.log) on md236 [140637.298101] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md037 [140637.298113] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md038 [140637.298115] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md039 [140637.811061] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md040 [140637.811068] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md041 [140637.811071] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md042 [141346.340822] btsync(15253): dirtied inode 11404 (sync.log) on md243 [141346.340833] btsync(15253): dirtied inode 11404 (sync.log) on md244 [141346.340836] btsync(15253): dirtied inode 11404 (sync.log) on md245 [141351.508216] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md046 [141351.508226] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md047 [141351.508228] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md048 [141352.021228] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md049 [141352.021235] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md050 [141352.021238] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md051 [141352.494749] btsync(15253): dirtied inode 11404 (sync.log) on md252 [141352.494758] btsync(15253): dirtied inode 11404 (sync.log) on md253 [141352.494760] btsync(15253): dirtied inode 11404 (sync.log) on md254 [141371.039633] synologrotated(4963): dirtied inode 28083 (.SYNOSYSDB-wal) on md055 [141371.039654] synologrotated(4963): dirtied inode 29789 (.SYNOSYSDB-shm) on md056 [141371.039992] synologrotated(4963): dirtied inode 21538 (.SYNOCONNDB-wal) on md057 [141371.040007] synologrotated(4963): dirtied inode 22044 (.SYNOCONNDB-shm) on md058 [141377.244527] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md059 [141377.244539] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md060 [141377.244541] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md061 [141377.757046] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md062 [141377.757054] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md063 [141377.757056] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md064 [141535.911703] dhclient(16778): dirtied inode 19635 (sh) on md065 [141535.911717] dhclient(16778): dirtied inode 19626 (bash) on md066 [141535.911909] dhclient-script(16778): dirtied inode 14958 (libncursesw.so.5) on md067 [141535.911917] dhclient-script(16778): dirtied inode 13705 (libncursesw.so.5.9) on md068 [141535.914460] awk(16782): dirtied inode 13819 (libm.so.6) on md069 [141535.914470] awk(16782): dirtied inode 11177 (libm-2.20-2014.11.so) on md070 [141542.431766] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md071 [141542.431778] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md072 [141542.431781] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md073 [141542.944314] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md074 [141542.944322] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md075 [141542.944324] syno_hibernatio(25655): dirtied inode 5348 (hibernation.log) on md076 [142073.169495] btsync(15253): dirtied inode 11404 (sync.log) on md277 [142073.169512] btsync(15253): dirtied inode 11404 (sync.log) on md278 [142073.169515] btsync(15253): dirtied inode 11404 (sync.log) on md279 [142078.947137] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md080 [142078.947150] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md081 [142078.947152] syno_hibernatio(25655): dirtied inode 5885 (hibernationFull.log) on md082 uptime : [142078.753468]83 ======Idle 536 seconds======84 Sat Oct 27 14:34:19 CST 2018[url=][/url]
进程不多,逐个判断: btsync:BTSync 套件,sync.log 顾名思义好了.这样看来,它频繁写日志是一个很明显的阻碍休眠的原因.我反正只是装着,没配置它,可以把它删掉. syno_hibernatio:ps | grep 看一下发现全称是 syno_hibernation_debug,加之操作的文件名,确定是记录休眠日志的工具自身,以后关了就没了 synologrotated:应该是记录系统日志的工具,如果正经休眠了应该就不会有日志了,这也是个被动来源 dhclient 和 dhclient-scriptHCP 客户端常规操作,阻挡不了 那么这一轮下来只能得出需要停止 BTSync 的结论.先这么做了再说.休眠日志可以不急着关掉.
再放一天试试.查看系统日志: 从日志来看,上面的操作是有效的,硬盘终于能进入休眠了,出现了很多“Internal disks woke up from hibernation”.但是这每半小时一条,相当于休眠没几秒又被唤醒了. 于是继续分析休眠日志: [url=][/url]
1 ***********Clear********* 2 [236666.547745] syslog-ng(4331): dirtied inode 18 (scemd.log) on md0 3 [236687.650564] syslog-ng(13085): dirtied inode 18 (scemd.log) on md0 4 [236687.650585] syslog-ng(13085): dirtied inode 18 (scemd.log) on md0 5 [236687.650592] syslog-ng(13085): dirtied inode 18 (scemd.log) on md0 6 [236687.658884] syslog-ng(5016): dirtied inode 28581 (.SYNOSYSDB-shm) on md0 7 [236687.658893] syslog-ng(5016): dirtied inode 28581 (.SYNOSYSDB-shm) on md0 8 [236687.658946] syslog-ng(5016): dirtied inode 24584 (.SYNOSYSDB-wal) on md0 9 [236687.658952] syslog-ng(5016): dirtied inode 24584 (.SYNOSYSDB-wal) on md010 [236687.658954] syslog-ng(5016): dirtied inode 24584 (.SYNOSYSDB-wal) on md011 [236687.664164] logrotate(13090): dirtied inode 41594 (synolog) on md012 [236687.666146] logrotate(13090): dirtied inode 6900 (logrotate.status) on md013 [236687.671082] logrotate(13090): dirtied inode 7905 (logrotate.status.tmp) on md014 [236689.662143] synologaccd(4840): dirtied inode 22952 (.SYNOACCOUNTDB) on md015 [236689.662355] synologaccd(4840): dirtied inode 6900 (.SYNOACCOUNTDB-wal) on md016 [236689.662383] synologaccd(4840): dirtied inode 21526 (.SYNOACCOUNTDB-shm) on md017 [236689.763593] synologaccd(4840): dirtied inode 22952 (.SYNOACCOUNTDB) on md018 [236689.763629] synologaccd(4840): dirtied inode 22952 (.SYNOACCOUNTDB) on md019 [236691.547334] synologrotated(5000): dirtied inode 28581 (.SYNOSYSDB-shm) on md020 [236691.547681] synologrotated(5000): dirtied inode 23485 (.SYNOCONNDB-wal) on md021 [236691.547695] synologrotated(5000): dirtied inode 24677 (.SYNOCONNDB-shm) on md022 [238511.431135] syslog-ng(4331): dirtied inode 18 (scemd.log) on md023 uptime : [238516.475108]24 ======Idle 1807 seconds======25 Wed Oct 24 03:52:06 CST 201826 #####################################################27 Only idle 44 seconds, pass28 Wed Oct 24 03:52:51 CST 201829 #####################################################30 ***********Clear*********31 [238522.209123] synologrotated(5000): dirtied inode 24584 (.SYNOSYSDB-wal) on md032 [238522.209173] synologrotated(5000): dirtied inode 28581 (.SYNOSYSDB-shm) on md033 [238522.210082] synologrotated(5000): dirtied inode 23485 (.SYNOCONNDB-wal) on md034 [238522.210122] synologrotated(5000): dirtied inode 24677 (.SYNOCONNDB-shm) on md035 [238522.224252] logrotate(19321): dirtied inode 41594 (synolog) on md036 [238522.229880] logrotate(19321): dirtied inode 7905 (logrotate.status) on md037 [238522.244528] logrotate(19321): dirtied inode 6900 (logrotate.status.tmp) on md038 [238531.967854] syslog-ng(19324): dirtied inode 18 (scemd.log) on md039 [238531.967874] syslog-ng(19324): dirtied inode 18 (scemd.log) on md040 [238531.967882] syslog-ng(19324): dirtied inode 18 (scemd.log) on md041 [238531.990488] logrotate(19329): dirtied inode 6900 (logrotate.status.tmp) on md042 [238533.979174] synologaccd(4840): dirtied inode 22952 (.SYNOACCOUNTDB) on md043 [238533.979348] synologaccd(4840): dirtied inode 7905 (.SYNOACCOUNTDB-wal) on md044 [238533.979378] synologaccd(4840): dirtied inode 21526 (.SYNOACCOUNTDB-shm) on md045 [238534.076345] synologaccd(4840): dirtied inode 22952 (.SYNOACCOUNTDB) on md046 [238534.076385] synologaccd(4840): dirtied inode 22952 (.SYNOACCOUNTDB) on md047 [240368.320927] syslog-ng(4331): dirtied inode 18 (scemd.log) on md048 uptime : [240374.147000]49 ======Idle 1811 seconds======50 Wed Oct 24 04:23:02 CST 2018[url=][/url]
synocrond:听起来像是任务计划程序,里面有个 DSM 自动更新检查,触发频率不高,应该不太影响 builtin-synodat:不知道是什么 logrotate:大概也是个日志程序 synologaccd:继续是日志程序 syslog-ng:我也不知道为什么群晖有那么多日志管理程序 单次日志看不出来什么,但是连着好几块都符合刚一休眠就被唤醒(空闲时间是设定的 30 分钟加十几秒),且最后一条都是对 (/var/log/)scemd.log 的写入。这就有点意思了,打开看看里面是什么: [url=][/url]
1 2018-10-24T07:00:13+08:00 Hamster-DS scemd: led/led_brightness.c:244 Fail to read /usr/sbin/i2cget 2 2018-10-24T07:00:13+08:00 Hamster-DS scemd: led.c:35 SYNOGetLedBrightness fail() 3 2018-10-24T07:00:34+08:00 Hamster-DS scemd: event_disk_hibernation_handler.c:42 The internal disks wake up, hibernate from [Oct 24 07:00:11] 4 2018-10-24T07:31:09+08:00 Hamster-DS scemd: led/led_brightness.c:244 Fail to read /usr/sbin/i2cget 5 2018-10-24T07:31:09+08:00 Hamster-DS scemd: led.c:35 SYNOGetLedBrightness fail() 6 2018-10-24T07:31:30+08:00 Hamster-DS scemd: event_disk_hibernation_handler.c:42 The internal disks wake up, hibernate from [Oct 24 07:31:07] 7 2018-10-24T08:01:53+08:00 Hamster-DS scemd: led/led_brightness.c:244 Fail to read /usr/sbin/i2cget 8 2018-10-24T08:01:53+08:00 Hamster-DS scemd: led.c:35 SYNOGetLedBrightness fail() 9 2018-10-24T08:02:14+08:00 Hamster-DS scemd: event_disk_hibernation_handler.c:42 The internal disks wake up, hibernate from [Oct 24 08:01:53]10 2018-10-24T08:32:37+08:00 Hamster-DS scemd: led/led_brightness.c:244 Fail to read /usr/sbin/i2cget11 2018-10-24T08:32:37+08:00 Hamster-DS scemd: led.c:35 SYNOGetLedBrightness fail()12 2018-10-24T08:32:59+08:00 Hamster-DS scemd: event_disk_hibernation_handler.c:42 The internal disks wake up, hibernate from [Oct 24 08:32:37][url=][/url]
清晰地表明了这就是休眠后立即唤醒的原因:由于黑群没有 I2C 设备,于是 DSM 在休眠后尝试更改 LED 亮度(或者颜色、闪烁规律?)时读取 i2c 设备节点就会出错,scemd 把这条错误信息记到自己的日志里,触发了硬盘写入,硬盘就在休眠十几秒后被唤醒了. 4. 修复 根本上修复的话,得硬件上 I2C 适配器,甚至还能顺便给黑群加上白群的那么多灯.但这是不现实的,那么我们就只能采取主流方法:解决提出问题的日志.预想方案是把这个日志文件指向内存,让 scemd 往内存里写,就不会唤醒硬盘了.
找到文件: 1 vim /etc.defaults/syslog-ng/patterndb.d/scemd.conf
修改 1 destination d_scemd { file("/var/log/scemd.log"); };2 为3 destination d_scemd { file("/tmp/scemd.log"); };
重启系统即可完美休眠. 本文来源于互联网,经过作者验证后发布,收藏作为后期查阅使用。
|