作者归档:admin

linux 挂载 nfs/dav/smb 文件系统

NFS

sudo apt install -y nfs-common
sudo mount.nfs ip:port /mnt

DAV

sudo apt install -y davfs2
sudo mount.davfs -o noexec http://ip:port /mnt

更多:

How to mount WebDAV share

https://sleeplessbeastie.eu/2017/09/04/how-to-mount-webdav-share/embed/#?secret=i25ATGJKQR

SMB

sudo mount.cifs //ip/target /mnt/dir -o vers=1.0,username=guest,password=

参数 vers 还可以是 2.03.0

更多:
https://zhuanlan.zhihu.com/p/26763026

附:群晖启用 NFS

  • 控制面板 > 文件服务 > NFS > 「启动 NFS 服务」打勾
  • 控制面板 > 共享文件夹 > 选择一个共享文件夹 > 编辑 > NFS 权限 > 创建/编辑
    • 主机名:* 192.168.0.0/24
    • Squash:映射 root 为 admin
    • 安全性:sys
    • 启动异步
    • 允许来自非特权端口的连接
    • 允许用户访问已装载的子文件夹

ubuntu 安装 podman

安装:

# ubuntu 用户运行
. /etc/os-release
# mint 20.x 用户运行
# export VERSION_ID=20.04
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install podman

注销并重新登录,或:

systemctl --user restart dbus

linux 手动释放缓存

sync && echo 1 > /proc/sys/vm/drop_caches

执行 echo N > /proc/sys/vm/drop_caches,再free –m查看内存使用情况,输入不同的N值,free –m内存中缓存buffers会有差异,现在我们就是要解释/proc/sys/vm、drop_caches, 这个文件到底是什么?另外可以写入哪些数值,具体适用于什么场景

查看linux内核文档,可以得到以下信息:

centos 7 设置应用最大连接数

修改 /etc/systemd/system.conf ,添加如下配置项:

[Manager]
DefaultLimitCORE=infinity
DefaultLimitNOFILE=10240000
DefaultLimitNPROC=10240000

使配置生效:

sudo systemctl daemon-reload

用户服务需要重启,如:

sudo systemctl restart nginx

验证:

cat /proc/[PID]/limits

PVE 退出群集的操作步骤

停止cluster 服务

systemctl stop pve-cluster.service
systemctl stop corosync.service

设置本地模式

pmxcfs -l

删除corosync 配置文件

rm /etc/pve/corosync.conf
rm -rf /etc/corosync/*

重启cluster集群服务

killall pmxcfs
systemctl start pve-cluster.service

删除 WEB-UI 上的除当前 node 外的 node

cd /etc/pve/nodes
rm -rf node_name

windows 10 更新后恢复 manjaro 引导菜单

针对 manjaro ,但理论上适用于大多数 linux 系统。

先用 live 启动盘引导进入系统,按如下操作进行。

[manjaro@manjaro ~]$ lsblk -f
NAME       FSTYPE   FSVER            LABEL           UUID                                 FSAVAIL FSUSE% MOUNTPOINT
loop0      squashfs 4.0                                                                         0   100% /run/miso/sfs/livefs
loop1      squashfs 4.0                                                                         0   100% /run/miso/sfs/mhwdfs
loop2      squashfs 4.0                                                                         0   100% /run/miso/sfs/desktopfs
loop3      squashfs 4.0                                                                         0   100% /run/miso/sfs/rootfs
sda
├─sda1     vfat     FAT32                            4A57-1A41
├─sda2     ext4     1.0                              5a7f0113-2ab5-4a25-98a3-358be7bbd046
├─sda3     ext4     1.0                              652bd7bc-3c24-4179-899a-46695bdea7ae
├─sda4     ext4     1.0                              2b250d50-80b3-4793-b886-6a3195f0c0a4
├─sda5     ntfs                                      DA18EBFA09C1B27D
├─sda6     ntfs                                      D47AD6687AD646C0
└─sda7     swap     1                                28f96a74-9308-4885-a65b-dc2f6bed4fa5
[manjaro@manjaro ~]$ sudo -i
[manjaro ~]# mount /dev/sda4 /mnt/
[manjaro ~]# mount /dev/sda1 /mnt/boot/
efi/                                initramfs-5.10-x86_64-fallback.img  intel-ucode.img                     memtest86+/
grub/                               initramfs-5.10-x86_64.img           linux510-x86_64.kver                vmlinuz-5.10-x86_64
[manjaro ~]# mount /dev/sda1 /mnt/boot/efi/
[manjaro ~]# cd /mnt/
[manjaro mnt]# mount -t proc proc /mnt/proc
[manjaro mnt]# mount -t sysfs sys /mnt/sys
[manjaro mnt]# mount -o bind /dev /mnt/dev
[manjaro mnt]# mount -t devpts pts /mnt/dev/pts
[manjaro mnt]# modprobe efivarfs
[manjaro mnt]# chroot /mnt/
[manjaro /]# mount -t efivarfs efivarfs /sys/firmware/efi/efivars
[manjaro /]# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
Installing for x86_64-efi platform.
Installation finished. No error reported.
[manjaro /]# update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.10-x86_64.img
Found initrd fallback image: /boot/initramfs-5.10-x86_64-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
It's output will be used to detect bootable binaries on them and create new boot entries.
Found Linux Mint 20.1 Ulyssa (20.1) on /dev/sda2
Adding boot menu entry for UEFI Firmware Settings ...
Found memtest86+ image: /boot/memtest86+/memtest.bin
done
[manjaro /]#