LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to extend an existing partition without LVM (http://www.linuxquestions.org/questions/linux-software-2/how-to-extend-an-existing-partition-without-lvm-449858/)

james.reid 05-30-2006 06:38 AM

How to extend an existing partition without LVM
 
Hi,

I have an ext3 partition that is full.

There is only one partition on the disk, and the partition takes up the entire disk.

I did not use LVM when setting up the disk.

I have installed a second disk, which I would like to partition and "merge" with the first disk.

Could someone give me some suggestions on how to do this (is it possible?)

Thanks!

James.

imagineers7 05-30-2006 08:42 AM

Hi James,

first of all you will have to remove journaling from your filesystem
and then you may use resize2fs.

Hope this hints will help you out

jeelliso 05-30-2006 08:47 AM

Since this is Linux, you are not tied down to the typical ideas about disc space. Remember you have the ability to mount any partition (other than root) to any directory you choose within the root directory tree. It may just be easier to mount a partition where you need the space. For example, I needed extra space for my Torrents directory so I could help seed more Linux distrobutions. I just partitioned 60 GB off my external hard drive. I then set it up to be mounted at boot to /home/jeelliso/.azureus/torrents so my computer thinks this folder is 60 GB big.

[edit]Good insight imagineers7, I always wondered why I could not resize my ext3 partitions.[/edit]

Good Luck,

~Justin

ZoolWay 05-30-2006 08:47 AM

Do you want to transfer the existing partion to the new harddisc or to enlarge it with the space on the new harddisc?

First one should be no problem with any image tool.
Second one could only be possible by turning into LVM/raid or something.

Best regards,
- ZoolWay

imagineers7 05-30-2006 08:55 AM

One more way:-

Mount that partition as some directory which is going to consume very heavy space

SUBARU 05-30-2006 09:00 AM

I did 13 pieces of ext3 partition manually (= hda13).

When I use LVM I cannot have many partition, so I give up on LVM.

If you want to merge(clone) to another disk use ;

dd command.

You can find archive on how to use dd command from this page.

haertig 05-30-2006 10:11 AM

Quote:

I did not use LVM when setting up the disk.
There are a couple of ways to procede. First, do you WANT to setup LVM now? Since you mentioned the fact that you didn't use it, that sounds like (1) You didn't know about it when you initially setup your system, and now wish you had, or (2) You consciously avoided it initially, and still wish you have nothing to do with it.

It will take a bit more work to setup LVM now, but it can be done. That would be my recommendation. In my experience, the people who don't use LVM have not run out of space yet, or they are unaware of what LVM can do. Once you've run yourself out of space like you have, you probably don't want to repeat the fiasco, and are more inclined to learn LVM. LVM adds some complexity (I think it's easy, personally), and this may not be desireable. If your system stays pretty constant and you can easily predict in advance where you'll need space (can that utopia ever be reached?) then LVM might be overkill for you.

BTW, you can easily get out of your predicament with or without LVM. LVM will just make it much easier NEXT time (there shouldn't be a next time basically), but at the expense of a little more work THIS time. Post #3 by jeelliso is the ticket if you want a non-LVM solution. Don't mess with resize2fs - that won't help you in your current situation (your disk is already full - nowhere to even consider resizing to!)

haertig 05-30-2006 10:22 AM

Quote:

Originally Posted by jeelliso
Good insight imagineers7, I always wondered why I could not resize my ext3 partitions.

I've resized my ext3 partitions many many times on several different systems. I don't see the problem that's being alluded to. I've never had to drop a journal. In the case of expanding the size of an ext3 filesystem, first you have to increase the size of the underlying disk storage (trivially easy with LVM, often difficult without). Journaling is left in place. An ext3 filesystem must be unmounted before you can resize it.

SUBARU 05-30-2006 12:04 PM

I still have 20gigs more free space.
When I use LVM , cannot get more partition.
PartMan think I have enough already.
((damn LVM))
sorry.......

haertig 05-30-2006 12:21 PM

Quote:

Originally Posted by SUBARU
I still have 20gigs more free space.
When I use LVM , cannot get more partition.
PartMan think I have enough already.
((damn LVM))
sorry.......

I have no idea what you just said. :confused:

james.reid 05-31-2006 12:02 AM

Thanks for all of your replies!

To expand a little further....

I currently have:

/dev/hda --> mounted as root
/dev/hdc --> mounted as /data
/dev/hdd --> new disk

The /dev/hdc disk is full

The directory /data/mail has a lot of stuff in it.

If I simply mount /dev/hdd as /data/mail will this work?

What would happen to the data that is in /data/mail that is on /dev/hdc? Would it simply in effect extend the existing folder onto /dev/hdd?

Or...

Can I have both disks mounted as /data

I'm looking at all of this as a short term fix - I hope to set up a new larger server in the next few weeks.

Thanks!

James.

syg00 05-31-2006 12:44 AM

Quote:

Originally Posted by james.reid
The directory /data/mail has a lot of stuff in it.

If I simply mount /dev/hdd as /data/mail will this work?

Yes. Won't do what you want though.
Quote:

What would happen to the data that is in /data/mail that is on /dev/hdc? Would it simply in effect extend the existing folder onto /dev/hdd?

Or...

Can I have both disks mounted as /data
No - and no.
You will lose access to the data on hdc.

You will need to copy the data from hdc to hdd, then mount that at /data/mail.
Once satisfied, you can reclaim the space on hdc.

imagineers7 05-31-2006 05:47 AM

Hello james,


Quote:

Originally Posted by James
Can I have both disks mounted as /data

Yes, you can . Have a look at unionfs.

Home page is at unionfs.org

Hope, this will help you

syg00 05-31-2006 06:11 AM

Mmmmm - looks like a nice idea.
Might have to try that one - thanks.

haertig 06-02-2006 12:48 AM

Yes, unionfs is nice. I use it frequently to "modify" iso's before burning them.

Your existing /data/mail directory on hdc could be renamed to /data/.mail_orig. You could then create a new directory on hdd named /data2/.mail_new. Create a union of .mail_orig (readonly) and .mail_new (readwrite), and mount the union on hdc:/data/mail. You then do all your access through this new /data/mail unionfs directory, which looks just like your original directory, except with more space. If you try to modify a file that already exists on .mail_orig (readonly), it is auto-magically moved over to .mail_new for you. If you delete an existing file from .mail_orig, it is not really deleted (readonly), rather it is "whited-out" over on .mail_new so it appears deleted when viewed through the /data/mail unionfs directory. Really slick.

You never touch .mail_orig or .mail_new directly (you can, but probably don't want to for this scenerio). That's why I showed naming them with a leading dot to make them hidden directories.


All times are GMT -5. The time now is 01:14 AM.