|
# |
Command CLI |
Description & Example |
|
1 |
lsblk -l |
List block devices, lists information
about all available or the specified block devices. List the partition tables sdb1 8:17 1 460.3G 0 part /var/lib/libvirt/images |
|
2 |
lsblk -f |
Same as above, shows the files system type: Note ext4
sdb `-sdb1 ext4 467b6668-77bd-46d8-8310-196b8766b4ea 429G 0% /var/lib/libvirt |
|
3 |
mount -l | grep sd |
Displays if /dev/sdb1 is mounted |
|
4 |
umount /dev/sdb1 |
Unmounts /dev/sdb1 |
|
5 |
fdisk /dev/sdb d p n, Primary (take defaults) w |
Partition utility Deletes existing partition if any. New partition (1) if only one partition needed. Write |
|
6 |
fdisk -l |
List the partition tables /dev/sdb1 |
|
7 |
mkfs.ext4 /dev/sdb1 |
Formats partition |
|
8 |
fdisk -l |
verify /dev/sdb1 |
|
9 |
lsblk -l |
Same |
|
10 |
lsblk -f |
check if ext4 |
|
11 |
mkdir /tmp/mnt |
make a temp directory (test mount directory) |
|
12 |
mount /dev/sdb1 /tmp/mnt |
Mount /dev/sdb1 to /tmp/mnt (test mount) |
|
13 |
vi /tmp/mnt/test.txt |
i-insert then type “your
text” (test file) ESC :wq! saves the file |
|
14 |
umount /dev/sdb1 |
Unmounts /dev/sdb1 (umounts test) |
|
15 |
mount /dev/sdb1 /var/lib/libvirt/images |
mount /dev/sdb1 /var/lib/libvirt/images |
|
16 |
more /var/lib/libvirt/images/test.txt |
checks if “your text” was saved and now can be seen on images |
|
17 |
vi /etc/fstab |
Type i # To insert ESC :wq! saves the file and mounts device upon reboot |