V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kevin123456
V2EX  ›  程序员

ceph 查询可用磁盘是报错说 Has a FileSystem(已存在文件系统)AVAILABLE 显示为 NO

  •  
  •   kevin123456 · 41 天前 · 650 次点击
    这是一个创建于 41 天前的主题,其中的信息可能已经有所发展或是发生改变。

    新机器新装的系统,部署 ceph 集群后查询可用磁盘是报错说 Has a FileSystem (已存在文件系统) AVAILABLE 显示为 NO 所做的操作: 查询磁盘是没有分区的 fdisk -l /dev/sdb 格式化了硬盘 mkfs.xfs /dev/sdb -f

    有没有大佬遇到过类似情况,求救~

    10 条回复    2024-03-19 10:00:28 +08:00
    flyqie
        1
    flyqie  
       41 天前 via Android
    mkfs.xfs

    你这不就是自己创建了 xfs 吗。。
    ss098
        2
    ss098  
       41 天前
    mkfs.xfs 你这就是给磁盘格式化文件系统啊?你应该把系统 wipe 掉

    https://wiki.archlinux.org/title/Securely_wipe_disk
    ss098
        3
    ss098  
       41 天前
    讲错了,需要把磁盘 wipe 掉恢复为没有 filesystem 的原始 block 设备
    ansemz
        4
    ansemz  
       40 天前
    dd if=/dev/zero of=/dev/sdb bs=512k count=1
    busier
        5
    busier  
       40 天前 via iPhone   ❤️ 2
    @ansemz 别再用这种古老的方法了,最好
    wipefs -a -f /dev/sdb1
    wipefs -a -f /dev/sdb
    wipefs 会擦除块设备的头部和尾部两处魔术字
    busier
        6
    busier  
       40 天前 via iPhone
    如果是固态硬盘,直接来个 blkdiscard -f /dev/sdb ,直接来个全盘擦除,又快又干净,相当于全盘 Trim 还能恢复性能!
    kevin123456
        7
    kevin123456  
    OP
       40 天前
    @ansemz
    @busier 在两台 HDD 主机执行完 wipefs -a -f /dev/sdb and dd if=/dev/zero of=/dev/sdb bs=512k count=1 后然后在 ceph-mon 节点查看时还是 Has a FileSystem (已存在文件系统) AVAILABLE 显示为 NO


    @flyqie 因为第一台机器中的 SSD 硬盘我这样操作完就出现了 AVAILABLE 显示为 YES 了,然后我就在另外两台机器也执行了同样的操作,结果另外两台不起作用,只有 SSD 这台有用
    wuxqing
        8
    wuxqing  
       40 天前
    ceph-disk zap /dev/sdb
    sgdisk -Z /dev/sdb
    试试看
    kevin123456
        9
    kevin123456  
    OP
       40 天前
    可以了可以了,擦除磁盘后貌似有个缓冲时间,擦除完直接去 ceph orch device ls 查看 AVAILABLE 显示为 NO 的,等待大概五分钟后,就显示为 YES 了,感谢各位大佬
    ansemz
        10
    ansemz  
       40 天前
    @kevin123456 那就用 ceph 自己的工具把磁盘 zap 了。不知道新版 ceph 是否改名或者改用其他工具,但是肯定会有的。

    # ceph-disk zap --help
    usage: ceph-disk zap [-h] DEV [DEV ...]

    Zap/erase/destroy a device's partition table and contents. It actually
    uses sgdisk and it's option --zap-all to destroy both GPT and MBR data
    structures so that the disk becomes suitable for repartitioning.

    positional arguments:
    DEV path to block device

    optional arguments:
    -h, --help show this help message and exit
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4905 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 03:58 · PVG 11:58 · LAX 20:58 · JFK 23:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.