News:这是一个新的Typecho主题,如果使用问题请反馈给我QQ1989473781

PROXMOX添加硬盘方法之部分错误解决办法

独立账号 429 0 条

只是记录部分错误解决办法不代表所有的错误。

错误一:
bash:fdisk:command not found

解决方法一:
将fdisk添加进默认PATH中,使用ln创建连接(需要管理员用户权限)。
[lansir@Red-Hat ~]$ su
口令:
[root@Red-Hat lansir]# ln -s /sbin/fdisk /usr/bin

proxmox 宿主机添加硬盘

root@testgpu:~# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0 223.1G  0 disk
├─sda1               8:1    0  1007K  0 part
├─sda2               8:2    0   512M  0 part /boot/efi
└─sda3               8:3    0 222.6G  0 part
  ├─pve-swap       253:0    0     8G  0 lvm  [SWAP]
  ├─pve-root       253:1    0  55.5G  0 lvm  /
  ├─pve-data_tmeta 253:2    0   1.4G  0 lvm
  │ └─pve-data     253:4    0 140.2G  0 lvm
  └─pve-data_tdata 253:3    0 140.2G  0 lvm
    └─pve-data     253:4    0 140.2G  0 lvm
sdb                  8:16   0   1.8T  0 disk
root@testgpu:~#



root@testgpu:~# fdisk -u /dev/sdb

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdb: 1.8 TiB, 1999844147200 bytes, 3905945600 sectors
Disk model: INSPUR
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disklabel type: gpt
Disk identifier: 90A08D26-423A-4ED3-9F6E-B768CF08EFE0

Command (m for help): n
Partition number (1-128, default 1):
First sector (34-3905945566, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-3905945566, default 3905945566):

Created a new partition 1 of type 'Linux filesystem' and of size 1.8 TiB.

Command (m for help): p
Disk /dev/sdb: 1.8 TiB, 1999844147200 bytes, 3905945600 sectors
Disk model: INSPUR
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disklabel type: gpt
Disk identifier: 90A08D26-423A-4ED3-9F6E-B768CF08EFE0

Device     Start        End    Sectors  Size Type
/dev/sdb1   2048 3905945566 3905943519  1.8T Linux filesystem

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@testgpu:~#

root@testgpu:~# mkfs -t xfs /dev/sdb1
meta-data=/dev/sdb1              isize=512    agcount=32, agsize=15257600 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=0
data     =                       bsize=4096   blocks=488242939, imaxpct=5
         =                       sunit=64     swidth=64 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=238399, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
root@testgpu:~#


root@testgpu:~# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0 223.1G  0 disk
├─sda1               8:1    0  1007K  0 part
├─sda2               8:2    0   512M  0 part /boot/efi
└─sda3               8:3    0 222.6G  0 part
  ├─pve-swap       253:0    0     8G  0 lvm  [SWAP]
  ├─pve-root       253:1    0  55.5G  0 lvm  /
  ├─pve-data_tmeta 253:2    0   1.4G  0 lvm
  │ └─pve-data     253:4    0 140.2G  0 lvm
  └─pve-data_tdata 253:3    0 140.2G  0 lvm
    └─pve-data     253:4    0 140.2G  0 lvm
sdb                  8:16   0   1.8T  0 disk
└─sdb1               8:17   0   1.8T  0 part
root@testgpu:~# mkdir /mnt/sdb1
root@testgpu:~# echo `blkid /dev/sdb1 | awk '{print $2}' | sed 's/\"//g'` /mnt/sdb1 xfs defaults 0 0 >> /etc/fstab

2021052716435194.png

系统镜像下载到:/var/lib/vz/template/iso/

与本文相关的文章

发表我的评论

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址