[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 1.4.18 problem with counting?
From: |
Pixel |
Subject: |
Re: 1.4.18 problem with counting? |
Date: |
27 Sep 2001 14:02:04 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.104 |
Andrew Clausen <address@hidden> writes:
> Did you reboot? Parted will often display a rant about not doing anything
> with modified partitions before rebooting...
About this reboot needed restriction (BLKRRPART), there is a linux 2.4
extension that get rid of it:
> This BLKPG_ADD_PARTITION stuff is rather powerful. You can add and delete
> partitions on the fly. No kernel parsing partition tables is needed, userspace
> tells the kernel where the partition starts, how large it is, what labels it
> has.
It works quite nicely (I only use it in diskdrake for adding partitions), but
doesn't get along nicely with devfs.
Here is an example of use (XS code easily translatable in pure C)
--------------------------------------------------------------------------------
int
add_partition(hd, start_sector, size_sector, part_number)
int hd
unsigned long start_sector
unsigned long size_sector
int part_number
CODE:
{
long long start = start_sector * 512;
long long size = size_sector * 512;
struct blkpg_partition p = { start, size, part_number, "", "" };
struct blkpg_ioctl_arg s = { BLKPG_ADD_PARTITION, 0, sizeof(struct
blkpg_partition), (void *) &p };
RETVAL = ioctl(hd, BLKPG, &s) == 0;
}
OUTPUT:
RETVAL
--------------------------------------------------------------------------------
cu Pixel.