>On Mon, 4 Jun 2012 09:53:21 +0800 majianpeng <majianpeng@xxxxxxxxx> wrote: > >> Hi: >> At present, md is supporting replacement. >> In function: state_store() >> > } else if (cmd_match(buf, "replacement")) { >> > /* Can only set a device as a replacement when array has not >> > * yet been started. Once running, replacement is automatic >> > * from spares, or by assigning 'slot'. >> > */ >> I can using spare disk.But how to use slot? > >If you want to ensure that a particular device becomes a replacement for a >particular other device, then > cd /sys/block/mdX/md > echo frozen > sync_action > echo NN:MM > new_dev # where NN is major and MM is minor of new device If the array had a persistent superblock, the operation returned error. The message like: [ 262.934070] md: sde does not have a valid v1.2 superblock, not importing! How can do it ? > echo want_replacement > rdSS/state # where SS is slot number of device to > # replace > echo SS > dev-YYY/slot # where YYY is the kernel name of the newly added > # device > echo idle > sync_action > >should do it, but I haven't tested recently. > >NeilBrown -------------- majianpeng?韬{.n?????%??檩??w?{.n???{炳盯w???塄}?财??j:+v??????2??璀??摺?囤??z夸z罐?+?????w棹f