linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: Carl Cook <CACook@quantum-sci.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Adding a disk fails
Date: Thu, 20 Jan 2011 23:13:22 +0100	[thread overview]
Message-ID: <4D38B382.1050709@libero.it> (raw)
In-Reply-To: <201101201318.40686.CACook@quantum-sci.com>

On 01/20/2011 10:18 PM, Carl Cook wrote:
> 
> Well I've just tried to add a disk to another, but it fails.  I
> created the first (starting with no traditional partitions) with: #
> mkfs.btrfs /dev/sdb
> 
> Then I mounted it to /media/backups and put lots of files on it.  I
> shut down the system, added another disk.  Set it up with: #
> mkfs.btrfs /dev/sdc WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL 
> WARNING! - see http://btrfs.wiki.kernel.org before using fs created
> label (null) on /dev/sdc nodesize 4096 leafsize 4096 sectorsize 4096
> size 1.82TB Btrfs Btrfs v0.19 # btrfs device scan Scanning for Btrfs
> filesystems # (... Nothing?  Not even my known mounted sdb drive?) #
> btrfs device add /dev/sdc /media/backups ERROR: error adding the
> device '/dev/sdc'
> 
> It gives no clue as to what might possibly be the problem.  I want
> raid0.

To add another disk you don't have to run mkfs.btrfs. For example:

# add the first disk
mkfs.btrfs /dev/sdb
# mount the disk
mount /dev/sdb /media/backups

# add another disk to the first one
btrfs device add /dev/sdc /media/backup

Note1: the filesystem has to be mounted
Note2: the medatada will be in raid1, the data in raid0
If you shutdown the system, at the reboot you should "scan" all the
device in order to find the btrfs ones

# find the btrfs device
btrfs device scan

# mount the filesystem
mount /dev/sdb /media/backups 		# you can use also /dev/sdc



> 
> Also I can not understand this: "Note: While subvolumes can be
> created anywhere in the filesystem tree, in order to be mounted by
> name a subvolume or snapshot must be in the root of the btrfs
> filesystem."
> 
> I want to do this, but do not know what this means.  


Suppose to have a btrfs filesystem in /dev/sdb

mount /dev/sdb /media/backup

mkidr /media/backup/dir-1
<create a lot of file under /media/backup>

# make a snapshot
btrfs filesystem snapshot /media/backup /media/backup/snapshot-2

# make another snapshot
btrfs filesystem snapshot /media/backup /media/backup/dir-1/snapshot-3

# umount the filesystem
umount /media/backup

# mount snapshot-2 directly
mount -o subvol=snapshot-2 /dev/sdb /media/backup

# if you try to mount snapshot-3 directly, you fail because this
# snapshot is not under the root of the btrfs filesystem
mount -o subvol=dir-1/snapshot-3 /dev/sdb /media/backup	 # -> error

If you look at the output of the command "btrfs subvolume list <path>"
you can find the id of every subvolume. It is possible to use this ID to
mount directly a subvolume. This permits to mount a "non-root" subvolume.


> Tentatively I've
> created a BTRFS volume and mounted it on /media/backups.  I then
> created subvolumes as backup-hex, backup-droog, snaps-hex and
> snaps-droog.  When I created a snapshot it created a subdir under
> snaps-hex called hex-root.
> 
> It won't allow me to remove snapshots. (Debian Testing)

Which kenel version debian testing uses ?


> Also does anyone know how to create a shapshot with the current date
> in the name?

btrfs filesystem snapshot / /snapshot-$(date +"%Y-%m-%d")

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


  reply	other threads:[~2011-01-20 22:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 21:18 Adding a disk fails Carl Cook
2011-01-20 22:13 ` Goffredo Baroncelli [this message]
2011-01-20 23:10   ` Carl Cook
2011-01-21  6:55     ` Hubert Kario
2011-01-21 10:16       ` CACook
2011-01-21 10:41         ` Hubert Kario
2011-01-21  7:00     ` Helmut Hullen
2011-01-21  8:00       ` Fajar A. Nugraha
2011-01-21 18:42     ` Goffredo Baroncelli
2011-01-21 19:16       ` CACook
2011-01-21  6:57   ` Helmut Hullen
2011-01-21 10:51   ` Helmut Hullen
2011-01-21 13:23   ` Helmut Hullen
2011-01-20 22:31 ` Carl Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D38B382.1050709@libero.it \
    --to=kreijack@libero.it \
    --cc=CACook@quantum-sci.com \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).