Skip to content

Commit f89bd2b

Browse files
authored
Merge pull request #53083 from kappmeier/patch-1
Added file system creation to parted method
2 parents fe242eb + f60a320 commit f89bd2b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

articles/virtual-machines/linux/attach-disk-portal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ Writing superblocks and filesystem accounting information: done
174174
The fdisk utility needs interactive input and hence is not ideal for use within automation scripts. However, the [parted](https://www.gnu.org/software/parted/) utility can be scripted and hence lends itself better in automation scenarios. The parted utility can be used to partition and to format a data disk. For the walkthrough below, we use a new data disk /dev/sdc and format it using the [XFS](https://xfs.wiki.kernel.org/) filesystem.
175175
```bash
176176
sudo parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100%
177+
sudo mkfs.xfs /dev/sdc1
177178
partprobe /dev/sdc1
178179
```
179180
As seen above, we use the [partprobe](https://linux.die.net/man/8/partprobe) utility to make sure the kernel is immediately aware of the new partition and filesystem. Failure to use partprobe can cause the blkid or lslbk commands to not return the UUID for the new filesystem immediately.

0 commit comments

Comments
 (0)