Example using the menu
This example shows how to use fdasd to create two partitions on a z/VM® minidisk, change the type of one of the partitions, save the changes, and check the results.
About this task
This example shows you how to format a z/VM minidisk with the compatible disk layout. The minidisk has device number 193.
Procedure
- Call fdasd, specifying the minidisk:
# fdasd /dev/dasdzzz
fdasd reads the existing data and displays the menu:reading volume label: VOL1 reading vtoc : ok Command action m print this menu p print the partition table n add a new partition d delete a partition v change volume serial t change partition type r re-create VTOC and delete all partitions u re-create VTOC re-using existing partition sizes s show mapping (partition number - data set name) q quit without saving changes w write table to disk and exit Command (m for help):
-
Use the
p
option to verify that no partitions are created yet on this DASD:Command (m for help): p Disk /dev/dasdzzz: cylinders ............: 100 tracks per cylinder ..: 15 blocks per track .....: 12 bytes per block ......: 4096 volume label .........: VOL1 volume serial ........: 0X0193 max partitions .......: 3 ------------------------------- tracks ------------------------------- Device start end length Id System 2 1499 1498 unused
- Define two partitions, one by specifying an end track and the other by
specifying a length. (In both cases the default start tracks are used):
Command (m for help): n First track (1 track = 48 KByte) ([2]-1499): Using default value 2 Last track or +size[c|k|M] (2-[1499]): 700 You have selected track 700
Command (m for help): n First track (1 track = 48 KByte) ([701]-1499): Using default value 701 Last track or +size[c|k|M] (701-[1499]): +400 You have selected track 1100
- Check the results by using the
p
option:Command (m for help): p Disk /dev/dasdzzz: cylinders ............: 100 tracks per cylinder ..: 15 blocks per track .....: 12 bytes per block ......: 4096 volume label .........: VOL1 volume serial ........: 0X0193 max partitions .......: 3 ------------------------------- tracks ------------------------------- Device start end length Id System /dev/dasdzzz1 2 700 699 1 Linux native /dev/dasdzzz2 701 1100 400 2 Linux native 1101 1499 399 unused
- Change the type of a partition:
Enter the ID of the partition you want to change; in this example partition 2:Command (m for help): t Disk /dev/dasdzzz: cylinders ............: 100 tracks per cylinder ..: 15 blocks per track .....: 12 bytes per block ......: 4096 volume label .........: VOL1 volume serial ........: 0X0193 max partitions .......: 3 ------------------------------- tracks ------------------------------- Device start end length Id System /dev/dasdzzz1 2 700 699 1 Linux native /dev/dasdzzz2 701 1100 400 2 Linux native 1101 1499 399 unused change partition type partition id (use 0 to exit):
partition id (use 0 to exit): 2
- Enter the new partition type; in this example type 2 for swap:
current partition type is: Linux native 1 Linux native 2 Linux swap 3 Linux raid 4 Linux lvm new partition type: 2
- Check the result:
Command (m for help): p Disk /dev/dasdzzz: cylinders ............: 100 tracks per cylinder ..: 15 blocks per track .....: 12 bytes per block ......: 4096 volume label .........: VOL1 volume serial ........: 0X0193 max partitions .......: 3 ------------------------------- tracks ------------------------------- Device start end length Id System /dev/dasdzzz1 2 700 699 1 Linux native /dev/dasdzzz2 701 1100 400 2 Linux swap 1101 1499 399 unused
- Write the results to disk with the
w
option:Command (m for help): w writing VTOC... rereading partition table... #