Sponsored Content
Full Discussion: dd bytesize
Top Forums UNIX for Advanced & Expert Users dd bytesize Post 302515149 by programAngel on Tuesday 19th of April 2011 08:29:40 AM
Old 04-19-2011
Quote:
Originally Posted by pludi
"bs" is the block size, not the byte size (a byte is always 8 bits). Reasons you might want to use it:
  • To transfer a certain amount of fixed-size records (using bs and count options)
  • To match the block size of a device, thus reducing I/O blocking (eg. for hard disks and tapes)
  • To make use of a large buffer, thus reducing I/O requests

Simple example: you want to create a backup of the master boot record prior to changing the layout, it's as simple as dd if=/dev/sda of=part_table.backup bs=512 count=1, since the MBR is exactly the 512 bytes at the beginning of the disk (including boot loader, partition table, ...)
thanks you.

regarding the second use "To match the block size of a device", who can I know the block size of a device?
like for example my hard disk
 
DASDLIST(1)						      General Commands Manual						       DASDLIST(1)

NAME
dasdlist SYNOPSIS
dasdinit [-v] [-z] [-bz2] [-0] [-lfs] [-a] [-r] [-linux] filename devtype[-model] [volser] [size] This manual page documents the dasdinit program. dasdlist builds an empty dasd image file PARAMETERS
filename name of dasd image file to be created devtype emulated device type model emulated device model (optional) volser volume serial number (1-6 characters) (only if '-r' option not used) size number of cylinders (for CKD devices) or 512-byte sectors (for FBA devices) (optional if device specified) OPTIONS
-v display version info and help -z build compressed dasd image file using zlib -bz2 build compressed dasd image file using bzip2 -0 build compressed dasd image file with no compression -lfs build a large (uncompressed) dasd file (if supported) -a build dasd image file that includes alternate cylinders (option ignored if size is manually specified) -r build 'raw' dasd image file (no VOL1 or IPL track) -linux null track images will look like linux dasdfmt'ed images (3390 device type only) SEE ALSO
/usr/share/doc/hercules/html/hercload.html AUTHOR
Hercules was created by Roger Bowler and is maintained by Jay Maynard. Jan Jaeger designed and implemented many of the advanced features of Hercules, including dynamic reconfiguration, integrated console, interpretive execution, and z/Architecture support. This manual page was written by Peter De Schrijver p2@debian.org for the Debian GNU/Linux system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GPL. DASDLIST(1)
All times are GMT -4. The time now is 02:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy