Difference between revisions of "Disks and filesystems"

From wiki
Jump to navigation Jump to search
Line 28: Line 28:
  
 
;dd if=/dev/zero of=./test.tmp bs=1G count=1 oflag=dsync;rm -f ./test.tmp
 
;dd if=/dev/zero of=./test.tmp bs=1G count=1 oflag=dsync;rm -f ./test.tmp
:Plain write speed
+
:Check plain write speed
 
;dd if=/dev/zero of=./test.tmp bs=512 count=1000 oflag=dsync;rm -f ./test.tmp
 
;dd if=/dev/zero of=./test.tmp bs=512 count=1000 oflag=dsync;rm -f ./test.tmp
 
:Latency test
 
:Latency test
Line 34: Line 34:
 
On an empty disk you can do:
 
On an empty disk you can do:
 
;dd if=/dev/zero of=/dev/sdb bs=8k count=10k
 
;dd if=/dev/zero of=/dev/sdb bs=8k count=10k
:Test disk write speed if no filesystems exists
+
:Test disk write speed if no filesystem exists
  
 
==Misc==
 
==Misc==

Revision as of 09:00, 18 August 2020

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=./test.tmp bs=1G count=1 oflag=dsync;rm -f ./test.tmp
Check plain write speed
dd if=/dev/zero of=./test.tmp bs=512 count=1000 oflag=dsync;rm -f ./test.tmp
Latency test

On an empty disk you can do:

dd if=/dev/zero of=/dev/sdb bs=8k count=10k
Test disk write speed if no filesystem exists

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