2021年7月30日 星期五

Debian 10(LXC) 安裝 Openmediavault 5.x

apt update;apt upgrade -y

echo "deb https://packages.openmediavault.org/public usul main" >> /etc/apt/sources.list.d/omv5.list

apt update
apt install gnupg wget -y
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key
apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc"
apt update

apt-get --yes --auto-remove --show-upgraded \
    --allow-downgrades --allow-change-held-packages \
    --no-install-recommends \
    --option Dpkg::Options::="--force-confdef" \
    --option DPkg::Options::="--force-confold" \
    install openmediavault-keyring openmediavault

omv-confdbadm populate

wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash

Mariadb Server 允許外部設備存取

編輯 /etc/mysql/mariadb.conf.d/50-server.cnf
bind-address            = 0.0.0.0

Debian 安裝 RPM 軟體

安裝相關軟體 alien
apt-get install alien

安裝 RPM 軟體
alien -i package_file.rpm

轉換為 deb 格式
alien package_file.rpm

Linux 時間設定相關指令

date 

hwclock 

timedatectl

timedatectl list-timezones

timedatectl set-local-rtc boolean

timedatectl set-ntp boolean

timedatectl set-ntp yes

systemctl restart systemd-timedated.service

Linux 重新安裝 Grub

sudo mount -t ext4 /dev/sdXY /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt

grub-install /dev/sdX
grub-install --recheck /dev/sdX
update-grub

Linux VLAN 筆記

載入相關 module
modprobe 8021q

查看網路卡資訊
nmcli connection show
ip -d link show

建立 vlan 裝置
ip link add link ens192 name ens192.10 type vlan id 10

刪除 vlan 裝置
ip link delete ens192.10

設定 vlan 裝置 ip
ip addr add 1291.68.10.10/24 dev ens192.10

移除 vlan 裝置 ip
ip addr del 192.168.10.10/24 dev ens192.10