LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-03-2010, 11:59 AM   #1
vzxen
Member
 
Registered: Jul 2010
Posts: 126

Rep: Reputation: 4
Partition HardDrive


Hi,

I have a CentOS installed on one of my server with a HDD of 200 GB.
The fdisk -l output :
Disk /dev/sda: 200.0 GB, 200048565760 bytes
255 heads, 63 sectors/track, 24321 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 535 4192965 82 Linux swap / Solaris
/dev/sda3 536 24321 191061045 83 Linux


I want to partition /dev/sda3 into the following:
/dev/sda3 - 100GB
/dev/sda4 - 10GB
/dev/sda5 - 10GB
/dev/sda6 - 10GB
/dev/sda7 - 10GB

Can this be done while the DISK is mounted over SHELL.
Because I dont have physical access to the SERVER.
 
Old 07-03-2010, 01:00 PM   #2
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Use the FDisk utility:

Code:
su -c fdisk /dev/sda3
You can press 'm' at any time for help on the syntax of the command.
 
Old 07-03-2010, 01:13 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
You would use fdisk /dev/sda (not sda3)

First, delete sda3

Then create the new partitions (3 can be primary and the rest will have to be logical)


cfdisk or GParted are also good options---both are more user-friendly than fdisk.

Be sure to back up any important data before doing anything with partitions.
 
Old 07-03-2010, 02:50 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,929

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Just in case anyone missed this.

Quote:
Can this be done while the DISK is mounted over SHELL.
Because I dont have physical access to the SERVER.
And I assume from the information provided that sda3 is the / partition.
You would want to resize vs delete sda3 to create multiple partitions which can be accomplished using gparted. However, resizing requires the / partition to be unmounted which can not be done from a remote location.

To resize you will need physical access and boot the system using gparted's LiveCD and as stated be sure to back up anything important.
 
Old 07-04-2010, 01:32 AM   #5
vzxen
Member
 
Registered: Jul 2010
Posts: 126

Original Poster
Rep: Reputation: 4
So I have NO options to do it live via SSH using 'parted' ?
/dev/sda3 is the / partition

Why cant it be done live ?
I mean in windows its possible using tools like Partition Magic etc.
Why do I need to boot in Single user mode and do it ?

If I RESIZE /dev/sda3 while the partition is mounted will the data be lost ?
 
Old 07-04-2010, 08:02 AM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

Quote:
Originally Posted by vzxen View Post
So I have NO options to do it live via SSH using 'parted' ?
/dev/sda3 is the / partition

Why cant it be done live ?
I mean in windows its possible using tools like Partition Magic etc.
Why do I need to boot in Single user mode and do it ?

If I RESIZE /dev/sda3 while the partition is mounted will the data be lost ?
No, you will have conflicts attempting to perform any actions of this type on a mounted partition. Especially '/' since the multitasking multi-user system will be attempting writes to the mounted filesystems. When performing actions of this type then by booting 'single' user will insure no conflicts.

GNU/Linux is !M$ Win.

YES!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to partition my harddrive raakken Debian 11 08-27-2005 10:45 PM
Added second harddrive as a partition, but now the partition size is wrong.. mlsbraves Linux - General 5 08-17-2005 09:10 PM
Partition harddrive Ephracis Linux - Software 5 03-24-2005 02:12 PM
Cannot partition harddrive rkemp Linux - Hardware 1 10-11-2004 10:51 PM
How should I partition my Harddrive? cpender Linux - Software 1 02-14-2002 10:14 AM


All times are GMT -5. The time now is 09:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration