determine my block size / calculate blks to bytes / centos 5.6
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
determine my block size / calculate blks to bytes / centos 5.6
Using Centos 5.6
During installation, I reset the block size. I think it defaults to 4K. But I can't remember (ugh!) what I set it to 512K? 512?
Is there a command that will show my block size?
Can I run one of my two disks with a block size of whatever I set it to and the other disk with a larger block size?
How do I convert blocks to bytes?
df -l -t ext3
shows a header column labelled as "1K-blocks" I want to convert to Mb. Do I multiply 1024 * value in 1K blocks and divide by 1048576?
eg, 7,435,348 * 1,024 / 1,048,576 = 7,613,796,352 bytes.
I'm sure I asked it to set this filesystem to 5 Gb, so is there a way to get the calculations to show 5 Gb, instead of 7 Gb?
I understand I don't need the system block size to calculate the filesystem size, because no matter what it is, the df command above is still reporting the correct disk size in 1Kb blocks. Never the less, I still want to know if I can ascertain the block size of the current system.
Can I run one of my two disks with a block size of whatever I set it to and the other disk with a larger block size?
Yes you can, but it is on a filesystem basis - a partition or an LVM Logical Volume that you have formatted.
Quote:
How do I convert blocks to bytes?
df -l -t ext3
shows a header column labelled as "1K-blocks" I want to convert to Mb. Do I multiply 1024 * value in 1K blocks and divide by 1048576?
eg, 7,435,348 * 1,024 / 1,048,576 = 7,613,796,352 bytes.
I think you meant "multiply 1024 * value in 1K blocks" and "7,435,348 * 1,024 = 7,613,796,352 bytes."
Last edited by tommylovell; 06-25-2011 at 08:27 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.