本文共 5761 字,大约阅读时间需要 19 分钟。
# fdisk -c -u /dev/sda
# zpool status pool: zp1 state: ONLINE scan: none requestedconfig: NAME STATE READ WRITE CKSUM zp1 ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2c8a06200099 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2c92069983cb ONLINE 0 0 0 mirror-1 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2c9a0712503c ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2ca2078b4231 ONLINE 0 0 0 mirror-2 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2ca907f2b840 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2cb0085a22e6 ONLINE 0 0 0 mirror-3 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2cba08f37c32 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d340486b1c4 ONLINE 0 0 0 mirror-4 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d3b04e93404 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d42054f21b8 ONLINE 0 0 0 mirror-5 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d4905bed3f3 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d4f061c3f88 ONLINE 0 0 0 logs wwn-0x6b083fe0d17216001c1b2c7f056bd76c-part3 ONLINE 0 0 0 cache wwn-0x5e83a977e08cba3e-part1 ONLINE 0 0 0删除cache设备
# zpool remove zp1 wwn-0x5e83a977e08cba3e-part1重新对ssd分区 :
# fdisk -c -u /dev/sdaDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0xb641c765.Changes will remain in memory only, until you decide to write them.After that, of course, the previous content won't be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)Command (m for help): dSelected partition 1Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1First sector (2048-937766396, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-937766396, default 937766396): +461373439重新分完, 添加回去报错
# zpool add zp1 cache /dev/disk/by-id/wwn-0x5e83a977e08cba3e-part1cannot open '/dev/disk/by-id/wwn-0x5e83a977e08cba3e-part1': Device or resource busycannot add to 'zp1': one or more vdevs refer to the same devicedd 这个设备亦无变化, 一开始我以为是头信息的问题 :
# dd if=/dev/zero of=/dev/disk/by-id/wwn-0x5e83a977e08cba3e-part1 bs=1k count=1024# zpool add zp1 cache /dev/disk/by-id/wwn-0x5e83a977e08cba3e-part1cannot open '/dev/disk/by-id/wwn-0x5e83a977e08cba3e-part1': Device or resource busycannot add to 'zp1': one or more vdevs refer to the same device真实原因是这个设备被device mapper占用了.
# dmsetup lssda1 (253:0)删除这个dm设备 :
# dmsetup remove /dev/disk/by-id/dm-name-sda1ata-OCZ-REVODRIVE3_X2_OCZ-9XJBU029CT3M3U56 scsi-SATA_OCZ-REVODRIVE3_OCZ-9XJBU029CT3M3U56ata-OCZ-REVODRIVE3_X2_OCZ-9XJBU029CT3M3U56-part1 scsi-SATA_OCZ-REVODRIVE3_OCZ-9XJBU029CT3M3U56-part1dm-name-sda1 wwn-0x5e83a977e08cba3edm-uuid-part1-sda现在添加cache成功了, 省去了重启的烦恼.
# zpool add zp1 cache /dev/disk/by-id/wwn-0x5e83a977e08cba3e-part1# zpool status pool: zp1 state: ONLINE scan: none requestedconfig: NAME STATE READ WRITE CKSUM zp1 ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2c8a06200099 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2c92069983cb ONLINE 0 0 0 mirror-1 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2c9a0712503c ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2ca2078b4231 ONLINE 0 0 0 mirror-2 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2ca907f2b840 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2cb0085a22e6 ONLINE 0 0 0 mirror-3 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2cba08f37c32 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d340486b1c4 ONLINE 0 0 0 mirror-4 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d3b04e93404 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d42054f21b8 ONLINE 0 0 0 mirror-5 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d4905bed3f3 ONLINE 0 0 0 wwn-0x6b083fe0d17216001c1b2d4f061c3f88 ONLINE 0 0 0 logs wwn-0x6b083fe0d17216001c1b2c7f056bd76c-part3 ONLINE 0 0 0 cache wwn-0x5e83a977e08cba3e-part1 ONLINE 0 0 0
转载地址:http://xktwo.baihongyu.com/