kcinsu Posted April 15, 2011 Report Share Posted April 15, 2011 can anyone tell me the file in the /proc directory that will tell me the size of each hard disk? google returns a plethora of confusing threads on various forums, but nothing concrete. surely this information is stored in a specific location? and please don't tell me a command line solution... I need to know the actual file that contains this info. please obi watmm kenobi... you're my only hope. Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Link to comment https://forum.watmm.com/topic/65392-linux-help/ Share on other sites More sharing options...
chenGOD Posted April 15, 2011 Report Share Posted April 15, 2011 Does this help? http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html or maybe this? http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlproc.html Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Hide all signatures 백호야~~~항상에 사랑할거예요.나의 아들. Shout outs to the saracens, musulmen and celestials. Link to comment https://forum.watmm.com/topic/65392-linux-help/#findComment-1559901 Share on other sites More sharing options...
joew Posted April 15, 2011 Report Share Posted April 15, 2011 /proc/partitions stores the sizes of partitions in blocks Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Link to comment https://forum.watmm.com/topic/65392-linux-help/#findComment-1559903 Share on other sites More sharing options...
kcinsu Posted April 15, 2011 Author Report Share Posted April 15, 2011 On 4/15/2011 at 2:35 AM, joew said: /proc/partitions stores the sizes of partitions in blocks so would sum of all the partitions be the total disk size? Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Link to comment https://forum.watmm.com/topic/65392-linux-help/#findComment-1559907 Share on other sites More sharing options...
kcinsu Posted April 15, 2011 Author Report Share Posted April 15, 2011 sorry, I was confusing something else I was looking at. thank you! Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Link to comment https://forum.watmm.com/topic/65392-linux-help/#findComment-1559913 Share on other sites More sharing options...
kcinsu Posted April 15, 2011 Author Report Share Posted April 15, 2011 ok, so after trying to read up on blocks, it seems there is no standard block size. Is there a way to find out the current systems block size? I found tune2fs -l as a way to check from root, but I need to find the information on a machine in which I am not the admin, and apparently tune2fs -l can only be called from root? Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Link to comment https://forum.watmm.com/topic/65392-linux-help/#findComment-1559930 Share on other sites More sharing options...
Bubba69 Posted April 15, 2011 Report Share Posted April 15, 2011 (edited) including mounted and unmounted drives and mounted and unmounted partitions? Are you only allowed to use /proc for this info? Imma go over to my linux partition and try to figure it out cause im bored, be back in a sec... EDIT: does your particular system have a /proc/ide/ by any chance? Is this a school assignment? EDIT2: Linux refers to blocks as 1024 Bytes, so you can either use this for /proc/partitions or you can use sysfs. /sys/ is fairly new in the kernel but it contains some info about devices that has been deprecated from the kernel, including /proc/ide which isn't supported anymore. /sys/block/XXdevicenameXX(hda, sda, etc...)/size will give you the size of the drive in sectors and is the replacement for /proc/ide/device_name/size sectors are 512B Edited April 15, 2011 by Bubba69 Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Hide Bubba69's signature Hide all signatures https://intervallux.bandcamp.com/ Link to comment https://forum.watmm.com/topic/65392-linux-help/#findComment-1560047 Share on other sites More sharing options...
kcinsu Posted April 15, 2011 Author Report Share Posted April 15, 2011 Yeah, we are only supposed to use /proc (yes, a school assignment... basically I am writing methods that access these files, and returns various info about the OS, the CPUs, the disks, and the memory etc) answer to edit1: yes there is /proc/ide but the only file in there is called drivers which has 2 lines of text that is definitely not what i'm looking for there is a sys as well, but no block or similar file path I guess I'll have to just take the block size, and multiply it by 1024? thanks for your help. this class is getting on my nerves... he keeps assigning projects that require knowledge that he doesn't teach us in class. pretty much every assignment is like this, and I end up spending hours and hours online teaching myself everything I need to make the program work. sure it's great experience, and it's proven that I can figure stuff out on my (watmm's) own... but fuck, there is only so many free hours in a week outside of a full time job, and my other project classes. And he gets annoyed if you ask him too many questions. The pre-req for this class is a tad optimistic I think... Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Link to comment https://forum.watmm.com/topic/65392-linux-help/#findComment-1560090 Share on other sites More sharing options...
Bubba69 Posted April 15, 2011 Report Share Posted April 15, 2011 (edited) yeah it's annoying. I've noticed some professors fail to acknowledge that certain specs of the linux kernel are way different then they were 10 years ago and expect everything to work the same. Also distros customize their kernels differently, there are all sorts of options on stuff you can include in proc. also check out /proc/diskstats which doesn't have any info about size but it does have lots of interesting numbers about disk access and shit can't remember exactly what. Edited April 15, 2011 by Bubba69 Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Hide Bubba69's signature Hide all signatures https://intervallux.bandcamp.com/ Link to comment https://forum.watmm.com/topic/65392-linux-help/#findComment-1560096 Share on other sites More sharing options...
kcinsu Posted April 15, 2011 Author Report Share Posted April 15, 2011 cool, thanks! Also, 2 classes ago, he went on a rant about never hardcoding a file path. But for this assignment we have to. Unless he wants me to write a method that checks to see if /proc exists, and if it does, check to see if every subdirectory exists, and if it does, check to see if these files exist. Fuck that. Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Link to comment https://forum.watmm.com/topic/65392-linux-help/#findComment-1560098 Share on other sites More sharing options...
Recommended Posts