FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-21-2009, 05:05 PM
Jarry
 
Default extending /usr partition...

Hi,

I found out my /usr is getting full pretty fast, so I want
to increase it before it happens a real problem. I have:

/dev/md4 (sda5+sdb5), ~5GB size, used for /var, nearly empty
/dev/md5 (sda6+sdb6), ~5GB size, used for /usr, nearly full (90%)
And I have /backup on separate partition (hda1), big enough

What I think of is this procedure: First I copy /var and /usr:
cp -a /var /backup
cp -a /usr /backup

Then I intend to reboot with install-cd, repartition sda/sdb
(make sda5/sdb5 smaller and sda6/sdb6 bigger), create new
/dev/md4 and /dev/md5, mount them, and copy the content back.

cp -a /mnt/gentoo/backup/var /mnt/gentoo/var
cp -a /mnt/gentoo/backup/usr /mnt/gentoo/usr

Is it a correct procedure? All partitions are ext3 type, no lvm2,
moreover on /dev/md so I can not extend/shrink them while using...

Jarry

--
__________________________________________________ _____________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
 
Old 03-21-2009, 05:12 PM
Alan McKinnon
 
Default extending /usr partition...

On Saturday 21 March 2009 20:05:42 Jarry wrote:
> Hi,
>
> I found out my /usr is getting full pretty fast, so I want
> to increase it before it happens a real problem. I have:
>
> /dev/md4 (sda5+sdb5), ~5GB size, used for /var, nearly empty
> /dev/md5 (sda6+sdb6), ~5GB size, used for /usr, nearly full (90%)
> And I have /backup on separate partition (hda1), big enough
>
> What I think of is this procedure: First I copy /var and /usr:
> cp -a /var /backup
> cp -a /usr /backup

Yes

> Then I intend to reboot with install-cd, repartition sda/sdb
> (make sda5/sdb5 smaller and sda6/sdb6 bigger), create new
> /dev/md4 and /dev/md5, mount them, and copy the content back.

Yes

> cp -a /mnt/gentoo/backup/var /mnt/gentoo/var
> cp -a /mnt/gentoo/backup/usr /mnt/gentoo/usr

Um, no. This gives you new usr and var directories like so:

/usr/usr/
/var/var

You want:

cp -a /mnt/gentoo/backup/var /mnt/gentoo/
cp -a /mnt/gentoo/backup/usr /mnt/gentoo/

> Is it a correct procedure? All partitions are ext3 type, no lvm2,
> moreover on /dev/md so I can not extend/shrink them while using...

It's correct, and it also highlights just what a PITA it is to manipulate
traditional disk partitions. With lvm, this becomes a breeze. With ZFS (we
might see it one day) this becomes invisible.


--
alan dot mckinnon at gmail dot com
 
Old 03-21-2009, 05:16 PM
Dirk Heinrichs
 
Default extending /usr partition...

Am Samstag, 21. März 2009 19:05:42 schrieb Jarry:

> I found out my /usr is getting full pretty fast, so I want
> to increase it before it happens a real problem. I have:
>
> /dev/md4 (sda5+sdb5), ~5GB size, used for /var, nearly empty
> /dev/md5 (sda6+sdb6), ~5GB size, used for /usr, nearly full (90%)
> And I have /backup on separate partition (hda1), big enough
>
> What I think of is this procedure: First I copy /var and /usr:
> cp -a /var /backup
> cp -a /usr /backup

Yes.

> Then I intend to reboot with install-cd, repartition sda/sdb
> (make sda5/sdb5 smaller and sda6/sdb6 bigger), create new
> /dev/md4 and /dev/md5, mount them, and copy the content back.

No. Do it right this time and create only one md device and use lvm on top of
it to avoid such problems in the future.

BTW: Speaking of md4 and md5, is there also md[123]? If yes, you should think
about adding their space to that large md device, too.

> cp -a /mnt/gentoo/backup/var /mnt/gentoo/var
> cp -a /mnt/gentoo/backup/usr /mnt/gentoo/usr

Yes.

> Is it a correct procedure? All partitions are ext3 type, no lvm2,
> moreover on /dev/md so I can not extend/shrink them while using...

And that's the reason why it's not the correct procedure.

HTH...

Dirk
 
Old 03-21-2009, 05:20 PM
Dirk Heinrichs
 
Default extending /usr partition...

Am Samstag, 21. März 2009 19:12:56 schrieb Alan McKinnon:

> > cp -a /mnt/gentoo/backup/var /mnt/gentoo/var
> > cp -a /mnt/gentoo/backup/usr /mnt/gentoo/usr
>
> Um, no. This gives you new usr and var directories like so:
>
> /usr/usr/
> /var/var
>
> You want:
>
> cp -a /mnt/gentoo/backup/var /mnt/gentoo/
> cp -a /mnt/gentoo/backup/usr /mnt/gentoo/

Oh, you're right on that, I just wrote "Yes" ;-)

> > Is it a correct procedure? All partitions are ext3 type, no lvm2,
> > moreover on /dev/md so I can not extend/shrink them while using...
>
> It's correct, and it also highlights just what a PITA it is to manipulate
> traditional disk partitions. With lvm, this becomes a breeze. With ZFS (we
> might see it one day) this becomes invisible.

btrfs will be there in .29 (maybe not stable yet, but it looks promising).

Bye...

Dirk
 
Old 03-21-2009, 05:39 PM
Jarry
 
Default extending /usr partition...

Alan McKinnon wrote:

cp -a /mnt/gentoo/backup/var /mnt/gentoo/var
cp -a /mnt/gentoo/backup/usr /mnt/gentoo/usr


Um, no. This gives you new usr and var directories like so:
/usr/usr/
/var/var

You want:
cp -a /mnt/gentoo/backup/var /mnt/gentoo/
cp -a /mnt/gentoo/backup/usr /mnt/gentoo/


Thanks for correction!

With lvm, this becomes a breeze.


I remember having lvm2 a few years ago, and despite of that I could not
extend any partition, which was being used. What is then lvm2 good for,
if I can not extend partitions on-the-fly? I can not unmount /usr before
extending...

And one more counter-argument: with traditional partitions I can select
where a certain partition is (physically). Those partitions accessed
frequently I put to the beginning of the disk with higher transfer-rate.
In my case, it makes quite difference:

obelix ~ # hdparm -t /dev/md2
Timing buffered disk reads: 252 MB in 3.02 seconds = 83.23 MB/sec

obelix ~ # hdparm -t /dev/md9
Timing buffered disk reads: 150 MB in 3.02 seconds = 49.72 MB/sec

Jarry

--
__________________________________________________ _____________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
 
Old 03-21-2009, 05:53 PM
Alan McKinnon
 
Default extending /usr partition...

On Saturday 21 March 2009 20:39:08 Jarry wrote:
> Alan McKinnon wrote:
> >> cp -a /mnt/gentoo/backup/var /mnt/gentoo/var
> >> cp -a /mnt/gentoo/backup/usr /mnt/gentoo/usr
> >
> > Um, no. This gives you new usr and var directories like so:
> > /usr/usr/
> > /var/var
> >
> > You want:
> > cp -a /mnt/gentoo/backup/var /mnt/gentoo/
> > cp -a /mnt/gentoo/backup/usr /mnt/gentoo/
>
> Thanks for correction!
>
> > With lvm, this becomes a breeze.
>
> I remember having lvm2 a few years ago, and despite of that I could not
> extend any partition, which was being used. What is then lvm2 good for,
> if I can not extend partitions on-the-fly? I can not unmount /usr before
> extending...

That is not lvm's fault, it is the fault of the OS.

/usr is not a filesystem that changes much anyway. If you look at a few
similar machines, you can guess quite accurately what it's size is going to
be.

/var, database directories, home directories - these are the things you can
change on the fly. These are also the things that you do want to change on the
fly.

> And one more counter-argument: with traditional partitions I can select
> where a certain partition is (physically). Those partitions accessed
> frequently I put to the beginning of the disk with higher transfer-rate.
> In my case, it makes quite difference:
>
> obelix ~ # hdparm -t /dev/md2
> Timing buffered disk reads: 252 MB in 3.02 seconds = 83.23 MB/sec
>
> obelix ~ # hdparm -t /dev/md9
> Timing buffered disk reads: 150 MB in 3.02 seconds = 49.72 MB/sec

You have no guarantee whatsoever that the data resides on the part of the disk
you think it resides on, so this entire argument becomes moot. Today, by happy
coincidence, it is. Tomorrow with another drive it might not be. You also have
to deal with the effect of disk caching. And you didn't do the only real test
the remotely means anything at all - random writes. Throughout measurements
are meaningless as the thing you measure hardly ever happens in real life.
It's a lot like determining the suitability of a future wife by measuring her
foot size: a perfectly correct measure, and also a perfectly useless one.

It's this kind of thinking that keeps people trapped in circumstance and
unable to take advantage of new ideas. In the IT industry, it is rife.

--
alan dot mckinnon at gmail dot com
 
Old 03-21-2009, 06:37 PM
Daniel Troeder
 
Default extending /usr partition...

On Sat, 2009-03-21 at 19:39 +0100, Jarry wrote:
> I remember having lvm2 a few years ago, and despite of that I could not
> extend any partition, which was being used. What is then lvm2 good for,
> if I can not extend partitions on-the-fly? I can not unmount /usr before
> extending...
This is filesystem (and OS) dependent. I use XFS for all my partitions,
because one of the nice thing about it is, that it can grow filesystems
when they are mounted. I think this is possible with ext3 too, but I did
not test it.
Even under heavy load it is a matter of seconds to grow a XFS FS in a
LVM.

> And one more counter-argument: with traditional partitions I can select
> where a certain partition is (physically). Those partitions accessed
> frequently I put to the beginning of the disk with higher transfer-rate.
> In my case, it makes quite difference:
In my experience more (human and up-) time is lost in
backup-reboot-repartition-format-restore-reboot than in some iowait.

Bye,
Daniel

--
PGP key @ http://pgpkeys.pca.dfn.de/pks/lookup?search=0xBB9D4887&op=get
# gpg --recv-keys --keyserver hkp://subkeys.pgp.net 0xBB9D4887
 
Old 03-21-2009, 07:57 PM
Neil Bothwick
 
Default extending /usr partition...

On Sat, 21 Mar 2009 19:39:08 +0100, Jarry wrote:

> I remember having lvm2 a few years ago, and despite of that I could not
> extend any partition, which was being used. What is then lvm2 good for,
> if I can not extend partitions on-the-fly? I can not unmount /usr before
> extending...

You can extend partitions on the fly with LVM2, and have always been able
to, provided you have free space in its volume group. Was it the partition
you had trouble resizing or the filesystem? That's a separate step and is
dependent on the tools available for the particular filesystem on use. It
is certainly possible to extend a mounted ext3 filesystem now, but that
may not have always been the case.


--
Neil Bothwick

Can vegetarians eat animal crackers?
 
Old 03-21-2009, 08:13 PM
BRM
 
Default extending /usr partition...

With all the words of LVM2 going on, I feel it is only appropriate to also mention the risk.

On a desktop I had installed LVM2 considering that I did need to upgrade partitions every now and then and my previous solution was add another drive/partition and cross mount - e.g. like done with /usr/local under /usr, which worked fairly well. LVM2 worked great - until one of the drives crashed and I was trying to figure out what was on it. From that pov, volume management is a pain. I did figure out what I had mounted to it - but only after deconstructing the LVM configuration file to match it up with what I had put there. (And no, I had not yet gotten to doing an LVM soft-RAID solution to map a single LVM partition to two drives, which would certainly have helped.) I got my system working by adding a new drive that was not part of the volume group, and removing the old drives from the volume group. Fortunately, I had my volume setup so that they one partition was not made up of non-overlaping partitions on different drives. (e.g. partition A =
sda1 + sda2 instead of sda1 + sdb1.)

So, unless you are looking to use LVM in a soft-RAID solution between multiple physical drives, not multiple partitions on the same drive, (e.g. partition A = sda1 + sda2, with mirror on sdb1+sdb2), then I would not suggest it as should anything happen, it'll make data recovery that much harder.

Just 2 cents for the pot.

Ben



----- Original Message ----
From: Neil Bothwick <neil@digimed.co.uk>
To: gentoo-user@lists.gentoo.org
Sent: Saturday, March 21, 2009 4:57:55 PM
Subject: Re: [gentoo-user] extending /usr partition...

On Sat, 21 Mar 2009 19:39:08 +0100, Jarry wrote:

> I remember having lvm2 a few years ago, and despite of that I could not
> extend any partition, which was being used. What is then lvm2 good for,
> if I can not extend partitions on-the-fly? I can not unmount /usr before
> extending...

You can extend partitions on the fly with LVM2, and have always been able
to, provided you have free space in its volume group. Was it the partition
you had trouble resizing or the filesystem? That's a separate step and is
dependent on the tools available for the particular filesystem on use. It
is certainly possible to extend a mounted ext3 filesystem now, but that
may not have always been the case.


--
Neil Bothwick

Can vegetarians eat animal crackers?
 
Old 03-21-2009, 10:39 PM
Neil Bothwick
 
Default extending /usr partition...

On Sat, 21 Mar 2009 14:13:49 -0700 (PDT), BRM wrote:

> So, unless you are looking to use LVM in a soft-RAID solution between
> multiple physical drives, not multiple partitions on the same drive,
> (e.g. partition A = sda1 + sda2, with mirror on sdb1+sdb2), then I
> would not suggest it as should anything happen, it'll make data
> recovery that much harder.

If your data was valuable enough for you to spend that much time
recovering it, it was valuable enough to backup in the first place.

Having said that, RAID does provide added security against mechanical
failure.


--
Neil Bothwick

Biology is the only science in which multiplication means the same thing
as division.
 

Thread Tools




All times are GMT. The time now is 07:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org