Lab2 Solution Amirlan Sharipov (BS21-CS-01)

Table of Contents

1. Questions 1

1.1. What is fdisk utility used for?

to manipulate disk partition table

1.2. Show the bootable device(s) on your machine, and identify which partition(s) are bootable.

1.2.1. Output of fdisk -l:

… Device Start End Sectors Size Type /dev/sdb1 2048 34815 32768 16M Microsoft reserved /dev/sdb2 34816 524285951 524251136 250G Microsoft basic data /dev/sdb3 524285952 659988479 135702528 64.7G Linux filesystem /dev/sdb4 659988480 863920127 203931648 97.2G Linux filesystem /dev/sdb5 958291968 975173631 16881664 8G Linux swap /dev/sdb6 975173632 976773134 1599503 781M EFI System /dev/sdb7 863920128 956194815 92274688 44G Linux filesystem /dev/sdb8 956194816 958291967 2097152 1G EFI System

1.2.2. Answer

/dev/sdb6 and /dev/sdb8 are bootable partitions

1.3. What is logical block address?

is a scheme to index the locations of logical blocks of a device. Starts with LBA 0

1.4. Why did we specify the count, the bs, and the skip options when using dd?

Number of blocks, block size, and how many blocks to skip

1.5. Why does a GPT formatted disk have the MBR?

To maintain compatibility and protect GPT disk and from MBR-based disk utilities.

1.6. Name two differences between primary and logical partitions in an MBR partitioning scheme

There can be only 4 primary partitions in MBR disk, while there can be many logical ones on top of an extended partition. Some operating systems cannot boot from a logical partition.

2. Questions 2

2.1. Why is Shim used to load the GRUB bootloader?

To make Secure Boot mechanism work.

2.2. Can you locate your grub configuration file? Show the path.

/boot/grub/grub.cfg Also, there is /etc/default/grub which can be used to generate a grub config using grub-mkconfig

2.3. According to the boot order, what is the third boot device on your computer? How did you check this?

BootCurrent: 0003 Timeout: 0 seconds BootOrder: 0003,0004,0009,0001,0002,0000,2001,0006,0005,2002,2003 … Boot0009* Artix HD(10,GPT,… It’s Artix on my hard drive, accoding to efibootmgr -v

3. Questions 3

3.1. How many inodes are in use on your system?

df --output=source,iused
Filesystem      IUsed
dev               717
run              1314
/dev/sdb3      720461
tmpfs               1
tmpfs              26
/dev/sdb4      677813
/dev/sdb6           0
tmpfs              71
/dev/sda9       16193
/dev/sda8       33171

3.2. What is the filesystem type of the EFI partition?

FAT32

3.3. What device is mounted at your root / directory? Show proof.

lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0   499M  0 part 
├─sda2   8:2    0   100M  0 part 
├─sda3   8:3    0    16M  0 part 
├─sda4   8:4    0  42.4G  0 part 
├─sda5   8:5    0  38.8G  0 part 
├─sda6   8:6    0   100M  0 part 
├─sda7   8:7    0   3.1G  0 part 
├─sda8   8:8    0   315G  0 part /mnt/rec
└─sda9   8:9    0 531.5G  0 part /mnt/data
sdb      8:16   0 465.8G  0 disk 
├─sdb1   8:17   0    16M  0 part 
├─sdb2   8:18   0   250G  0 part 
├─sdb3   8:19   0  64.7G  0 part /
├─sdb4   8:20   0  97.2G  0 part /home
├─sdb5   8:21   0     8G  0 part [SWAP]
├─sdb6   8:22   0   781M  0 part /boot
├─sdb7   8:23   0    44G  0 part 
└─sdb8   8:24   0     1G  0 part 

/dev/sdb3

3.4. What is your partition UUID?

For PARTUUID:

lsblk -dno PARTUUID /dev/sdb3
fbef9613-fbf5-8445-8d1c-7a63709d1229

3.5. Show at least two methods of viewing the UUID of a block device.

lsblk -dno UUID /dev/sdb3 blkid

3.6. What is the function of /dev/zero?

Source of zero bytes. Can be used with dd to fill a file with zeros.

Author: Amirlan Sharipov (BS21-CS-01)

Created: 2023-02-09 Thu 23:36