Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

percentage of disk space used

Status
Not open for further replies.
Jun 26, 2002
102
US
How do you figure out the actural kbytes or mbytes on a logical volume when it is listed in 1024 or 512???
thnxs for the help
 
I always find the easiest way to do this is to work in bytes. Does mean you have to remember two large numbers to do it though...

Imagine doing a 'df' or something similar. You might get a filesystem size of listed as, say 10240. At the top of the column it could say 512 or 1024. We'll used 512 as an example.

1. Times your filesystem size of 10240 by 512. This will give you the number of bytes.

10240* 512 = 2048000 bytes

To find out how many megabytes it is divide that number by 1048576 (no. of bytes in a mb)

5242880 / 1048576 = 5Mb

If the filesystem is listed as being 1024 at the top just change 512 to 1024 in the same type of way.

For Gb change 1048576 to 1073741824. These numbers are long to remember and I didn't see why to use it at first. Some of the other methods I was shown only give you a rough idea and when I first started I ended up making filesystems which were too small (doh!). This way you're always byte perfect.
 
No wonder my filesystems always ended up the wrong size!

Ignore the 2048000 (5242880 * 512 is of course 5242880)

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top