How can i get the start and end sectors of the partitions of my harddisk via a bash script?
From stackoverflow
-
That's a start:
sudo /sbin/fdisk -l /dev/sdb | grep sdb[0-9]baltusaj : :) That gives block sizes.baltusaj : What's the interrelation between blocks and sectors?Omry : man fdisk : -u When listing partition tables, give sizes in sectors instead of cylinders. -
Look at
/sys/block/sda/sda1/startand/sys/block/sda/sda1/size.Replace
sdaandsda1with your device and partition.baltusaj : Thanks. That's exactly what i was looking for.
0 comments:
Post a Comment