From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?B?Sm9z6SBG6WxpeCBPbnRh8fNu?= Date: Sun, 09 Jan 2011 23:07:41 +0000 Subject: Re: About volume/disk blocks/size properties Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org El d=EDa 8 de enero de 2011 18:26, Kay Sievers escri= bi=F3: > 2011/1/8 Jos=E9 F=E9lix Onta=F1=F3n : >> I wonder... are there any reasons for not being convenient to export >> some properties refering the volume size of a disk device? >> Although I'm concerned about the >> don't-turning-udev-into-a-hal-like-system, I still perceiving the >> volume.size or volume.block_size properties as very useful for user >> space apps. >> >> On the one hand, it could be easy for user space apps to get the >> size/blocks for partition devices, > > =A0$ grep . /sys/class/block/*/size > =A0/sys/class/block/sda1/size:41943040 > =A0/sys/class/block/sda2/size:41943040 > =A0/sys/class/block/sda3/size:115343360 > =A0/sys/class/block/sda4/size:50835456 > =A0/sys/class/block/sda/size:250069680 > =A0/sys/class/block/sr0/size:2097151 > >> but on the other hand you need root >> privs to get this info for disk devices, am i wrong? > > Everybody can do that. > > Kay > Oh! Much better! Sorry for messing up. It seems the size file give us the number of sectors, isn't? In order to get the bytes of the disk/partition ... is it right to multiply /sys/block//queue/logical_block_size times /sys/block//size ?? Thanks! --=20 http://fontanon.org