PVE 工具1(PVE_Source)
pve_source是pve脚本可以更方便的初始化PVE,打开Shell粘贴如下命令
wget -q -O /root/pve_source.tar.gz 'https://bbs.x86pi.cn/file/topic/2023-11-28/file/01ac88d7d2b840cb88c15cb5e19d4305b2.gz' && tar zxvf /root/pve_source.tar.gz && /root/./pve_source
rticle/details/133036227
PVE 工具2,安装Pve Tools
在shell里
安装Pve Tools
export LC_ALL=en_US.UTF-8 apt update && apt -y install git && git clone https://github.com/ivanhao/pvetools.git
启动工具
cd pvetools
./pvetools.sh
nano /etc/sudoers
sudo apt-get install chromium chromium-driver
qm set 100 -sata1 /dev/disk/by-id/ata-ST2000DL003-9VT166_5YD5BZPV
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt pcie_acs_override=downstream"
GRUB_CMDLINE_LINUX_DEFAULT=”quiet intel_iommu=on iommu=pt”
qm importdisk 101 /var/lib/vz/template/iso/openwrt-04.06.2024-x86-64-generic-squashfs-combined.img local-lvm
备份官方软件源
cp /etc/apt/sources.list /etc/apt/sources.list.backup
pve_source是pve脚本(首发于X86派论坛),可以更方便的初始化PVE,打开Shell粘贴如下命令。
wget -q -O /root/pve_source.tar.gz 'https://bbs.x86pi.cn/file/topic/2023-11-28/file/01ac88d7d2b840cb88c15cb5e19d4305b2.gz' && tar zxvf /root/pve_source.tar.gz && /root/./pve_source
PVE 工具2,安装Pve Tools
在shell里
安装Pve Tools
export LC_ALL=en_US.UTF-8 apt update && apt -y install git && git clone https://github.com/ivanhao/pvetools.git
启动工具
cd pvetools
./pvetools.sh
————————————————
echo "nameserver 8.8.8.8" >> /etc/resolv.conf && rm -rf pvetools && rm -rf /etc/apt/sources.list.d/pve-enterprise.list && export LC_ALL=en_US.UTF-8 && apt update && apt -y install git && git clone https://github.com/ivanhao/pvetools.git && echo "cd /root/pvetools && ./pvetools.sh" > pvetools/pvetools && chmod +x pvetools/pvetools* && ln -s /root/pvetools/pvetools /usr/local/bin/pvetools && pvetools
ctrl + X ---->y----->
更新软件源
apt update && apt upgrade
验证新软件源
apt-get check
更新系统
一键替换国内源
wget https://www.geekxw.top/jiaoben/yuan.sh -O yuan.sh && chmod +x yuan.sh && ./yuan.sh
apt update
apt dist-upgrade
y-----
更新软件源
apt update && apt upgrade
验证新软件源
apt-get check
sudo apt update
sudo apt upgrade
安装KDE桌面环境
sudo apt install kde-plasma-desktop
安装常用应用程序
sudo apt install firefox libreoffice gimp vlc
这将安装Firefox浏览器、LibreOffice办公套件、GIMP图像编辑器和VLC媒体播放器
PVE 直通 硬盘
查看磁盘ID
1、备份虚拟机
2、删除虚拟机
3、删除local-lvm
命令:
lvremove pve/data
4、把local-lvm空间分配给Local
命令:
lvextend -l +100%FREE -r pve/root
resize2fs /dev/mapper/pve-root
5、删除local-lvm
网页登陆,数据中心-存储-删除local-lvm
6、编辑local,内容里添加 磁盘映像和容器,保存
7、恢复虚拟机
安装Pve Tools
export LC_ALL=en_US.UTF-8 apt update && apt -y install git && git clone https://github.com/ivanhao/pvetools.git
PVE 工具1(PVE_Source)
wget -q -O /root/pve_source.tar.gz 'https://bbs.x86pi.cn/file/topic/2023-11-28/file/01ac88d7d2b840cb88c15cb5e19d4305b2.gz' && tar zxvf /root/pve_source.tar.gz && /root/./pve_source
直接查看磁盘
ls -al /dev/sd* //此命令会查看sd开头的磁盘
选择磁盘,进入磁盘工具
fdisk /dev/sdb
安装大磁盘
apt-get install parted
格式化大分区
-
parted /dev/sdc
parted /dev/sdb mklabel gpt
mkpart primary 0% 100%
print -
mkfs.xfs /dev/sdc 1
3.挂载磁盘新建目录
mkdir /isso
挂载磁盘
mount /dev/sdc1 /isso
ls -l /dev/disk/by-id/
qm set 100 -scsi1 /dev/disk/by-id/ata-ST500LT012-1DG142_S3PXZZCR
硬盘直通
apt-get update
然后安装lshw:
apt-get install lshw
然后查看已插入硬盘的信息
ls -l /dev/disk/by-id/
lrwxrwxrwx 1 root root 10 Apr 9 12:02 dm-name-pve-root -> ../../dm-1
lrwxrwxrwx 1 root root 10 Apr 9 12:02 dm-name-pve-swap -> ../../dm-0
lrwxrwxrwx 1 root root 10 Apr 9 12:02 dm-uuid-LVM-LGUHkDWqQpXHLhBSTcn1rVNjcocva3qx7PTK3l9TzGffkmBOW7s2f0YYsdNpSfYD -> ../../dm-1
lrwxrwxrwx 1 root root 10 Apr 9 12:02 dm-uuid-LVM-LGUHkDWqQpXHLhBSTcn1rVNjcocva3qxFNn26GageAoIrreetS4ef2ea15ax5sgF -> ../../dm-0
lrwxrwxrwx 1 root root 10 Apr 9 12:02 lvm-pv-uuid-GfQEcl-XsOl-HKYw-1mfi-IXam-avVX-V7uhMB -> ../../sda3
lrwxrwxrwx 1 root root 9 Apr 9 12:02 scsi-36b083fe0c24108002da7657d08da9106 -> ../../sda
lrwxrwxrwx 1 root root 10 Apr 9 12:02 scsi-36b083fe0c24108002da7657d08da9106-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Apr 9 12:02 scsi-36b083fe0c24108002da7657d08da9106-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Apr 9 12:02 scsi-36b083fe0c24108002da7657d08da9106-part3 -> ../../sda3
lrwxrwxrwx 1 root root 9 Apr 9 12:02 scsi-36b083fe0c24108002da765950a4d2699 -> ../../sdb
lrwxrwxrwx 1 root root 10 Apr 9 12:02 scsi-36b083fe0c24108002da765950a4d2699-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 9 Apr 9 12:02 scsi-36b083fe0c24108002da76704202cd902 -> ../../sdc
lrwxrwxrwx 1 root root 10 Apr 9 12:02 scsi-36b083fe0c24108002da76704202cd902-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 9 Apr 9 12:02 scsi-36b083fe0c24108002da7671020ddfeeb -> ../../sdd
lrwxrwxrwx 1 root root 10 Apr 9 12:02 scsi-36b083fe0c24108002da7671020ddfeeb-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 9 Apr 9 12:02 wwn-0x6b083fe0c24108002da7657d08da9106 -> ../../sda
lrwxrwxrwx 1 root root 10 Apr 9 12:02 wwn-0x6b083fe0c24108002da7657d08da9106-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Apr 9 12:02 wwn-0x6b083fe0c24108002da7657d08da9106-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Apr 9 12:02 wwn-0x6b083fe0c24108002da7657d08da9106-part3 -> ../../sda3
lrwxrwxrwx 1 root root 9 Apr 9 12:02 wwn-0x6b083fe0c24108002da765950a4d2699 -> ../../sdb
lrwxrwxrwx 1 root root 10 Apr 9 12:02 wwn-0x6b083fe0c24108002da765950a4d2699-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 9 Apr 9 12:02 wwn-0x6b083fe0c24108002da76704202cd902 -> ../../sdc
lrwxrwxrwx 1 root root 10 Apr 9 12:02 wwn-0x6b083fe0c24108002da76704202cd902-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 9 Apr 9 12:02 wwn-0x6b083fe0c24108002da7671020ddfeeb -> ../../sdd
lrwxrwxrwx 1 root root 10 Apr 9 12:02 wwn-0x6b083fe0c24108002da7671020ddfeeb-part1 -> ../../sdd1
root@fdnas:~# fdisk -l
Disk /dev/sda: 3.64 TiB, 3999688294400 bytes, 7811891200 sectors
Disk model: PERC H710
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 972A48CB-7B20-4FA3-A689-D936D368EEBB
Device Start End Sectors Size Type
/dev/sda1 34 2047 2014 1007K BIOS boot
/dev/sda2 2048 2099199 2097152 1G EFI System
/dev/sda3 2099200 7811891166 7809791967 3.6T Linux LVM
Disk /dev/sdb: 3.64 TiB, 3999688294400 bytes, 7811891200 sectors
/dev/sdb1 2048 7811889151 7811887104 3.6T Linux filesystem
Disk /dev/sdd: 1.82 TiB, 1999844147200 bytes, 3905945600 sectors
Device Boot Start End Sectors Size Id Type
/dev/sdd1 * 2048 3905945599 3905943552 1.8T 83 Linux
/dev/sdc1 2048 19529725951 19529723904 9.1T Linux filesystem
Disk /dev/mapper/pve-swap: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/pve-root: 3.63 TiB, 3990020423680 bytes, 7793008640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@fdnas:~#
添加硬盘做存储
创建 /mnt/sdb1 目录:
mkdir -p /mnt/sdb1
将 /dev/sdb1 分区挂载在 /mnt/sdb1 上:
mount -t ext4 /dev/sdb1 /mnt/sdb1
将 /mnt/sde1 挂载写入到系统启动项:
echo /dev/sdb1 /mnt/sdb1 ext4 defaults 1 2 >> /etc/fstab
重启PVE
reboot