LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-24-2011, 06:43 PM   #1
Equinn
LQ Newbie
 
Registered: Feb 2008
Location: California
Distribution: Slackware 13.1
Posts: 24

Rep: Reputation: 0
How does one determine a USB hard drive capacity in sectors?


Hi All,

How would one determine the capacity in sectors or LBAs of a USB Hard Drive? If I know the USB device number, like from 'lsusb', is there someplace on the system to get other information about the drive? What I want to do is have a program go out and get this information just for the number of LBAs on the drive itself. Partition info doesn't matter for what I am doing.

Thanks,
Elena Quinn
 
Old 03-24-2011, 07:21 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I believe /sys/block/sdX/size may be in sectors .. multiplying by sector size seems to give the correct disk space

cheers
 
1 members found this post helpful.
Old 03-25-2011, 05:40 AM   #3
NM04
Member
 
Registered: Jan 2011
Distribution: Back Track,Fedora,centos
Posts: 240

Rep: Reputation: 14
hi equinn,

if you have linux, plug in the USB, and then from the terminal run the command "fdisk -l". I think this should give you the sectors in the USB.

Regards.
 
  


Reply



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
Capacity issues of hard drive bzlaskar Linux - Hardware 6 05-18-2010 11:35 PM
Full Capacity of New Hard Drive Isn't Recognized. Why Not? km4hr Linux - Hardware 5 03-13-2009 09:13 AM
windows/linux hard drive capacity Vensan Linux - Hardware 2 01-19-2007 10:39 AM
Hard Drive showing incorrect capacity xer Linux - Hardware 7 12-27-2006 10:03 PM
Hard Drive capacity twantrd Linux - General 2 10-12-2004 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:51 PM.

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
Open Source Consulting | Domain Registration