重新安裝 Proxmox VE 在格式化硬碟出現 /dev/sdb1 is apparently in use by the system; will not make a filesystem here!

因為測試和硬碟規劃的關係,所以要重新安裝執行指令如下

mkfs.ext4 /dev/sdb1

出現
/dev/sdb1 is apparently in use by the system; will not make a filesystem here!
(在這之前,已經fdisk移掉所有的磁碟分割區,也重新建立)

找了很多方法都不行,後來查到,應該是之前有建立過lvm的關係

指令如下

dmsetup status

sshd-vm–101–disk–0: 0 3774873600 linear
pve-data_tdata: 0 709582848 linear
pve-data_tmeta: 0 7241728 linear
pve-swap: 0 16777216 linear
pve-root: 0 201326592 linear
pve-data: 0 709582848 thin-pool 0 4503/905216 0/5543616 – rw no_discard_passdown queue_if_no_space – 1024

看到舊的sshd-vm–101–disk–0的記錄,出問題的就是這個地方

進行移掉,指令如下

dmsetup remove sshd-vm–101–disk–0

確認是否正確移除,指令如下

dmsetup status

pve-data_tdata: 0 709582848 linear
pve-data_tmeta: 0 7241728 linear
pve-swap: 0 16777216 linear
pve-root: 0 201326592 linear
pve-data: 0 709582848 thin-pool 0 4503/905216 0/5543616 – rw no_discard_passdown queue_if_no_space – 1024

果真移到了,再來做一次ext4的格式化

mkfs.ext4 /dev/sdb1

mke2fs 1.44.5 (15-Dec-2018)
Creating filesystem with 488378385 4k blocks and 122101760 inodes
Filesystem UUID: fb0a6b20-c04f-43a8-8951-e6f854930d88
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information:
done

順利完成,再也沒有出現/dev/sdb1 is apparently in use by the system; will not make a filesystem here!的錯誤訊息

如何在Proxmox VE中掛載硬碟,我是參考這一篇

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *