- List information about all available block devices.
Output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 364K 0 rom
vda 252:0 0 60G 0 disk
├─vda1 252:1 0 59.9G 0 part /
├─vda14 252:14 0 4M 0 part
└─vda15 252:15 0 106M 0 part /boot/efi
vdb 252:16 0 100G 0 disk
The vdb block device is the extra disk — it has no partition yet.
- Create a partition on the vdb block device.
parted -s -a optimal /dev/vdb mklabel gpt -- mkpart primary ext4 0% 100%
- Check the created partition on vdb.
Output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 364K 0 rom
vda 252:0 0 60G 0 disk
├─vda1 252:1 0 59.9G 0 part /
├─vda14 252:14 0 4M 0 part
└─vda15 252:15 0 106M 0 part /boot/efi
vdb 252:16 0 100G 0 disk
└─vdb1 252:17 0 100G 0 part
The vdb block device now has a vdb1 partition with 100GB of storage space.
- Create a filesystem on partition vdb1 (ext4, for example).
Output:
mke2fs 1.45.5 (07-Jan-2020)
Discarding device blocks: done
Creating filesystem with 26213888 4k blocks and 6553600 inodes
Filesystem UUID: 01b6aa01-424d-4e68-86cd-88f028b04252
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done
- Mount the created ext4 partition — to /mnt, for example.
- Verify the partition was successfully mounted on /mnt.
Output
Filesystem 1K-blocks Used Available Use% Mounted on
udev 997880 0 997880 0% /dev
tmpfs 203072 760 202312 1% /run
/dev/vda1 60782776 3852632 56913760 7% /
tmpfs 1015340 0 1015340 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 1015340 0 1015340 0% /sys/fs/cgroup
/dev/vda15 106858 5313 101545 5% /boot/efi
tmpfs 203068 0 203068 0% /run/user/0
/dev/vdb1 102624184 24 97365000 1% /mnt
The vdb1 ext4 partition is mounted on /mnt — you can start using it!
- Please don’t forget to add this partition to /etc/fstab — it is a very important step, otherwise the disk will not be mounted after a server reboot!
echo "/dev/vdb1 /mnt ext4 defaults 0 0" >> /etc/fstab
The /etc/fstab file is a system configuration file that contains all available disks, disk partitions and their options. Each file system is described on a separate line.
- Connect to your Windows Server VM (via Remote Desktop or the Console).
- Open Disk Management: press Windows + R, type
diskmgmt.msc, and press Enter. - If prompted to initialize the new disk, select the GPT partition style and click OK. If not prompted, right-click the disk marked Offline and select Online, then right-click it again and select Initialize Disk.
- Right-click the Unallocated space on the new disk and select New Simple Volume.
- Follow the wizard: keep the default volume size, assign a drive letter, and format the volume with NTFS.
- Click Finish. The new drive appears in File Explorer and is ready to use.
Alternatively, you can prepare the disk with PowerShell:
Get-Disk | Where-Object PartitionStyle -eq 'RAW' |
Initialize-Disk -PartitionStyle GPT -PassThru |
New-Partition -AssignDriveLetter -UseMaximumSize |
Format-Volume -FileSystem NTFS -Confirm:$false