博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
dmsetup remove dm device solve : zpool error:one or more vdevs refer to the same device
阅读量:6447 次
发布时间:2019-06-23

本文共 5761 字,大约阅读时间需要 19 分钟。

这是一个OCZ的SSD, 一般用一半以内的容量是性能比较好, 所以480G的SSD, 我分了220G给ZFS缓存.
但是注意对其的问题.
# fdisk -c -u /dev/sda
开始位置2048
新增块数2048*1024*220-1=461373439
因为原来配置的块未对其, 所以准备重新分一下 : 
查看cache设备 :
# 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 device
dd 这个设备亦无变化, 一开始我以为是头信息的问题 : 
# 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/

你可能感兴趣的文章
Ubuntu登陆不进去(已解决)【转】
查看>>
sublime的markdown插件
查看>>
JS中给函数参数添加默认值(多看课程)
查看>>
Windows 平台安装 MongoDB
查看>>
RelativeLayout.LayoutParams
查看>>
使用SolrNet访问Solr-5.5.0
查看>>
Kafka(分布式发布-订阅消息系统)工作流程说明
查看>>
nginx upstream的五种分配方式
查看>>
net.reflector8.5.0.179过了试用期,要求输入序列号怎么办 注册机 破解
查看>>
【SSH异常】InvalidDataAccessApiUsageException异常
查看>>
013 集合
查看>>
逻辑回归原理介绍及Matlab实现
查看>>
git相关知识:如何避免某些文件无需提交
查看>>
Java中Comparable和Comparator区别小结
查看>>
派发机制、动态绑定、静态绑定
查看>>
单节点k8s的一个小例子 webapp+mysql
查看>>
基于tiny4412的Linux内核移植 -- 设备树的展开【转】
查看>>
[转]How to Send Ethereum with Web3.js and Node
查看>>
Java高级个人笔记(RandomStringUtils工具类)
查看>>
FakeUserAgentError('Maximum amount of retries reached') 彻底解决办法
查看>>