<---- template headericclude ----->
Resizing partition ....
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Mr Tux Guest

    Resizing partition ....

    Hi !

    I am a noobie.

    I want to erase my Win partition(/dev/hda1) and add the space to my / (/dev/hda3) partition instead.

    But I want my current fc3 installation on /dev/hda3 intact and NOT erased because of the procedure.

    How to do it ? Help me, please !!!

    When I run fdisk, I get this:
    Code:
    Command (m for help): p
    
    Disk /dev/hda: 10.0 GB, 10005037056 bytes
    255 heads, 63 sectors/track, 1216 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *           1         383     3076416    c  W95 FAT32 (LBA)
    /dev/hda2             384         451      546210   82  Linux swap
    /dev/hda3             452        1216     6144862+  83  Linux
    I now (like I said) want to simply add my /dev/hda1 to /dev/hda3, so I get more room on my /dev/hda3 partition.

    I run as "root" all the time.

    I want to run a command (or several) in the console, that fix it for me, but I can't figur it out for my self.

    Somebody, help me !!!
    Last edited by Mr Tux; 2nd July 2005 at 09:49 PM.

  2. #2
    Join Date
    Nov 2004
    Location
    Seymour, Indiana
    Posts
    2,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The way I would do is use a live CD like Knoppix and run qtparted on it. This is going off you info. The way I see it is Winxp is one partition, swap is another, and your entire linux distro is on the thrid.

    Less work idea.
    First reduce the /dev/hda1 to the minimum available option. Don't delete completely.
    Then move /dev/hda2 to the end of /dev/hda1.
    And finally increase the size of /dev/hda3.

    Little more work.
    Do the same as above except delete /dev/hda1 all together.
    Move /dev/hda2 to beginning which now becomes /dev/hda1.
    Now increase the size of /dev/hda3 to maximum which of course becomes /dev/hda2.
    Now before leaving you need to mount your /dev/hda3 which should now be /dev/hda2 and edit /boot/grub.conf if you are using grub.
    In it you need to change the root ID from root (0,2) to root (0,1) since you removed one partition and this is where your /boot directory is now located.
    Also edit the root=/dev/hda3 to root=/dev/hda2 in the kernel section since this is where your kernel is located now.

    I think I covered all the bases. If I miss something I will post.
    Brian1

  3. #3
    Mr Tux Guest
    Ok, thanx very much !

    I run Grub.

    I will read and think about your instructions and understand it, before I get into action.

    I come back ....

  4. #4
    gavinw6662 Guest
    Quote Originally Posted by Brian1
    The way I would do is use a live CD like Knoppix and run qtparted on it. This is going off you info. The way I see it is Winxp is one partition, swap is another, and your entire linux distro is on the thrid.

    Less work idea.
    First reduce the /dev/hda1 to the minimum available option. Don't delete completely.
    Then move /dev/hda2 to the end of /dev/hda1.
    And finally increase the size of /dev/hda3.

    Little more work.
    Do the same as above except delete /dev/hda1 all together.
    Move /dev/hda2 to beginning which now becomes /dev/hda1.
    Now increase the size of /dev/hda3 to maximum which of course becomes /dev/hda2.
    Now before leaving you need to mount your /dev/hda3 which should now be /dev/hda2 and edit /boot/grub.conf if you are using grub.
    In it you need to change the root ID from root (0,2) to root (0,1) since you removed one partition and this is where your /boot directory is now located.
    Also edit the root=/dev/hda3 to root=/dev/hda2 in the kernel section since this is where your kernel is located now.

    I think I covered all the bases. If I miss something I will post.
    Brian1
    you could also do a yum search qtparted
    yum install qtparted.

    I did it the other day, nice gui for doing such a partition.

  5. #5
    Mr Tux Guest
    Quote Originally Posted by Brian1
    Do the same as above except delete /dev/hda1 all together.
    Move /dev/hda2 to beginning which now becomes /dev/hda1.
    Now increase the size of /dev/hda3 to maximum which of course becomes /dev/hda2.
    Now before leaving you need to mount your /dev/hda3 which should now be /dev/hda2 and edit /boot/grub.conf if you are using grub.
    In it you need to change the root ID from root (0,2) to root (0,1) since you removed one partition and this is where your /boot directory is now located.
    Also edit the root=/dev/hda3 to root=/dev/hda2 in the kernel section since this is where your kernel is located now.
    Ok, I think I delete the /dev/hda1 and do the rest you suggest.

    Is it fdisk I will work with ?
    Is it to much to ask, if I can get the console-commands for doing it ?


    Here is my grub.conf:
    Code:
    # 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,2)
    #          kernel /boot/vmlinuz-version ro root=/dev/hda3
    #          initrd /boot/initrd-version.img
    #boot=/dev/hda
    default=0
    timeout=20
    splashimage=(hd0,2)/boot/grub/splash.xpm.gz
    hiddenmenu
    title Fedora Core (2.6.11-1.35_FC3)
    	root (hd0,2)
    	kernel /boot/vmlinuz-2.6.11-1.35_FC3 ro root=LABEL=/ rhgb quiet
    	initrd /boot/initrd-2.6.11-1.35_FC3.img
    I don't understand this "root=LABEL=/ rhgb quiet" what is this ?
    Can I or should I change this to "kernel /boot/vmlinuz-2.6.11-1.35_FC3 ro root=/dev/hda2"

    Thanks !
    Last edited by Mr Tux; 3rd July 2005 at 03:33 PM.

  6. #6
    Join Date
    Nov 2004
    Location
    Seymour, Indiana
    Posts
    2,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As root type ' fdisk /dev/hda '. Actually qtparted can do all of the above as far as removing and resizing partitions in a gui. fdisk is just a partition creator or deletor. It will not resize. You can use parted as well. Been a while since using it that way for me.

    Brian1

  7. #7
    Mr Tux Guest
    Ok, qtparted is now installed on my fedora 3 machine.

    What to do now ?

    Do qtparted changes to grub.conf, fstab and other important boot-files ?
    Or do I have to change them manually ?
    Last edited by Mr Tux; 3rd July 2005 at 05:41 PM.

  8. #8
    Join Date
    Nov 2004
    Location
    Seymour, Indiana
    Posts
    2,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would not run qtparted from the harddrive you are trying to modify. It can be done but requires many changes to parted as well as knowing what is going on. It needs to be ran from another harddrive with linux on it or use a live cd like knoppix. knoppix comes with qtparted built in. What it amounts to you can not modify a mounted partition. Since your system as only one linux partition it has to be mounted to run qtparted, but you can not modify the linux partition. All you can do is modify hda1 hda2 to what you want. You just can't do anything to hda3.

    Brian1

  9. #9
    Join Date
    Nov 2004
    Location
    Seymour, Indiana
    Posts
    2,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Forgot to answer the other questions. Modify grub.conf manually. I forgot you need to modify /etc/fstab. More than likely you have made no changes and it is using LABELS to define it mount points. What you need to edit is /etc/mtabs. This is where label references are defined. This needs to be done manual as well. Before trying make sure you have a working rescue disk. Knoppix will do well for this. Make backup of files before modifying.

    If unsure post your /boot/grub/grub.conf, /etc/fstab, /etc/mtabs files for a quick look over.

    Brian1

  10. #10
    Mr Tux Guest
    Well, I suppose you don't want me to do this partition resizing thing ...

    I understand it will be a very risky manoeuvre.

    Ok, I will skip it then, and do a backup on my documents and stuff.
    Then I will get cdrom's of fedora 4 and totally do a clean reinstall of fedora 4.

    Well, thank's anyway Brian1 for all the information you provided me.

    Have a good day,

    Sincerely,
    Philip from Sweden.

  11. #11
    Join Date
    Nov 2004
    Location
    Seymour, Indiana
    Posts
    2,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do it but since it is new to you I recommend you backup certain files you plan to change. Even after 20 years of computers I still backup files before modifing them. It has saved many hours of work. Also resizing harddrives can go wrong even with the greatest of windows partition managers. If data is important then always have backups of it.

    Now you can run qtparted but you cannot resize the linux partition since you are running qtparted from it. Even Windows Partition Magic does not work on it self. Since it is fc3 and you more than likely still using ext3 then you can't resize it if it is mounted. It really causes havic. That why you need to run it from another linux OS. Using Knoppix Live CD is a great tool to have around. I just recommend it because you are more likely to use gui versus command line ( I don't know your true computer skills and most users these days like gui). You can use the parted app which is what qtparted uses. It is just non gui. Now if you have a boot disk with parted on it then you can run the command version of parted since you have not mounted the harddrive itself. Its that I don't use parted anymore and forgotten alot about it.

    Hope this helps you out and to understand certain things can and can't be done.
    Brian1

  12. #12
    Mr Tux Guest
    Yes, thank you very much Brian1, for the info.

    You have certainly saved me from a hdd havic . Thanks for that too ....

    Mr Tux
    Last edited by Mr Tux; 3rd July 2005 at 09:44 PM.

  13. #13
    k3of4 Guest
    I tried to resize a partition using the instructions here for parted:

    http://www.redhat.com/docs/manuals/l...size-part.html

    I have an 80 gig drive that has 40 gb of unallocated space... bad consequence of ghosting a 40 to an 80gig drive. I want to resize that last partition to fill the available space, but in fc4 parted reports that it can't detect file system.

    Code:
    Using /dev/hda
    (parted) print
    Disk geometry for /dev/hda: 0.000-76319.085 megabytes
    Disk label type: msdos
    Minor    Start       End     Type      Filesystem  Flags
    1          0.031    101.975  primary   ext3        boot
    2        101.975  38162.219  primary               lvm
    (parted) resize 2
    Start?  [101.9751]?
    End?  [38162.2188]? 76319.085
    Error: Could not detect file system.
    I don't understand why the filesystem type isn't defined, since this is pretty much a straight install of FC4, seems like it would be. If anyone can give me an idea how to resolve this problem (help parted detect the file system, or resize the partition another way) I'm happy for any thoughts!

    k3

  14. #14
    wizard Guest
    I wrote an article on how to fix this - start somewhere around step 7:

    http://www.fedoraforum.org/forum/showthread.php?t=73119

    good luck!

  15. #15
    k3of4 Guest
    wizard, thanks for this link - it gave me a little more direction - but as with most Linux documentation I've found, the parts of the instructions that are inferred are the parts I don't know.

    I boot to the FC4 rescue CD and skip mounting the partitions. Still, I can't move the swap partition to the end of the drive. How do I do that? Part of my problem is that I don't understand how Fedora structured this filesystem to begin with:

    Code:
    # df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                          37672480   3075072  32683760   9% /
    /dev/hda1               101086     39017     56850  41% /boot
    none                    508932         0    508932   0% /dev/shm
    That /dev/mapper business is lost on me. hda1 is the boot partition, obviously, which seems to be the same thing as parted's /dev/hda Minor 1. Where the other partitions are within parted I don't know, since all I have is a lvm flagged Minor 2 with no filesystem defined for the rest of the disk.

    Anyway, getting to your instructions, you said to use parted to move the swap partition to the very end of the drive. Where is the swap partition? I can't see that in parted for the same reason I can't just resize the partition in parted: no filesystem is defined, and the /dev/mapper stuff isn't even available to parted when I skip mounting these filesystems at rescue boot.

    Maybe you're willing to take one more step back and explain this process to me..?
    Last edited by k3of4; 7th November 2005 at 09:55 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. Resizing partition
    By bardaos in forum Using Fedora
    Replies: 3
    Last Post: 15th May 2006, 07:50 PM
  2. resizing a lvm partition
    By roskoo in forum Installation, Upgrades and Live Media
    Replies: 1
    Last Post: 26th November 2005, 09:54 AM
  3. partition resizing
    By jameson in forum Using Fedora
    Replies: 4
    Last Post: 1st March 2005, 12:32 AM
  4. Resizing FC2 Partition?
    By Red Army in forum EOL (End Of Life) Versions
    Replies: 6
    Last Post: 2nd October 2004, 11:02 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]