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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
07-16-2003, 07:55 AM
|
#1
|
Member
Registered: Sep 2002
Posts: 168
Rep:
|
Kilobytes vs block
How do read blocks in filesystem? What is the conversion to bytes to block or vice versa?
|
|
|
07-16-2003, 08:24 AM
|
#2
|
Senior Member
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185
Rep:
|
if i had to guess just by looking at the information that i see in a fdisk -l command i would say that you multiply the amount of blocks by 2 and then multiply that number by 512, to get the amount of bytes....these equations i am presenting are all with the assumption that there is 512 bytes per sector.
this could be totally wrong, its just how i believe that it could be done.
or if you look at the ending sector of a drive you could subtract 1, divide by two and multiply by 512.
again these equations are something i am just throwing together by looking at numbers in front of me, they could be totally wrong or pretty accurate, i do not know, so i guess you can wait till someone else posts an answer...
|
|
|
07-16-2003, 08:30 AM
|
#3
|
Member
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232
Rep:
|
The blocks/bytes ratio depends on how you've set up your filesystem at format time. Popular blocksizes are : 1024, 2048 and 4096 bytes. On the other hand low level utils like cpio assume a blocksize of 512 bytes, so maybe there are some historical anomalies that some guru can shed light on ?
To read raw blocks you could look into the dd util, or cpio in copy-pass mode.
Last edited by Pres; 07-16-2003 at 08:35 AM.
|
|
|
07-16-2003, 09:06 AM
|
#4
|
Member
Registered: Sep 2002
Posts: 168
Original Poster
Rep:
|
I am reading from df command using 1024
|
|
|
07-16-2003, 02:47 PM
|
#5
|
Senior Member
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185
Rep:
|
well if you reading it using df then use df -h to get human readable numbers.
|
|
|
07-17-2003, 04:10 AM
|
#6
|
Member
Registered: Sep 2002
Posts: 168
Original Poster
Rep:
|
Yeah.....solaris system can't read df -h command. I believe some OS have blocks only...like VAX system.
|
|
|
All times are GMT -5. The time now is 03:48 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.
|
Latest Threads
LQ News
|
|