Re: Resize command syntax wrong?

2011-12-01 Thread Phillip Susi

On 12/1/2011 1:46 AM, Helmut Hullen wrote:

balance != resize


I know.

p.e.
Start with 1 disk with 2 GB and 1 disk with 4 GByte
Fill it with 2 Gbyte data, each disk gets 1 GByte.

Add a disk with 10 GByte, run balance: each disk gets about 700 MByte.

That has nothing to do with resize.


Right, so why are you talking about balance when this thread is about resize?

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Resize command syntax wrong?

2011-12-01 Thread Helmut Hullen
Hallo, Phillip,

Du meintest am 01.12.11:

 balance != resize

[...]

 That has nothing to do with resize.

 Right, so why are you talking about balance when this thread is about
 resize?

Ooops - sorry!

Viele Gruesse!
Helmut
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Resize command syntax wrong?

2011-11-30 Thread Phillip Susi

Currently the resize command is under filesystem, and takes a path to the 
mounted filesystem.  This seems wrong to me.  Shouldn't it be under device, and 
take a path to a device to resize?  Otherwise, how can a resize operation when 
you have multiple devices make any sense?
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Resize command syntax wrong?

2011-11-30 Thread Helmut Hullen
Hallo, Phillip,

Du meintest am 30.11.11:

 Currently the resize command is under filesystem, and takes a path to
 the mounted filesystem.  This seems wrong to me.  Shouldn't it be
 under device, and take a path to a device to resize?

No - it's a filesystem operation.

p.e.
You start with a system of 2 disks. They get filled nearly  
simultaneously.
Then you add a 3rd disk (which is empty at that time). Now it's a good  
idea to run balance for equalizing the filling.


Viele Gruesse!
Helmut
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Resize command syntax wrong?

2011-11-30 Thread Roman Mamedov
On 30 Nov 2011 19:59:00 +0100
Helmut Hullen hul...@t-online.de wrote:

  Currently the resize command is under filesystem, and takes a path to
  the mounted filesystem.  This seems wrong to me.  Shouldn't it be
  under device, and take a path to a device to resize?
 
 No - it's a filesystem operation.

Are you sure about that?

 
 p.e.
 You start with a system of 2 disks. They get filled nearly  
 simultaneously.
 Then you add a 3rd disk (which is empty at that time). Now it's a good  
 idea to run balance for equalizing the filling.

What if I need to replace an individual device with a smaller or a larger one?


-- 
With respect,
Roman

~~~
Stallman had a printer,
with code he could not see.
So he began to tinker,
and set the software free.


signature.asc
Description: PGP signature


Re: Resize command syntax wrong?

2011-11-30 Thread Goffredo Baroncelli
On Thursday, 01 December, 2011 01:15:47 you wrote:
 On 30 Nov 2011 19:59:00 +0100
 
 Helmut Hullen hul...@t-online.de wrote:
   Currently the resize command is under filesystem, and takes a path
   to
   the mounted filesystem.  This seems wrong to me.  Shouldn't it be
   under device, and take a path to a device to resize?
  
  No - it's a filesystem operation.
 
 Are you sure about that?

I confirm that. In fact btrfs filesystem resize doesn't change the device(s). 
It only expands or shrinks the filesystem.
Of course if you want to expand the filesystem, you have to expand the 
underling device *before*. Otherwise if you want to shrink the filesystem, you 
have to not shrink the device before shrinking the filesystem.

 
  p.e.
  You start with a system of 2 disks. They get filled nearly
  simultaneously.
  Then you add a 3rd disk (which is empty at that time). Now it's a good
  idea to run balance for equalizing the filling.
 
 What if I need to replace an individual device with a smaller or a larger
 one?

This is a more simpler case

As general rule:
# btrfs device add new device btrfs root
# btrfs device delete old device btrfs root

May be that the device removing is blocked in some RAID setup.




-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) kreij...@inwind.it
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Resize command syntax wrong?

2011-11-30 Thread Helmut Hullen
Hallo, Roman,

Du meintest am 01.12.11:

 What if I need to replace an individual device with a smaller or a
 larger one?

1) add the new device
2) balance (may be it's not necessary)
3) run remove for the individual device
4) remove it
5) balance

Viele Gruesse!
Helmut
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Resize command syntax wrong?

2011-11-30 Thread Roman Mamedov
On 30 Nov 2011 20:43:00 +0100
Helmut Hullen hul...@t-online.de wrote:

 Hallo, Roman,
 
 Du meintest am 01.12.11:
 
  What if I need to replace an individual device with a smaller or a
  larger one?
 
 1) add the new device
 2) balance (may be it's not necessary)
 3) run remove for the individual device
 4) remove it
 5) balance

Okay, adding a new device wasn't the best example to explain my point.

What I meant is resizing a BTRFS partition, enlarging it or shrinking it as 
needed, while still on the same device.

Of course in the enlarge scenario the partition(or the LV) is resized upwards 
first, and then the filesystem, and on shrinking it's vice versa. Suppose I 
used half of a 1000GB disk for BTRFS (a 500GB partition), and the second half 
for something else. Now I want to remove this other partition, and make BTRFS 
occupy the whole disk.

Resizing in both 'directions' seems to work very well on single-device BTRFS 
filesystems, and also it's very useful that BTRFS is almost the only modern FS 
(besides ext4) that can be shrinked. But with multi-device filesystems, don't 
you agree it's non-obvious how (or is not even possible) to resize the areas 
that BTRFS occupies on individual devices?

-- 
With respect,
Roman

~~~
Stallman had a printer,
with code he could not see.
So he began to tinker,
and set the software free.


signature.asc
Description: PGP signature


Re: Resize command syntax wrong?

2011-11-30 Thread Helmut Hullen
Hallo, Phillip,

Du meintest am 30.11.11:

 You start with a system of 2 disks. They get filled nearly
 simultaneously.
 Then you add a 3rd disk (which is empty at that time). Now it's a
 good idea to run balance for equalizing the filling.

 balance != resize

I know.

p.e.
Start with 1 disk with 2 GB and 1 disk with 4 GByte
Fill it with 2 Gbyte data, each disk gets 1 GByte.

Add a disk with 10 GByte, run balance: each disk gets about 700 MByte.

That has nothing to do with resize.

Viele Gruesse!
Helmut
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html