1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
| $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 400G 0 disk └─sda1 8:1 0 400G 0 part / sdb 8:16 0 100G 0 disk sdc 8:32 0 100G 0 disk sdd 8:48 0 100G 0 disk sr0 11:0 1 445.7M 0 rom
$ fdisk /dev/sdb
Welcome to fdisk (util-linux 2.36.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x829a598b.
Command (m for help): m
Help:
DOS (MBR) a toggle a bootable flag b edit nested BSD disklabel c toggle the dos compatibility flag
Generic d delete a partition F list free unpartitioned space l list known partition types n add a new partition p print the partition table t change a partition type v verify the partition table i print information about a partition
Misc m print this menu u change display/entry units x extra functionality (experts only)
Script I load disk layout from sfdisk script file O dump disk layout to sfdisk script file
Save & Exit w write table to disk and exit q quit without saving changes
Create a new label g create a new empty GPT partition table G create a new empty SGI (IRIX) partition table o create a new empty DOS partition table s create a new empty Sun partition table
Command (m for help): g Created a new GPT disklabel (GUID: 9324FD1A-EAE8-7E49-B548-C613E8D4D282).
Command (m for help): n Partition number (1-128, default 1): 1 First sector (2048-209715166, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-209715166, default 209715166): 109715666
Created a new partition 1 of type 'Linux filesystem' and of size 52.3 GiB.
Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.
$ fdisk -l /dev/sdb Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors Disk model: Virtual disk Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 9324FD1A-EAE8-7E49-B548-C613E8D4D282
Device Start End Sectors Size Type /dev/sdb1 2048 109715666 109713619 52.3G Linux filesystem
$ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT sda └─sda1 ext4 1.0 f34f1c4a-fb45-4145-b526-1a9985598ea4 305.5G 17% / sdb └─sdb1 sdc sdd sr0 iso9660 Joliet Extension CDROM 2023-04-19-20-36-49-00
$ mkfs.ext4 /dev/sdb1 mke2fs 1.46.2 (28-Feb-2021) Creating filesystem with 13714202 4k blocks and 3432448 inodes Filesystem UUID: 571028b4-f5db-4f0d-86f0-7faca53b9af9 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424
Allocating group tables: done Writing inode tables: done Creating journal (65536 blocks): done Writing superblocks and filesystem accounting information: done
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 400G 0 disk └─sda1 8:1 0 400G 0 part / sdb 8:16 0 100G 0 disk └─sdb1 8:17 0 52.3G 0 part sdc 8:32 0 100G 0 disk sdd 8:48 0 100G 0 disk sr0 11:0 1 445.7M 0 rom
|