How create partition from parts of two existing ones?

I’ve got the following setup:

/root = 10 GB Free
/home = 9 GB Free

What I’d like to do is take 5 GB from root and 4 GB from home and combine them into a new partition. How would I do this?

You can try a live CD like gparted live. But it can only move space from one partition to another under certain conditions. Obviously the partitions have to be adjacent. And it also won’t work if one is logical and the other is physical.

If the arrangement of partitions does not lend itself to ken’s suggestion, you can use Gparted to shrink the partitions by the amounts you have suggested. Then use the extra space to create the extra partition you need.

But this and ken_yap’s method hinge on your current partition lineup. Please post the partitioning as shown by this console command:

sudo /sbin/fdisk -l

Paste that dialogue back here, and maybe we can advise you further.

6tr6tr wrote:

> How would I do this?

After using gparted (Ken’s suggestion) to resize the existing partitions,
you can glob them together into a single logical drive with either LVM or
EVMS. I suggest EVMS.

HTH!


Menes Narmer
menesofmemphis [at] gmail [dot] com

“Unity and humility is the lesson all of history teaches.”


Device Boot      Start         End      Blocks    Id  System
/dev/sda1        1             121      971901    82  Linux swap / Solaris
/dev/sda2   *    122           1856     13936387+ 83  Linux
/dev/sda3        1857          4427     20651557+ 83  Linux

I believe my setup fits what you were saying: logical and they’re right next to each other.

So then my steps are:

  1. Burn gparted on to a CD (does this make it bootable, or do i have to do something to set that up)?
  2. boot into gparted CD
  3. Shrink the size of /dev/sda2 and /dev/sda3
  4. Restart OpenSUSE
  5. Download and run EVMS (can this be run inside OpenSUSE, or do I have to boot from a disk into it?)
  6. Use EVMS to create the new partition (any idea what type it should be if I’m putting Xen on it?)

Also, why EVMS to create the partition and not gparted?

Is that correct?

Those are all primary partitions. I believe the following is what you are suggesting:

  1. sda2 is the root partition
  2. sda3 is the /home partition
  3. you want to shrink both sda2 and sda3
  4. you want to make a new partition, sda4 in the spare space that will be created

Correct me if I’m wrong.

Here are the steps:

  1. back up any data that you don’t want to lose. Put it on a medium different from drive sda.
  2. Boot into Suse and log on as root.
  3. Unmount the partition sda3 with this command in a console:
umount /dev/sda3
  1. open Yast → system → expert partitioner and resize (shrink) sda3
  2. reboot and log in as a normal user
  3. download Gparted on a bootable CD from this site: gparted-live-0.3.9-4.iso
  4. Burn and boot the Live Gparted.
  5. Using Gparted, shrink sda2 and move sda3 sideways to the left. Do not create a new sda4 in Gparted
  6. Reboot to Suse and use Yast partitioner to create sda4

I’ve used Gparted minimally, and used Yast partitioner where possible, because that’s a good policy. Suse reacts better when it uses its own tools.

Questions and response below…

That is correct!

Will do, but what are the risks for losing data in this situation? Is it a big/expected risk, or just if something unforseen happens?

Sorry, I’m just a little confused. In step 3, you said to shrink sda2 with Yast. And now in this step you say to shrink it in gparted again. Is that correct or did you mean to use Yast (in step 3) to shrink sda3 not sda2?

In other words, use Yast to shrink the outer partition and gparted to shrink the inner partition?

Thanks again!

Will do, but what are the risks for losing data in this situation? Is it a big/expected risk, or just if something unforseen happens?

Gparted is a GUI. It’s very accommodating. It will obey you and allow you to do things that aren’t a good idea and then make them happen when you click to apply your changes. And you can lose a partition. So that’s why I say back up the data, in case you do something that requires openSUSE’s root or /home partitions to be reinstalled.

I would use these exact moves in GParted:

  1. Shrink sda2 by moving the right hand boundary to the left.
  2. Drag the whole of sda3 to the left (not left boundary then right boundary – drag the whole rectangle)
  3. Click apply all changes icon

Sorry, I’m just a little confused. In step 3, you said to shrink sda2 with Yast. And now in this step you say to shrink it in gparted again. Is that correct or did you mean to use Yast (in step 3) to shrink sda3 not sda2?

I made a typo and said to shrink sda2 when I should have said sda3.

In other words, use Yast to shrink the outer partition and gparted to shrink the inner partition?

I confused you with my typo – yes, do the outer (sda3) with Yast then with Gparted shrink the inner (sda2) and move the pre-shrunk sda3 to the left.

Thank you SOOOO much! You have been very patient and helpful here and i really appreciate it!

Just one thing: your avatar is freaky! :wink:

My pleasure – glad you can now change it to what you want.

Just one thing: your avatar is freaky! :wink:

Is this any better.

LOL, yes, that’s perfect! lol!