LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 09-09-2009, 07:13 AM   #1
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Rep: Reputation: 18
Resizing / (root) partition


Hi,


Let's being with an example as given below:

Here's the current status of the partition / mount point for / (root):

Code:
[root@localhost ~]# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2550    20482843+  83  Linux
Now, how can we resize (increase and decrease) the size (hard disk space) of the / (root) partition?

Note: I have tried LVM and it works for SWAP and other partitions / mount points. However, not sure if it can work for / too.


Thanks!
 
Old 09-09-2009, 08:06 AM   #2
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
Assuming you have empty space after the end of that partition, GParted should allow you expand it. Most filesystems should allow you to expand them to fill the newly available space in the partition, but some of them don't supporting being shrunk. GParted (along with the appropriate tools for the given filesystem) should make it pretty easy to expand or shrink a partition and the filesystem. Where supported, you'll only be able to shrink a filesystem by however much free space there is.

For ext2/3/4, the package (in Debian at least) is called e2fsprogs. For ntfs, it's called ntfsprogs. For jfs, it's called jfsutils. Search your package manager for the name of the filesystem and you should see a package in the results with tools or utils or whatnot, that will be the package containing the software that will allow you to expand or shrink (where supported) the filesystem in question.

Last edited by lurko; 09-09-2009 at 08:10 AM. Reason: always something to edit!
 
Old 09-09-2009, 11:50 AM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by Hi_This_is_Dev
Code:
[root@localhost ~]# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2550    20482843+  83  Linux
Now, how can we resize (increase and decrease) the size (hard disk space) of the / (root) partition?

Note: I have tried LVM and it works for SWAP and other partitions / mount points. However, not sure if it can work for / too.
ID 83 indicates a regular Linux partition, so: no, you're not going to be able to resize this using lvm2 utilities.

I would recommend using a live cd (gparted live is fine in this case) to resize /.
 
Old 09-09-2009, 11:56 AM   #4
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
Quote:
Originally Posted by anomie View Post
I would recommend using a live cd (gparted live is fine in this case) to resize /.
That's an excellent point that should have occurred to me. The GParted LiveCD is so great.
 
Old 09-10-2009, 06:26 PM   #5
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Well, I have downloaded GParted LiveCD ISO and ZIP files. I will try them and post my findings here. However, I must say that it is a great idea!

Thanks!
 
Old 09-10-2009, 06:48 PM   #6
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
What do you mean by a great idea? Isn't that is what Gparted invented for?

It can do NTFS partitions too.
 
Old 09-10-2009, 07:34 PM   #7
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
"By a great idea"

I meant thanks for letting me know how to do what I asked here.

"Isn't that is what Gparted invented for?"


Nope, I am not sure of that yet. I have to give it a try and then give my opinions.


Thanks for your post!

Quote:
Originally Posted by saikee View Post
What do you mean by a great idea? Isn't that is what Gparted invented for?

It can do NTFS partitions too.
 
  


Reply

Tags
resizing



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
resizing root partition mcbenus Linux - Software 9 09-05-2007 05:15 PM
resizing the root partition ruffianopatsu Linux - Hardware 1 12-11-2005 04:08 PM
Resizing Root Partition dudeman41465 Linux - Software 5 10-09-2005 04:36 AM
Resizing root partition?! black hole sun Mandriva 6 07-16-2004 12:00 AM
Resizing root partition bitpicker Linux - Newbie 10 09-12-2003 07:26 AM

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

All times are GMT -5. The time now is 04:50 AM.

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