LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-28-2010, 04:13 AM   #1
dfw7400
LQ Newbie
 
Registered: Apr 2009
Location: Belgium
Distribution: oel, centos, redhat
Posts: 3

Rep: Reputation: 0
Question using parted on a primary partition


Hello,

On a mail server, We have the following FS:
Code:
[user@server ~]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 38G 34G 2.1G 95% /
/dev/sda1 99M 17M 78M 18% /boot
/dev/sda4 29G 27G 728M 98% /home/vpopmail
tmpfs 1014M 0 1014M 0% /dev/shm
as you can see the /dev/sda4 is nearly full...
Code:
[user@server ~]# fdisk -l

Disk /dev/sda: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 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        5091    40789035   83  Linux
/dev/sda3            5092        5221     1044225   82  Linux swap / Solaris
/dev/sda4            5222        8957    30009420   83  Linux
The disk is not fully used, /dev/sda has 214.7 GB

The output of the parted utility is:
Code:
Disk /dev/sda: 215GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  107MB   107MB   primary  ext3         boot
 2      107MB   41.9GB  41.8GB  primary  ext3
 3      41.9GB  42.9GB  1069MB  primary  linux-swap
 4      42.9GB  73.7GB  30.7GB  primary  ext3
My question is the following:
as /dev/sda4 is the last partition of the disk, can I use parted to grow (resize) this primary parition (to take all the free space left)?


Thanks in advance!

Last edited by dfw7400; 07-28-2010 at 04:35 AM. Reason: add quote
 
Old 07-28-2010, 05:01 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Certainly.
 
Old 07-28-2010, 05:33 AM   #3
dfw7400
LQ Newbie
 
Registered: Apr 2009
Location: Belgium
Distribution: oel, centos, redhat
Posts: 3

Original Poster
Rep: Reputation: 0
Great, then, I will do it this night:

- stop the processes who write in the FS
- backup the machine (VM snapshot)
- umount the volume
- parted resize
- mount the volume
(Hope that the data will still be there...)
- restart the processes
- if all OK, just to be sure, a reboot


Seems this OK?



Regards,
 
Old 07-28-2010, 01:26 PM   #4
dfw7400
LQ Newbie
 
Registered: Apr 2009
Location: Belgium
Distribution: oel, centos, redhat
Posts: 3

Original Poster
Rep: Reputation: 0
It didn't work...
so
I turned the partiton into a ext2...
and now .. still the same, it doesn't work:

Code:
Disk /dev/sda: 215GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  107MB   107MB   primary  ext3         boot
 2      107MB   41.9GB  41.8GB  primary  ext3
 3      41.9GB  42.9GB  1069MB  primary  linux-swap
 4      42.9GB  73.7GB  30.7GB  primary  ext2

(parted) resize 4
Start?  [42.9GB]?
End?  [73.7GB]? 215GB
Error: File system has an incompatible feature enabled.



any idea?
 
Old 07-28-2010, 02:17 PM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Try gparted. It is a graphical resizer. You simply highlight the partition sda4 and click it right hand side boundary to whatever position you fancy and then commit to the change.

Your hard disk has 26108 cylinders but your last cylinder of sda4 is 8957 so plenty to expand.

Since you have used up all 4 primaries (sda1 to sda4) you will not be able to have more partition.

Last edited by saikee; 07-28-2010 at 02:21 PM.
 
  


Reply

Tags
parted, partition, primary, resize


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
gpt label in parted, partitions look OK. GrUB not booting 64bit OS on 8th primary digital8doug Linux - Newbie 1 12-31-2008 02:20 PM
openSolaris hosed the partition table. Why? Changing primary to secondary partition? JZL240I-U Solaris / OpenSolaris 9 10-16-2008 10:48 AM
Partition Problems: Bad primary partition 1: logical partitions overlap rovitotv Slackware 6 01-08-2006 06:55 PM
Increasing Size of Primary Windows Partition Using Parted overthinker Linux - Newbie 6 01-01-2005 09:56 AM
Increasing Size of Primary Windows Partition Using Parted overthinker Linux - Software 2 12-31-2004 12:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:53 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
Open Source Consulting | Domain Registration