On 24.06.09 17:10, Thomas Maier-Komor wrote:
Ben schrieb:
Thomas,
Could you post an example of what you mean (ie commands in the order to use 
them)?  I've not played with ZFS that much and I don't want to muck my system 
up (I have data backed up, but am more concerned about getting myself in a mess 
and having to reinstall, thus losing my configurations).

Many thanks for both of your replies,
Ben

I'm not an expert on this, and I haven't tried it, so beware:


1) If the pool you want to expand is not the root pool:

$ zpool export mypool
# now replace one of the disks with a new disk
$ zpool import mypool
# zpool status will show that mypool is in degraded state because of a
missing disk
$ zpool replace mypool replaceddisk
# now the pool will start resilvering

# Once it is done with resilvering:
$ zpool detach mypool <otherdisk>
#  now physically replace <otherdisk>
$ zpool replace mypool <otherdisk>

Last command would fail as there would be no longer <otherdisk> in mypool.

Though you can always play with files first (or with VirtualBox etc):

# preparation

mkdir -p /var/tmp/disks/removed
mkfile -n 64m /var/tmp/disks/disk0
mkfile -n 64m /var/tmp/disks/disk1
mkfile -n 128m /var/tmp/disks/bigdisk0
mkfile -n 128m /var/tmp/disks/bigdisk1
zpool create test mirror /var/tmp/disks/disk0 /var/tmp/disks/disk1
zpool list test

# let's start by making sure there's no latent errors:

zpool scrub test
while zpool status -v test | grep % ; do sleep 1; done
zpool status -v test

zpool export test
mv /var/tmp/disks/disk0 /var/tmp/disks/removed/disk0

# you don't need '-d /path' with real disks
zpool import -d /var/tmp/disks test
zpool status -v test

# insert new disk
mv /var/tmp/disks/bigdisk0 /var/tmp/disks/disk0
zpool replace test /var/tmp/disks/disk0

while zpool status -v test | grep % ; do sleep 1; done
zpool status -v test

# make sure that resilvering is complete
zpool detach test /var/tmp/disks/disk1
mv /var/tmp/disks/disk1 /var/tmp/disks/removed/disk1

# insert new disk
mv /var/tmp/disks/bigdisk1 /var/tmp/disks/disk1
zpool attach test /var/tmp/disks/disk0 /var/tmp/disks/disk1
while zpool status -v test | grep % ; do sleep 1; done
zpool status -v test
zpool list test


hth,
victor
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to