Table of Contents

Resize_&_Create_Partitions_in_Debian

Resize a Current Partition

I needed to shrink a 135gb ext3 partition to 35gb, leaving space for another partition.

parted //the debian program

The process: parted /dev/sda

p //print partitions

resize # // where # is current partition number to be resized, e.g. “2” where partition is /dev/sda2 Start? blah //should be ok by defauly End? in New End of Partition

That should do it.

Create a Partition

Once the above resizing is done, and there unallocated space on the disks, type - cfdisk /dev/sda to see partitions. A new partition can be CREATED from the now available free space.

Choose the TYPE of the Partition required - ext3 or RAID etc.

In order to format the new partition created using cfdisk (above): mke2fs -j /dev/sda3

That should do it. cfdisk will show the format and partitions for you to check. mount /dev/sda3 /mnt/newfolder //will mount it.

Problems, Pitfalls, and Solutions

1. The space you shrink to - make sure to allow PLENTY of room for the filesystem!!!! 35gb turned out to leave 32gb!!

2. Now - if parted gives the following error: No Implementation: This ext2 filesystem has a rather strange layout! Parted can't resize this (yet).

You need to get the latest “testing” version of parted - v. 1.7 Debian sarge using 1.6. You will need to change /etc/apt/sources.list to move to testing (on rescue system) and upgrade. The new version of parted should work fine.


Sources:

http://www.linuxquestions.org/questions/showthread.php?t=360042

http://www.linuxforums.org/forum/debian-linux-help/49045-how-format-hard-disk.html