LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need help resizing / partition (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-resizing-partition-706933/)

ahurd 02-23-2009 02:48 PM

Need help resizing / partition
 
I am on Kubuntu 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 partition from which I could steal bytes. However, clicking on resize shows no space available before or after /. What can I do? Thanks.

Tinkster 02-23-2009 03:00 PM

Can you post the output of
fdisk -l
mount
and
df -m
in code tags?

ahurd 02-23-2009 03:10 PM

fdisk -l showed nothing. For the other 2 here it is.
Code:

albert@ALBERT:~$ mount
/dev/sda3 on / type ext3 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda2 on /home type ext3 (rw,relatime)
/dev/sda7 on /DATA type ext3 (rw)
overflow on /tmp type tmpfs (rw,size=1048576,mode=1777)
nfsd on /proc/fs/nfsd type nfsd (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

albert@ALBERT:~$ df -m
Filesystem          1M-blocks      Used Available Use% Mounted on
/dev/sda3                11907    11846        0 100% /
varrun                    1013        1      1013  1% /var/run
varlock                  1013        0      1013  0% /var/lock
udev                      1013        1      1013  1% /dev
devshm                    1013        0      1013  0% /dev/shm
/dev/sda2                29760      9155    19106  33% /home
/dev/sda7              399569      3611    375661  1% /DATA
overflow                    1        1        1  11% /tmp


Tinkster 02-23-2009 03:24 PM

For fdisk: try running as root (or using sudo).

ahurd 02-23-2009 03:32 PM

here it is:
Code:

albert@ALBERT:~$ sudo fdisk -l
[sudo] password for albert:

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

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        1912    15358108+  7  HPFS/NTFS
/dev/sda2            1913        5736    30716280  83  Linux
/dev/sda3            5737        7266    12289725  83  Linux
/dev/sda4            7267      60801  430019887+  5  Extended
/dev/sda5            7267        7521    2048256  82  Linux swap / Solaris
/dev/sda6            7522        9051    12289693+  83  Linux
/dev/sda7            9052      60801  415681843+  83  Linux

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

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


Tinkster 02-23-2009 03:41 PM

I guess you could disable swap, resize sda7, move the swap partition,
then resize extended, then move extended to the back of the drive and
increase root by what you gained. There's also the question what the
purpose of sda6 might be, which is partitioned but not used anywhere.



Cheers,
Tink


P.S.: Please, for posting output of command line tools, make use
of the CODE tags ... it makes is so much easier to read.

ahurd 02-23-2009 04:11 PM

Could you spell this out in more detail. I am not very clear what happens to available resizing space for remaining partitions when eg other partitions are deleted or resized. As to sda6 I am not sure what is in it but think it could be deleted. It is not mounted.

salasi 02-23-2009 04:39 PM

Quote:

Originally Posted by ahurd (Post 3454792)
and followed by extended, which has a huge size but no bytes available

This is normal. And I suspect that you haven't fully grasped what is going on (and my apologies in advance if I am explaining something that you actually already know).

'Extended' is a container partition; in other words it just acts as a 'placeholder' in the partition table saying, in effect, 'there are other partitions here, we'll get around to the details later'. To see what that means in practice, look at the starting and ending block numbers:
Code:

Device    Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        1912    15358108+  7  HPFS/NTFS
/dev/sda2            1913        5736    30716280  83  Linux
/dev/sda3            5737        7266    12289725  83  Linux
/dev/sda4            7267      60801  430019887+  5  Extended
/dev/sda5            7267        7521    2048256  82  Linux swap / Solaris
/dev/sda6            7522        9051    12289693+  83  Linux
/dev/sda7            9052      60801  415681843+  83  Linux

sda4 uses 7267 to 60801 and yet sda5, sda6 and sda7 are also mapped sequentially into that space (7267 to 7521, 7522 to 9051 and 9052 to 60801, respectively). That would make no sense (you'd be using the same block for two different things), except for the fact that sda4 is only a container for sda5, etc.

In terms of 'quick fixes' from where you are now:
  • Do you have a live CD that you can use? (this just makes the mechanics of fiddling with partition tables easier and isn't an absolute necessity)?
  • Do you have log files that are growing out of control? what else have you done that might be eating into disk space (storing media files?? installed lots of applications?) because at one point you had space, and now you don't. If you can even get a few hundred megabytes back temporarily, you'll have a bit of breathing space to make changes.
  • What about sda7 (/DATA). That looks to have plenty of spare space, and if you can push all the used stuff up to one end and split it, it looks as if that can give you plenty of space.
  • (Once you have made some space to do it) you could move something that is currently under '/' on to another partition; maybe moving something like /usr off on to a partition of its own would make you enough space.

ahurd 02-23-2009 08:17 PM

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?


All times are GMT -5. The time now is 04:56 PM.