0

I am asking for help on how to properly extend the size of partition Here is my situation.

Running fdisk -l, give this result

root@ ~]# fdisk -l

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1058     8393962+  82  Linux swap / Solaris
/dev/sda3            1059        7457    51399967+  83  Linux

But on checking on the directadmin and df -l command, i see this result.

/dev/sda1   99M 12M 82M 13% /boot
/dev/sda3   48G 9.4G    36G 21% /

How am i going to extend the size of sda3 partition to add the extra/unallocated 1500GB disk space. Need the disk space to store xml files that will be parsed and transferred to mysql database.

Please help me. I am new to this thing. Any help would be appreciated. Thanks.

Modifications: I have read this article to resize a partition http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-disk-storage-parted-resize-part.html. However, I was not able to clearly understand the steps. Please help me with how to do the ff:

    -unmount any partitions(am I going to unmount the boot and root partition?)
    -turn off the swap space - ok (http://techie-buzz.com/foss/ubuntu-enable-disable-swap-partition.html)
    -minor number - ok (http://www.centos.org/docs/4/4.5/System_Administration_Guide/Standard_Partitions_using_parted-Viewing_the_Partition_Table.html)
    -the starting place in megabytes, and the end place in megabytes
    -and complete `resize` command to use.

Guys, I was able to research some commands to resize and identify the parameters but I'm not sure if it is correct. Here it is:

parted /dev/sda
print
resize 3 8702 200000

Please tell me if the above commands will be alright. I'm running on CentOs 5. ext3 filesystem for sda3 and 200GB of hard disk.

Thanks

Jan Mark
  • 15
  • 1
  • 6
  • Have you considered simply using the spare space as a new partition? Why don't you instead create and mount that as the location where you will put your lxml files and leave / as /dev/sda3? That would be the easiest solution considering you did not initially use LVM. – jnvilo Nov 19 '12 at 08:11
  • @jnvilo My xml files is stored with my php files which is in /usr/local and the I am also concern with my database after parsing the files which is in /var/lib/mysql/. If I'm going to create a new partition, I'm afraid of having to configure something for in regards to where my web and mysql files will be stored. Correct me if i'm wrong. What will be the best way? THanks – Jan Mark Nov 19 '12 at 08:17

1 Answers1

1

You don't need to turn off the swap partition because it is before the /dev/sda3 partition. Run fdisk to extend the end of partition 3 further. You may have to delete and recreate it, but as long as the start stays the same and the end is >= where it currently is, that will work.

Extending the filesystem depends on which FS you already have installed. For ext2/3/4, you'll typically use resize2fs.

Jeff Ferland
  • 20,547
  • 2
  • 62
  • 85
  • thanks again. Will you show me the complete resize command in my case? sda3 file system is ext3 (/dev/sda3: LABEL="/" UUID="0509a1e4-c1bc-4b18-9e7a-7a7158bf8534" TYPE="ext3" SEC_TYPE="ext2"). Thanks. – Jan Mark Nov 19 '12 at 08:43
  • How can Run fdisk to extend the end of partition 3 further? Or how will I know the end place in megabytes for resizing the sda3? Thanks – Jan Mark Nov 19 '12 at 09:12
  • @JanMark `man resize2fs` and since you're going to use the whole drive, run `cfdisk` and you'll see a "maximize" option. – Jeff Ferland Nov 19 '12 at 18:41