KandZ – Tuts

We like to help…!

Linux CLI 29 ๐Ÿง fsck, mkfs and dd commands

a - fsck command
fsck is used to verify the intergrity of a file system
It checks for error( corrupted inodes, bad sectors, or broken file system structures)
It can attempt to fix those errors
before you check a filesystem you have to unmount it with umount
sudo fsck -N /dev/sda โ†’ displays what it will do without doing anything
sudo fsck /dev/sda โ†’ performs the check
sudo fsck -n /dev/sda โ†’ perform a check but do not repair
sudo fsck -f /dev/sda โ†’ forces a check
-a โ†’ repairs errors automatically -v โ†’ verbose mode -t โ†’ test for bad sectors

b - mkfs command
mkfs โ†’ Make File System
mkfs is used to create and format file systems
write sudo mkfs and use TAB key to show the supported filesystem types
Create a file system on a partition
sudo mkfs -t ext4 /dev/sda or sudo mkfs.ext4 /dev/sda
Note that mkfs creates a new filesystem on existing partition or drive
It does not resize or delete it. For this task you can use fdisk

c - dd command
dd โ†’ Data description
dd is used to copy and convert data from one place to another
syntax โ†’ dd if=inputfile [bs=blocksize] [count=numcopies] Of=outputfile
if โ†’ input file, where to read data from
bs โ†’ sets the block size, default is 512 bytes (optional)
count โ†’ specifies how many blocks will be transferred. All is default (optional)
of โ†’ output file, where the data will be transferred to

d - dd command examples
dd If=input.txt Of=backup.txt โ†’ copy a file
dd If=/dev/sda bs=4M count=10240 of=image.img โ†’ create an image file from /dev/sda
dd If=/dev/sda Of=/dev/sdc โ†’ clone a disk to another
dd if=/dev/sda1 of=~/sda1partition.img โ†’ backup a partition
dd if=sda1partition.img of=/dev/sda1 โ†’ restore the previous backup
and if you need to create an CD-ROM ISO
dd if=/dev/cdrom of=tgsservice.iso bs=2048

Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!

Leave a Reply