Hi Hugo,

Thank you very much for the information.


Regards
  Bjoern


-----Original Message-----
From: Hugo Mills [mailto:h...@carfax.org.uk] 
Sent: Thursday, May 24, 2012 10:41 AM
To: Björn Wüst
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Preparing single-disk setup for future multi-disk usage

On Thu, May 24, 2012 at 08:05:23AM +0200, Björn Wüst wrote:
> Good morning,
> 
> 
> I currently have a single-disk setup where I want to use btrfs filesystem.
Yet, I expect to add additional disks to this system in the future. Those
disks shall be visible to the OS like a single disk, i.e. using multi-disk
feature in btrfs. While data shall be striped among those disks in the
future, meta data shall be mirrored for better fault tolerance (loss of some
data is acceptable, while loss of all data is not acceptable).
> 
> btrfs supports multi-disk setups and even adding additional devices at a
later point of time. Thus, it is my preferred choice. However, I am puzzled
how the mkfs.btrfs command must be parametrized to have RAID1 for meta data
and RAID0 for data with just a single disk / partition. Could I simply do
mkfs.btrfs -m raid1 -d raid0 /dev/sdaX (where X is the partition number) ?

   No, this will fail to work, as RAID-1 and -0 both require at least two
disks. What you need to do is use the default settings (mkfs.btrfs
/dev/sdaX) for now, which will give you DUP metadata (two copies of each
block, in different places on the disk), and "single" data (one copy of the
data).

   When you add a new disk, you can convert the replication to something
else, using the balance command:

# btrfs dev add /dev/sdY /mountpoint
# btrfs balance start -dconvert=raid0 /mountpoint

(Note that you don't need to specify -m raid1 to convert the metadata, as
the DUP->RAID-1 conversion is implicit where it's possible).

> Unfortunately, I do not have a disk to test it right now. The disk I am
planning to use is with the post service still :) . Searching the Web could
not reveal a similar scenario. All multi-disk examples assume that you
already have multiple disks and not that you are going to have them.

   The conversion code is quite new, so there's few examples out there right
now.

   Hugo.

--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
  --- There are three things you should never see being made: laws, ---  
                        standards,  and sausages.                        

--
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

Reply via email to