On Sun, 2004-07-11 at 16:24, * Tong* wrote:
> Hi,
>
> In other distros, if I want to have a look at what HDs I have and
> their size, I just issue 'sfdisk -s', then all the HDs I have and
> their size are shown. But in debian, nothing happens after issuing
> 'sfdisk -s'. Hence, question #1,
apt-get install util-linux
Probably already installed on your machine.
Here is the output from my machine:
[greg@duke:greg]$ su -
Password:
duke:~# sfdisk -g
/dev/hde: 116416 cylinders, 16 heads, 63 sectors/track
/dev/hdg: 119150 cylinders, 16 heads, 63 sectors/track
duke:~# which sfdisk
/sbin/sfdisk
duke:~# dpkg -S $(which sfdisk)
util-linux: /sbin/sfdisk
duke:~#exit
logout
[greg@duke:greg]$ /sbin/sfdisk -g
/dev/hde: 116416 cylinders, 16 heads, 63 sectors/track
/dev/hdg: 119150 cylinders, 16 heads, 63 sectors/track
[greg@duke:greg]$ /sbin/sfdisk -s
/dev/hde: 58673664
/dev/hdg: 60051600
total: 118725264 blocks
[greg@duke:greg]$
So, as you can see it is an admin tool. Remember Debian is all about
giving the least amount of rights needed to do you job as a user. Also,
usually does not include /sbin and /usr/sbin in the default user path.
> How can I know what HDs I have in my system (so that I can feed to
> result to the rest of my script)?
>
> Other things I can do with other distros but not debian are:
>
> - get all disk geometries
>
> $ sfdisk -g
> /dev/hdd: 2494 cylinders, 255 heads, 63 sectors/track
> /dev/hda: 7476 cylinders, 255 heads, 63 sectors/track
>
> - get all partitions
>
> fdisk -l | grep '^/hd[a-d]'
> /dev/hdd1 1 64 514048+ 82 Linux swap
> /dev/hdd2 * 65 319 2048287+ 83 Linux
> [...]
> /dev/hda1 1 64 514048+ 82 Linux swap
> /dev/hda2 65 321 2064352+ b Win95 FAT32
[greg@duke:greg]$ /sbin/fdisk -l | grep '\/hd[a-g]'
Disk /dev/hde: 60.0 GB, 60081831936 bytes
/dev/hde1 1 310 156208+ 83 Linux
/dev/hde2 311 16184 8000496 83 Linux
/dev/hde3 16185 114432 49516992 83 Linux
/dev/hde4 114433 116416 999936 82 Linux swap
Disk /dev/hdg: 61.4 GB, 61492838400 bytes
/dev/hdg1 * 1 7476 60050938+ c W95 FAT32 (LBA)
once again, it was in /sbin. Not a default path for users.
> I'll stress that my questions are scripting-wise. I need to write
> generic script that doesn't require me to throw in specific hd
> info for it to run. I think the disk tools is sadly a week point
> in Debian, or maybe I haven't find the right gadget. Please help.
Not a matter of finding the right Gadget, just that you are used to a
sloppy implementation of Linux. Good habits are generally learned using
Debian.
--
greg, greg@gregfolkert.net
The technology that is
Stronger, better, faster: Linux
Attachment:
signature.asc
Description: This is a digitally signed message part