ext3 Partition verkleinern

FreeBSD, Gentoo, openSUSE, CentOS, Ubuntu, Debian
perlitz
Posts: 202
Joined: 2003-11-01 12:25
 

ext3 Partition verkleinern

Post by perlitz »

Hallo,

unser Server ist recht fragwürdig partitioniert, was ich gerne ändern würde. Ich möchte hda3 auf 1GB verkleinern....

So schauts jetzt aus:

Code: Select all

                          Disk Drive: /dev/hda
                       Size: 164696555520 bytes, 164.6 GB
             Heads: 255   Sectors per Track: 63   Cylinders: 20023

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    hda1        Boot        Primary   Linux ext2                          57.58
    hda2                    Primary   Linux swap / Solaris              1077.52
    hda3                    Primary   Linux ext3                      163559.70
Nur den mutigen gehört die Welt also ein los mit parted...
Und sogleich gebremst:

Code: Select all

ext2 filesystem has a rather strange layout! Parted can't resize this (yet).
OK, not yet... also ein:

Code: Select all

resize2fs /dev/hda3 1024M
Scheint zu gehen... nur ist die Partion nicht kleiner geworden. Ein erneuter aufruf bringt

Code: Select all

The filesystem ist already 262144 blocks long. Nothing to do!
Ich bin ratlos... :cry:

Was übersehe ich? Muss ich bei resize2fs noch was tun, damit die Ã?nderung greift?
perlitz
Posts: 202
Joined: 2003-11-01 12:25
 

Re: ext3 Partition verkleinern

Post by perlitz »

hmmm,

nachdem ich jetzt per FDISK die Partition gelöscht habe, und dann erneut (jedoch nur 1GB gross) angelegt habe, scheint es zu klappen... :roll:

Somit is dann wohl die Vermutung naheliegend, das resize2fs zwar das Filesystem verkleinert hat, nicht jedoch die Partition... liege ich da richtig?

Gibts ne möglichkeit das "eleganter" zu lösen?
captaincrunch
Userprojekt
Userprojekt
Posts: 7066
Joined: 2002-10-09 14:30
Location: Dorsten
 

Re: ext3 Partition verkleinern

Post by captaincrunch »

Somit is dann wohl die Vermutung naheliegend, das resize2fs zwar das Filesystem verkleinert hat, nicht jedoch die Partition... liege ich da richtig?
man resize2fs wrote: The resize2fs program does not manipulate the size of partitions. If you wish to enlarge
a filesystem, you must first make sure you can expand the size of the underlying partition
first. This can be done using fdisk by deleting the partition and recreating it with a
larger size. When recreating the partition, make sure you create it with the same start‐
ing disk cylinder as before! Otherwise, the resize operation will certainly not work, and
you may lose your entire filesystem. After running fdisk, run resize2fs to resize the
ext2 filesystem to use all of the space in the newly enlarged partition.
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc