[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using parted



Bob,

Well, that might be a good suggestion. If I change the units in fdisk from
cylinders to sectors, the geometry table looks like:

Disk /dev/hda: 240 heads, 63 sectors, 6201 cylinders
Units = sectors of 1 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *        63    105839     52888+  83  Linux
/dev/hda2        105840  91672559  45783360   83  Linux
/dev/hda3      91672560  93759119   1043280   82  Linux swap

There is no rounding in these numbers. Start and End are integer sector
numbers which for this disk can range from 0 (the boot sector) to
93759119.

The Blocks size for /dev/hda2 is just (End-Start)*<sectorsize>/<blocksize>:

   (91672559-105840)*512/1024 = 45783360

Divide Blocks by 1024 to get the partition size in megabytes:

   45783360/1024 = 44710.3125

Ignore for a moment that the answer is not an integer number. We'll come
back to the fraction in a moment.

If we ignore the similarities between parameter names in parted and fdisk
-- start is not Start and end is not End -- then it appears we have a
couple of new questions:

(1) When changing the partition size (in megabytes) from start to end,
which fdisk (and boot sector) parameter is modified, Start or End (or
both)?

(2) Do I have to specify megabytes with decimal fractions to avoid
rounding issues in the start and end sector numbers?  For example, to get
Start and End values of 105840 and 91672559 do I have to enter 44710.3125
megabytes as the end value? Would 44710 result in a smaller value for End?

This is important because the slightest difference in these numbers will
probably cause an irretrievable loss in data. Rounding errors are simply
not tolerated.

--Doc

On Friday November 8, 2002 Bob T. Kat wrote:
> It wouldn't be asking for the start as in starting size of the
> filesystem and end as in ending size (what size you want it) would it?
> Just a thought
>
> Bob T. Kat
>
> "We demand rigidly defined areas of doubt and uncertainty."
>   - Douglas Adams -
>
>
> -----Original Message-----
> From: silug-discuss-owner@silug.org
> [mailto:silug-discuss-owner@silug.org] On Behalf Of Robert Savage
> Sent: Friday, November 08, 2002 2:50 PM
> To: silug-discuss@silug.org
> Subject: using parted
>
> I need some interpretive help with parted. My 48G Linux laptop drive is
> partitioned like this:
>
> Disk /dev/hda: 240 heads, 63 sectors, 6201 cylinders
> Units = cylinders of 15120 * 512 bytes
>
>    Device Boot    Start       End    Blocks   Id  System
> /dev/hda1   *         1         7     52888+  83  Linux    <-- /boot
> /dev/hda2             8      6063  45783360   83  Linux    <-- /
> /dev/hda3          6064      6201   1043280   82  Linux swap
>
> The bulk of that 45G root filesystem is occupied by the /pub directory
> in
> which I keep a bunch of ISOs, tarballs, RPMs, and other static kinds of
> stuff.
>
> I would like to do a fresh installation of RH8 to clear away any
> remaining
> vestiges of a severe Gnome2 problem that Dave "Lobster Boy" Lawrence was
> able to mostly fix at the Red Hat Road Tour show up at SIUE on Wednesday
> afternoon. Unfortunately with /pub in the same filesystem as /, I'll
> lose
> everything in a from-scratch installation.
>
> So my challenge is to use parted to shrink the present size of /dev/hda2
> and make room for another partition on which to mount /pub. Trouble is,
> when I run 'man parted' I'm greeted with the following documentation:
>
> Syntax: parted [options] [device [command [options]]]
>   where the resize option has the form:
>
>        # parted resize partition start end
>
> What has me scratching my bald spot is that man says the units for
> 'start'
> and 'end' are "megabytes". This can't be right. It would make more sense
> if start and end were specified as linear coordinates of some kind like
> cylinder numbers, the way fdisk reports them.
>
> Thoughts?




-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.