Announcement

Collapse
No announcement yet.

Need help resizing / partition

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need help resizing / partition

    I am on 8.04. The partition on which / is mounted has run out of space. In gparted, / is immediately preceed by /home and followed by extended, which has a huge size but no bytes available, It is followed by swap, then one smaller partitio from which I could steal bytes. However, clicking on resize shows no space available before or after /. What can I do? Thanks.

    #2
    Re: Need help resizing / partition

    Extended MUST have some bytes available! It contains all partitions starting with sdx5.

    sudo fdisk -lu

    would show us the picture.

    To your question ... you must FIRST make room for re-sizing the / partition before trying to do it. I.e., first, try moving the left boundary of the Extended. You must move things in sequence. Move only one at a time--I do not recommend queueing several partition changes at once (although the authors did up to 150 changes in their test).
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: Need help resizing / partition

      Here it is:
      albert@ALBERT:~$ sudo fdisk -lu
      [sudo] password for albert:

      Disk /dev/sda: 500.1 GB, 500107862016 bytes
      255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
      Units = sectors of 1 * 512 = 512 bytes
      Disk identifier: 0xe0472aba

      Device Boot Start End Blocks Id System
      /dev/sda1 * 63 30716279 15358108+ 7 HPFS/NTFS
      /dev/sda2 30716280 92148839 30716280 83 Linux
      /dev/sda3 92148840 116728289 12289725 83 Linux
      /dev/sda4 116728290 976768064 430019887+ 5 Extended
      /dev/sda5 116728353 120824864 2048256 82 Linux swap / Solaris
      /dev/sda6 120824928 145404314 12289693+ 83 Linux
      /dev/sda7 145404378 976768064 415681843+ 83 Linux

      Disk /dev/sdb: 259 MB, 259522560 bytes
      65 heads, 32 sectors/track, 243 cylinders, total 506880 sectors
      Units = sectors of 1 * 512 = 512 bytes
      Disk identifier: 0xc3072e18

      Device Boot Start End Blocks Id System
      /dev/sdb1 32 506877 253423 6 FAT16
      Partition 1 has different physical/logical endings:
      phys=(249, 64, 32) logical=(243, 44, 30)

      Comment


        #4
        Re: Need help resizing / partition

        Looks like you have to move the swap partition to the end of sda6.
        Then shrink sda6 to match exactly the swap inside it.
        Then delete sda5.
        Then grow the Extended up as far as you can to bump into the swap (by moving the left endpoint--or the start--of the Extended "to the right" (higher)).
        Then grow sda3 (by moving its right endpoint -- its terminal endpoint.
        (Hope I got that right -- but as you can see, it's common sense, taking one sequential step ata time, pushing it as far as you can go on that step.)

        Things to watch:
        Re-setting your swap in the file /etc/fstab.
        >>> I do not know the implications of moving a swap -- ? Seems it should be no problem as long as it's square in your fstab.
        Changing UUID numbers of affected partitions--editing again fstab and also GRUB /boot/grub/menu.lst (the root partition UUID.

        Big disk!
        440 GB in Extended.
        12 GB in your current root partition.
        1 GB should be enough for swap, I should think.
        sda6 has 12 GB.


        GParted (Live CD, USB, HD)
        http://gparted.sourceforge.net/livecd.php
        New Manual. New man page. See Documentation:
        http://gparted.sourceforge.net/documentation.php
        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Re: Need help resizing / partition

          Many thanks qMike. I booted into Parted Magic and used gparted to delete /sda6 and move swap so I ended up with following:
          sda4 extended 410.1g
          unallocated 2.93g
          sda5 swap 1.95g
          unallocated 8.79g
          sda6 396.43g
          The / partition is /sda3 and I believe I can go back into gparted and enlarge /sda3 by the 2.93g of unallocated but I decided to stop and check with you.

          ANOTHER THING TO REPORT. When I got out of Parted Magic to resume boot. I got fsck error. The reported problem is:

          log of fsck -C -R -A -a
          Mon Feb 23 17:41:31 2009

          fsck 1.40.8 (13-Mar-2008)
          WARNING: bad format on line 15 of /etc/fstab
          /dev/sda2: clean, 11771/1925120 files, 2404319/7679070 blocks
          /dev/sda6: clean, 22620/51970048 files, 2555258/103920460 blocks
          fsck.ext3: No such file or directory while trying to open /dev/sda7
          /dev/sda7:
          The superblock could not be read or does not describe a correct ext2
          filesystem. If the device is valid and it really contains an ext2
          filesystem (and not swap or ufs or something else), then the superblock
          is corrupt, and you might try running e2fsck with an alternate superblock:
          e2fsck -b 8193 <device>

          fsck died with exit status 8

          Mon Feb 23 17:41:32 2009

          My fstab is as follows:
          # /etc/fstab: static file system information.
          #
          # <file system> <mount point> <type> <options> <dump> <pass>
          proc /proc proc defaults 0 0
          # /dev/sda3
          UUID=e38270b7-e9ca-4bb7-b939-fb97471395d1 / ext3 relatime,errors=remount-ro 0 1
          # /dev/sda2
          UUID=cd446e71-9e00-4582-baf0-bb1a3b17af37 /home ext3 relatime 0 2
          # /dev/sda5
          UUID=2af623e6-e190-4690-b2e5-e7fdf3564996 none swap sw 0 0
          /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
          /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
          /dev/sda6 /mnt/sda6 ext3 defaults 1 2
          /dev/sda7 /DATA ext3 defaults 1 2

          I resumed boot with Control D and everything seems to be ok. Is there anything to worry about?

          Comment


            #6
            Re: Need help resizing / partition

            "The / partition is /sda3 and I believe I can go back into gparted and enlarge /sda3 by the 2.93g of unallocated but I decided to stop and check with you."

            Remember, you have to modify the extended partition by moving its starting endpoint (the left endpoint) to the right (up), then sda3 will have room to grow also "to the right" (up).


            "resumed boot with Control+D and everything seems to be ok. Is there anything to worry about?"
            I'm wondering if you have moved the upper endpoint of Extended "downward" (shrunk Extended the wrong way, cutting off sda7). Let's hope not. For now, Ctrl+D got you past that, and I'd put everything in place the way you want the final picture to be, then you may have to check this filesystem error with sda7. (Of course, it sounds naiive to always point it out as if no one ever thought of it, but with partition editing especially, you gotta fall back on your backups of any important personal/work data -- worst case, you simply reformat sda7 at the very end and copy your data back into it, sit back, have a cup of coffee while it hums along). Fact is, you are going to have to check all your affected UUIDs, too, as we said above. Just remember the Control+D trick--it often works to get past these non-fatal error messages re filesystem checks. (But, again, your data *may* be at risk.)

            A good description (with links) of fixing filesystem errors and even fixing superblocks, one that someone here used successfully recently--is herman's:
            Filesystems and Mounting (under ext2 & ext3 subsection):
            http://users.bigpond.net.au/hermanzone/p10.htm



            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #7
              Re: Need help resizing / partition

              Many thanks for reply and link. The fsck error happened because I had deleted sda6 and now the large partition (which was sda7) is sda6 and I not edited fstab before rebooting from Parted Magic disk to reflect this. Again, here is fstab right now:

              # /etc/fstab: static file system information.
              #
              # <file system> <mount point> <type> <options> <dump> <pass>
              proc /proc proc defaults 0 0
              # /dev/sda3
              UUID=e38270b7-e9ca-4bb7-b939-fb97471395d1 / ext3 relatime,errors=remount-ro 0 1
              # /dev/sda2
              UUID=cd446e71-9e00-4582-baf0-bb1a3b17af37 /home ext3 relatime 0 2
              # /dev/sda5
              UUID=2af623e6-e190-4690-b2e5-e7fdf3564996 none swap sw 0 0
              /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
              /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
              /dev/sda6 /mnt/sda6 ext3 defaults 1 2
              /dev/sda7 /DATA ext3 defaults 1 2

              I propose to remove second to last line (/dev/sda6) and change last line to
              /dev/sda6 /DATA ext3 defaults 1 2

              Will this do the trick or do I have to muck with UUID's? I will then go back to Parted Magic and get my partition sizes the way I want them.
              I am amazed that / filled up the way it has. I have been thinking there are a lot of unused files there and hoped there was something like cclean for windows. A google led me to kleansweep. I ran it and it found a pile of orphaned files but a google told me it was very dangerous to use kleansweep. If there are all these unused files that kleansweep found, how do I safely remove them ?

              Comment


                #8
                Re: Need help resizing / partition

                "I propose to remove second to last line (/dev/sda6) and change last line to
                /dev/sda6 /DATA ext3 defaults 1 2
                Will this do the trick or do I have to muck with UUID's? "

                I think it should work -- no harm done if it doesn't, then just use UUIDs (imitating the format of the rest of fstab where UUIDs are used).

                8.04: also, at Konsole
                kcontrol
                Privacy > then click the clean or remove button at lower right.

                As for unused files, I don't know. I think it's a crap shoot. Many tmp files are automatically deleted when you reboot. I can't recall exactly what I wrote in that Privacy 101 How-To about /usr and such -- I'd be very careful about a blanket deletion, though. In doing experiments (for Privacy 101), I do recall damaging my system (by messing with deletions, e.g., in various /usr-type directories that "looked" safe), until I had to re-install the whole thing.

                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment

                Working...
                X