Mailing List
Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Installation - Getting started with Red Hat Linux
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 8.0 - Discussion of Red Hat Linux 8.0 (Psyche)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Red Hat Linux 7.1 - Discussion of Red Hat Linux 7.1 (Seawolf)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Blocks verses Bytes,Mbytes etc

Blocks verses Bytes,Mbytes etc

2003-04-29       - By Harry Putnam

 Back
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Something I 've wondered each time I fire up fdisk for some reason:

Is there an even handed way to convert BLOCKS into Bytes?

A typical fdisk readout:

Disk /dev/hda: 255 heads, 63 sectors, 2434 cylinders

Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 513 4120641 7 HPFS/NTFS
/dev/hda2 514 2434 15430432+ f Win95 Ext 'd (LBA)
/dev/hda5 514 705 1542208+ 83 Linux
/dev/hda6 706 1215 4096543+ 83 Linux
/dev/hda7 1216 1432 1743021 83 Linux
/dev/hda8 1433 1503 570276 83 Linux
/dev/hda9 1504 1535 257008+ 83 Linux
/dev/hda10 1536 1552 136521 82 Linux swap
/dev/hda11 1553 2203 5229126 83 Linux
/dev/hda12 2204 2434 1855476 b Win95 FAT32


I 've devised scripting several times to convert cylinders (roughly)
to MB and other assorted schemes to render fdisk output more
understandable.

But its often the case when one needs fdisk that not much else is
available so I wondered if there is a handy way to convert the Blocks
shown above into Bytes, or at least some rough approximation?

Something a math challenged dope could do with paper and pencil while
figuring out how to set up a fresh install. Or at least with a
cheapy calculator.

My first impulse was to get a df -h reading of the same disk:

Filesystem Size Used Avail Use% Mounted on
/dev/hda5 1.4G 216M 1.1G 16% /
/dev/hda11 4.9G 2.6G 2.0G 55% /anex
/dev/hda7 1.6G 437M 1.1G 28% /home
none 61M 0 61M 0% /dev/shm
/dev/hda9 243M 4.1M 226M 2% /tmp
/dev/hda6 3.8G 2.3G 1.3G 63% /usr
/dev/hda8 548M 99M 422M 19% /var

Then use a df -k reading to work out the math by dividing the figures
under Size by the figures under k-Blocks... But something tells me this
is not a good approach. Also I hoped there may already be some nifty
way to do this.