Disks and filesystems: Difference between revisions

From wiki
Jump to navigation Jump to search
Created page with ";badblocks -v- s /dev/sdb1 >badblocks.log :Check a device for bad blocks ;fdisk /dev/sdb :Manage disk partitions"
 
No edit summary
Line 1: Line 1:
;badblocks -v- s /dev/sdb1 >badblocks.log
;badblocks -v- s /dev/sdb >badblocks.log
:Check a device for bad blocks
:Check a device for bad blocks


;fdisk /dev/sdb
;fdisk /dev/sdb
:Manage disk partitions
:Manage disk partitions
;df -h
:Show filesystem block usage in human friendly format
;df -i
:Show filesystem inode usage
;ls -i <file>
:Show inode of <file>
;rm -i <file>
:Remove a file by its inode
;mount -t <fstype> -o <options> <devicefile> <mountpoint>
:Mount a filesystem (fstype and options can be omitted often)
;mount -o loop /path/to/my-iso-image.iso /mnt/iso
:Mount an .iso file
==Performance==
The graphical utility '''Disks''' has a benchmark option.
;dd if=/dev/zero of=/dev/sdb bs=8k count=10k
:Test disk write speed if no filesystems exists
;dd if=/dev/zero of=/tmp/output bs=8k count=10k; rm -f /tmp/output
:Test disk write speed on existing filesystems
==Misc==
;/dev/null
:The unix black hole. Write always succeeds with no effect at all.
;/dev/zero
:Provides an unlimited amount of null characters (ASCII 0). Can be used for cleaning disks or benchmarking (see #Performance)
:Writing to /dev/zero is the same as writing to /dev/null

Revision as of 12:40, 1 December 2019

badblocks -v- s /dev/sdb >badblocks.log
Check a device for bad blocks
fdisk /dev/sdb
Manage disk partitions
df -h
Show filesystem block usage in human friendly format
df -i
Show filesystem inode usage
ls -i <file>
Show inode of <file>
rm -i <file>
Remove a file by its inode
mount -t <fstype> -o <options> <devicefile> <mountpoint>
Mount a filesystem (fstype and options can be omitted often)
mount -o loop /path/to/my-iso-image.iso /mnt/iso
Mount an .iso file


Performance

The graphical utility Disks has a benchmark option.

dd if=/dev/zero of=/dev/sdb bs=8k count=10k
Test disk write speed if no filesystems exists
dd if=/dev/zero of=/tmp/output bs=8k count=10k; rm -f /tmp/output
Test disk write speed on existing filesystems

Misc

/dev/null
The unix black hole. Write always succeeds with no effect at all.
/dev/zero
Provides an unlimited amount of null characters (ASCII 0). Can be used for cleaning disks or benchmarking (see #Performance)
Writing to /dev/zero is the same as writing to /dev/null