修正ubuntu安装时硬盘错误

This commit is contained in:
bin456789 2023-05-07 20:58:44 +08:00
parent c5c110be2b
commit 0aac4fe2af
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -5,7 +5,7 @@ xda=$(lsblk -dn -o NAME | grep -E 'nvme0n1|.da')
# https://curtin.readthedocs.io/en/latest/topics/storage.html
size_os=$(lsblk -bn -o SIZE /dev/disk/by-label/os)
if parted /dev/sda print | grep '^Partition Table' | grep gpt; then
if parted /dev/$xda print | grep '^Partition Table' | grep gpt; then
# parted 3.1 on centos7 bug
# https://documentation.suse.com/zh-cn/sles/15/html/SLES-all/cha-expert-partitioner.html#sec-expert-partitioner-tables-gpt
parted /dev/$xda -s 'set 2 msftdata off' # os