Junior — Middle
How is the configuration and preparation of disk devices carried out in the Linux operating system?
sobes.tech AI
Answer from AI
In Linux, disk device configuration and preparation typically involve the following steps:
-
Device identification — using commands like
lsblk,fdisk -l,blkidto see available disks and partitions. -
Creating partitions — utilities like
fdisk,parted, orgdiskallow creating, deleting, and modifying disk partitions. -
Formatting partitions — creating a filesystem using commands like
mkfs.ext4,mkfs.xfs, etc. -
Mounting partitions — attaching the filesystem to a mount point using
mount. -
Configuring automatic mounting — adding an entry to the
/etc/fstabfile.
Example of creating a partition and formatting:
sudo fdisk /dev/sdb
# create a new partition inside fdisk
sudo mkfs.ext4 /dev/sdb1
sudo mkdir /mnt/data
sudo mount /dev/sdb1 /mnt/data
Thus, disk preparation includes partitioning, creating a filesystem, and mounting for system use.