LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to resize ext3 partitions? (https://www.linuxquestions.org/questions/linux-general-1/how-to-resize-ext3-partitions-327062/)

VincentB 05-25-2005 02:43 PM

How to resize ext3 partitions?
 
All,

Recently I have installed Fedora Core 3.0 on my PC, in a dual boot with Windows XP. I have an issue now on this PC (DELL 510m - HD 60 Gb). One of the Linux partition will become soon full (/) while the other one (/home1) is nearly empty, as you can see hereafter.

Code:

(parted) print
Géométrie du disque pour /dev/hda: 0.000-57231,562 mégaoctets
Type d'étiquette de disque: msdos
Mineur  Départ      Fin    Type      Sys.fichiersFanions
1          0,031  2047,346  primaire  fat16
2      2047,346  9546,438  primaire  ntfs        amorce
3      9546,438  57231,562  étendue              lba
5      9546,469  11052,531  logique  ntfs
6      11052,562  26058,559  logique  ntfs
7      26058,590  32561,433  logique  ntfs
8      32561,464  39064,306  logique  ext3
9      39064,337  56062,771  logique  ext3
10    56062,802  57058,989  logique  linux-swap


On the XP partition, I have installed Partition Magic 8.0 which I used to resize the Windows partition, before installing FC 3.0. On an other PC, I used PM to resize a Linux partition ... which screw up the whole Linux partition: it did not boot anymore and I had to reinstall everything from scratch. My conclusion is then that PM is not the tool I should use to resize my laptop partitions.

On the Linux partition of my laptop, I have installed QTParted which does not allow me to manipulate Linux active partition (roughly speaking I can jut see that properties of my linux partitions).

Additional information (I am nevertheless not sure it is relevant) : I use grub as boot loader.
[
Code:


    root@fedora vincent]# more /etc/grub.conf
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE: You do not have a /boot partition. This means that
    # all kernel and initrd paths are relative to /, eg.
    # root (hd0,7)
    # kernel /boot/vmlinuz-version ro root=/dev/hda8
    # initrd /boot/initrd-version.img
    #boot=/dev/hda
    default=0
    timeout=5
    splashimage=(hd0,7)/boot/grub/splash.xpm.gz
    hiddenmenu
    title Fedora Core (2.6.10-1.770_FC3)
    root (hd0,7)
    kernel /boot/vmlinuz-2.6.10-1.770_FC3 ro root=LABEL=/ rhgb quiet
    initrd /boot/initrd-2.6.10-1.770_FC3.img
    title Windows XP
    rootnoverify (hd0,1)
    chainloader +1

and here is my fstab configuration file:

Code:

  [root@fedora vincent]# more /etc/fstab
    # This file is edited by fstab-sync - see 'man fstab-sync' for details
    LABEL=/ / ext3 defaults 1 1
    none /dev/pts devpts gid=5,mode=620 0 0
    none /dev/shm tmpfs defaults 0 0
    LABEL=/home1 /home ext3 defaults 1 2
    none /proc proc defaults 0 0
    none /sys sysfs defaults 0 0
    LABEL=SWAP-hda10 swap swap defaults 0 0
    /dev/hdc /media/cdrecorder auto pamconsole,exec,noauto,fscontext=system_u:object_r :removable_t,managed 0 0


Moreover (QT)parted does not resize ext3 partitions. I have then tried to boot from Knoppix, convert the ext3 partition to ext2 and tried to resize the partition with parted ... without success.

My question is simple: how do I have to proceed in order to safely transfer unused space from the /home1 partition to the / partition without destroying my linux installation or loosing data? I have already spent so much time in installing and configuring everything on this PC and I would really like to avoid to re-do it from scratch. I have googled a lot without finding a safe and step-by-step way of doing this.

Please describe your solution with as many details as possible.
Please avoid vague and unclear solution: I have already tried soo much ...

You are my last hope ...

Thanks in advance for your help.
Do not hesitate to ask for more information if something is missing or unclear in my explanations.


Vincent Borreux
Brussels-Belgium

kornerr 05-26-2005 11:56 AM

If you check all your partitions for errors in PM8, it should work.

You can resize ext3 with the help of "resize2fs".
(Maybe first you'll need to convert ext3 to ext2 (google))
But before using it read "man resize2fs"!
Also I HIGHLY recommend this very good link. Although it's about ntfs resizing, this document describes the use of an app which works just like "resize2fs".
Nevertheless you cannot move partitions with "resize2fs". But if you have enough space you can "simulate moving" (by creating/deleting/etc partitions).

Optionally you can read my signature:)

and I cannot see how "(parted) print" command can show you the available space... I believe that "(c)fdisk", "df -h" can do it... better.

"(qt)parted" can't resize ext3 (at least mine). But new "GParted", which uses "resize2fs" CAN do it (it needs modern GNOME libraries and it's only GUI app).


All times are GMT -5. The time now is 10:24 AM.