-1

I have a production server that is running on CentOS. I'd like to create a partition on the server without having to reinstall everything. I have CLI and VNC access to the remote server. Is there anyway that I can create a partition safely?

Here's my output from fdisk -l

Disk /dev/sda: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00033d5e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       10444    83885056   83  Linux

Thanks.

Kimmel
  • 1
  • 1
  • 1
    Is there free space on the disk? – Shane Madden Nov 21 '12 at 02:59
  • Hi @ShaneMadden. Yes there is. I'd like to partition 50GB from my existing drive. Thanks. – Kimmel Nov 21 '12 at 03:25
  • 1
    @Kimmel (1) ***WHY***? (What's the endgame? Why do you want/need to do what you're asking?) ; (2) Do you want to create a *new* partition, or *extend* an *existing* one? :-) – voretaq7 Nov 21 '12 at 03:26
  • Hi @voretaq7 I'm to install MySQL and one of the requirement is that the database itself should reside on another partition. – Kimmel Nov 21 '12 at 03:32
  • @Kimmel So this space is completely free right now, not assigned to an existing partition, correct? – Shane Madden Nov 21 '12 at 03:34
  • @ShaneMadden on my /dev/sda1 I have 73G. It is possible that I create a 50G partition from it? Thanks. – Kimmel Nov 21 '12 at 03:40
  • @Kimmel Depends if it's in use or not! Can you edit your question with the output from `fdisk -l`? – Shane Madden Nov 21 '12 at 03:41
  • @Kimmel Separate partitions are good, separate disks are better... Post the info Shane asked for though and we'll find out if your system has enough *unallocated* space on the disk to create another partition. – voretaq7 Nov 21 '12 at 04:01
  • I've edited my question with fdisk output. Thanks. – Kimmel Nov 21 '12 at 04:03
  • Install a new disk. Save yourself a ton of hassle for a little money. – HopelessN00b Nov 21 '12 at 05:28

2 Answers2

2

You currently have one big 85G partition that is occupying all the space on your disk. So, assuming you want to create a partition on the same /dev/sda disk, you'll have to shrink your current /dev/sda1 partition first. Unfortunately, this cannot be done online. You will have to reboot with a live rescue disk and shrink it from there. The tools to use are resize2fs (you are running CentOS so you are most likely using a flavor of the ext file system), then fdisk to delete and re-create the partition with a smaller size, and then... fdisk again to create the new partition.

As usual, be careful. These are potentially destructive tools, so maybe you should practice in a virtual machine first.

chutz
  • 7,888
  • 1
  • 29
  • 59
1

Based on your requirements and your lack of experience it is much safer to leave the server as it is.

Adding another partition will not improve the performance. MySQL will run fine on the same partition as the rest of the OS. Do not try to optimize something when you do not know where is the bottleneck.

Mircea Vutcovici
  • 17,619
  • 4
  • 56
  • 83