LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-25-2011, 06:33 PM   #1
needsleep
Member
 
Registered: Apr 2011
Location: Minneapolis
Distribution: CentOS 7
Posts: 80

Rep: Reputation: 0
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.

Thanks,
 
Old 06-25-2011, 09:10 PM   #2
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
Quote:
Is there a command that will show my block size?
yes, 'dumpe2fs' can give you all of that filesystem information.
Code:
[root@athlon ~]# dumpe2fs -h /dev/mapper/athlon-root | grep "Block size:"
dumpe2fs 1.41.12 (17-May-2010)
Block size:               4096
[root@athlon ~]#

Quote:
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 09:27 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate usable bytes on a disk partition? dbrazeau Linux - Newbie 7 03-10-2010 11:42 PM
how do i generate random list and determine size of arbitrary block of files in dir archnemesis Linux - General 2 03-05-2010 08:34 PM
how to calculate the bytes-per-inodes value? z@ki Red Hat 3 02-24-2010 03:17 PM
how to determine block size when using dd kav Linux - Software 2 12-22-2007 08:16 PM
How to determine file system block size? provo1234 Linux - Newbie 2 02-14-2005 10:30 AM


All times are GMT -5. The time now is 10:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration