LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-30-2006, 06:38 AM   #1
james.reid
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Rep: Reputation: 0
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.
 
Old 05-30-2006, 08:42 AM   #2
imagineers7
Member
 
Registered: Mar 2006
Distribution: BackTrack, RHEL, FC, CentOS, IPCop, Ubuntu, 64Studio, Elive, Dream Linux, Trix Box
Posts: 310

Rep: Reputation: 30
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
 
Old 05-30-2006, 08:47 AM   #3
jeelliso
Member
 
Registered: Oct 2005
Location: Knoxville, Tn (USA)
Distribution: OpenSUSE, Ubuntu
Posts: 250

Rep: Reputation: 30
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

Last edited by jeelliso; 05-30-2006 at 08:48 AM.
 
Old 05-30-2006, 08:47 AM   #4
ZoolWay
LQ Newbie
 
Registered: Aug 2003
Location: NRW, Germany
Distribution: LFS
Posts: 4

Rep: Reputation: 0
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
 
Old 05-30-2006, 08:55 AM   #5
imagineers7
Member
 
Registered: Mar 2006
Distribution: BackTrack, RHEL, FC, CentOS, IPCop, Ubuntu, 64Studio, Elive, Dream Linux, Trix Box
Posts: 310

Rep: Reputation: 30
Post

One more way:-

Mount that partition as some directory which is going to consume very heavy space
 
Old 05-30-2006, 09:00 AM   #6
SUBARU
LQ Newbie
 
Registered: May 2006
Posts: 12

Rep: Reputation: 0
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.
 
Old 05-30-2006, 10:11 AM   #7
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,004

Rep: Reputation: 304Reputation: 304Reputation: 304Reputation: 304
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!)
 
Old 05-30-2006, 10:22 AM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,004

Rep: Reputation: 304Reputation: 304Reputation: 304Reputation: 304
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.
 
Old 05-30-2006, 12:04 PM   #9
SUBARU
LQ Newbie
 
Registered: May 2006
Posts: 12

Rep: Reputation: 0
I still have 20gigs more free space.
When I use LVM , cannot get more partition.
PartMan think I have enough already.
((damn LVM))
sorry.......
 
Old 05-30-2006, 12:21 PM   #10
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,004

Rep: Reputation: 304Reputation: 304Reputation: 304Reputation: 304
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.
 
Old 05-31-2006, 12:02 AM   #11
james.reid
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 05-31-2006, 12:44 AM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,271

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
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.
 
Old 05-31-2006, 05:47 AM   #13
imagineers7
Member
 
Registered: Mar 2006
Distribution: BackTrack, RHEL, FC, CentOS, IPCop, Ubuntu, 64Studio, Elive, Dream Linux, Trix Box
Posts: 310

Rep: Reputation: 30
Arrow

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

Last edited by imagineers7; 05-31-2006 at 05:49 AM.
 
Old 05-31-2006, 06:11 AM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,271

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
Mmmmm - looks like a nice idea.
Might have to try that one - thanks.
 
Old 06-02-2006, 12:48 AM   #15
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,004

Rep: Reputation: 304Reputation: 304Reputation: 304Reputation: 304
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.
 
  


Reply


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
Extend LVM partition rconan Linux - Software 5 08-31-2010 02:32 AM
How do I extend an ext3 partition? chrislev Linux - Hardware 2 01-27-2006 10:35 AM
RAID/LVM setup with existing drives juu801 Linux - General 3 07-06-2005 12:35 AM
Resize existing and add another partition with LVM donv2 Linux - Newbie 3 04-27-2005 04:23 AM
existing LVM partition won't mount anymore dehuszar Linux - Software 1 09-10-2004 01:26 PM


All times are GMT -5. The time now is 07:08 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration