美文网首页
重装OMV4时踩到的坑

重装OMV4时踩到的坑

作者: leoatchina | 来源:发表于2020-05-08 12:19 被阅读0次

节前手贱,在装有debian上想用conda安装的zsh代替系统的bash, chsh后又做了一系列现已经想不起具体过程的神操作,无法通过远程登陆上我的nas。
本可尝试登陆本地桌面解决问题,但想起当初装系统时留下了一系列的问题,选择了重装。
然而,虽然不是第一次装debian和omv4,但是仍然踩了几个坑,记下以备忘。

安装时不要选网络源

手头的debian9的u盘一直放在nas边上,安装时也就没去升级debian10+omv4的组合。但是安装时,试过国内的cn2源,华为源, 清华源,全在安装到1143个包左右开始卡机,进度极慢,扔在那数小时之后还只是安装了几个包。
所以在安装时,不能选择net mirror, 直接本地镜像先安装好。在安装后再更换成清华等国内源
先安装包

apt install apt-transport-https ca-certificates

修改成清华源

vim /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free

exfat

apt-get install exfat-fuse exfat-utils

不要把miniconda3的放在PATH的优先位置

个人喜欢用miniconda3装最新版vim,但是发现如果把miniconda3放到PATH里的优先位置,会对系统运行造成一定的影响。
由于不像服务器要装大量工具,最终用自己编译vim的方式。注意+python+python3只能选一个,当然选python3了

./configure --with-features=huge \
  --enable-multibyte \
  --enable-luainterp=yes \
  --enable-perlinterp=yes \
  --enable-python3interp=yes \
  --with-python3-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu \
  --prefix=/usr/local && \
make && make install

最终没有在htpc上装miniconda3

报错,TypeError: 'NoneType' object is not callable

论坛上找到是由于python3.5的bug导致的错误

cd /usr/lib/python3.5
vim weakref.py 
第109行 def remove(wr, selfref=ref(self)) -> def remove(wr, selfref=ref(self), _atomic_removal=_remove_dead_weakref):

第117行_remove_dead_weakref(d, wr.key) -> _atomic_removal(d, wr.key)

一个自动挂载硬盘的脚本

我的nas上顶盖内测面有两个2.5硬盘位,装了一个60g的ssd用于安装系统,另一个1t的硬盘mount到mnt,这两个基本不会动的硬盘就占据了j1800主板上仅有的两个sata口。另外插了一个4口sata扩展卡,用于前置面板处的4个3.5硬盘位。
用下面的python脚本自动挂载3.5硬盘, 目标/srv/disks

#!/usr/bin/env python3
import os
import re
for l in os.popen("ls /dev/disk/by-path"):
    line = l.strip()
    if line.endswith('part1') and '02' in line:
        num = line[-7]
        source_dir   = os.path.join('/dev/disk/by-path', line)
        mount_target = "/srv/disks/disk" + num
        if not os.path.isdir(mount_target):
            os.makedirs(mount_target)
        if os.path.ismount(mount_target):
            os.system('umount ' + mount_target)
        cmd = 'mount ' + source_dir + ' ' + mount_target
        print(cmd)
        os.system(cmd)

for l in os.popen('ls /srv/disks'):
    line = l.strip()
    target = os.path.join('/srv/disks', line)
    if os.path.ismount(target):
        pass
    else:
        try:
            os.rmdir(target)
        except Exception:
            pass

基础服务用omv4内置,权限问题其实很简单

一开始试图用docker去安装各种服务,但是权限问题在引入docker后变得非常复杂。仔细研究了下omv4的内置服务后,发现其实只需要建立一个系统账号就可以应付各种问题

  1. 建立一个用户,我是用share.
  2. 在不同的硬盘路径下分配读写权限, 点左边栏的Access Rights Managerment->Shared Folders
    • 比如前置3.5硬盘位上的disk1和disk2,想整个目录都可以让share读写,那分配硬盘后,直接指定/目录可读写
    • /mnt(原来是/dev/sdb1)下仅transmissiontimemachine等目录可让share读写,那就要明确指定目录
    • 指定方法为点上面的ACLpriveleges

samba和timemachine

  • samba直接添加前面设置好权限的目录
  • timemachine要先安装nettalk插件
    在左边栏里发现Apple Filing后,选中目录,启动 time machine

相关文章

  • 重装OMV4时踩到的坑

    节前手贱,在装有debian上想用conda安装的zsh代替系统的bash, chsh后又做了一系列现已经想不起具...

  • 产品经理踩坑后的吐血总结

    在项目中不止技术人员会踩到许多的坑,对产品经理来说也会踩到不少的坑。 就在这里总结工作多年来所踩到的坑,给刚刚进入...

  • 我踩到的坑

    2020年都3月份,因为疫情的影响,刚开工一周,这是我即上学以来,上班最晚的一年。也是在家里待的最久的一个假期。我...

  • kubebuilder踩到的坑

    https://xinchen.blog.csdn.net/article/details/113089414[h...

  • 有的坑要早踩

    有的坑要早踩好处才大,因为年轻还可以有多次采坑的时间,总结经验知道为什么采坑,踩到了什么坑,而在我们年轻时,父母总...

  • 浅谈dispatch_barrier_(a)sync

    最近在使用dispatch_barrier_async时踩到了坑,随即仔细了解了一下dispatch_barrie...

  • jmeter响应数据不完整问题

    巨坑(如同踩到shi那么恶心) websocket接口请求时,返回的数据不完整。于是找遍了全网,包括jmeter_...

  • Android Selector 踩到的坑

    今天在开发TV项目的时候突然发现Selector 的一个坑,特意分享下正常情况下,按钮状态disable 是下面这...

  • Github自身踩到的坑

    用Github有一两年了,是时候总结一下以前踩得坑了,这些坑开始时还真把自己摔得不轻!!!!!小插曲:自己以前用h...

  • React Native踩到的坑

    好久没写简书了,正好最近又比较有空就研究了一下React Native,目前也就只是按照官网上的教程搭建好了开发环...

网友评论

      本文标题:重装OMV4时踩到的坑

      本文链接:https://www.haomeiwen.com/subject/bkcmghtx.html