LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Resizing / (root) partition (https://www.linuxquestions.org/questions/linux-server-73/resizing-root-partition-753846/)

Hi_This_is_Dev 09-09-2009 07:13 AM

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!

lurko 09-09-2009 08:06 AM

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.

anomie 09-09-2009 11:50 AM

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 /.

lurko 09-09-2009 11:56 AM

Quote:

Originally Posted by anomie (Post 3676126)
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.

Hi_This_is_Dev 09-10-2009 06:26 PM

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!

saikee 09-10-2009 06:48 PM

What do you mean by a great idea? Isn't that is what Gparted invented for?

It can do NTFS partitions too.

Hi_This_is_Dev 09-10-2009 07:34 PM

"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 (Post 3678041)
What do you mean by a great idea? Isn't that is what Gparted invented for?

It can do NTFS partitions too.



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