服务器上加了一块旧硬盘,打算格式化以后放点历史数据,结果用fdisk 报错:/dev/sda1 isapparently in use by the system; will not make a filesystem here!一般来说,这种情况是该盘已经被系统使用或者挂载到其他地方,使用mount 和df –lh确认,这个盘没有使用。在我之前整理过一篇类似的文章:
/dev/sdxx isapparently in use by the system; will not make a filesystem here! 解决方法 http://www.linuxidc.com/Linux/2013-04/83299.htm在这篇文章里是一个共享设备挂载到同一个2个不同的节点,但我这里是一个设备挂载到一个服务器,所以情况和我们之前的不一样。Google了一下,说是受以前盘上遗留的RAID信息的影响,系统会根据残留的信息自动发现raid,由于系统的自动识别,硬盘被虚拟地组建成了raid(即便没有真实raid存在),这就提示磁盘正在被使用,硬盘无法格式化。确认了一下:[root@web1 ~]# dmraid -sERROR: ddf1: wrong # of devices in RAID set"ddf1_4035305a8680b02520202020202020209a33c30a3a354a45" [1/2] on/dev/sda*** Group superset .ddf1_disks--> *Inconsistent*Active Subsetname : ddf1_4035305a8680b02520202020202020209a33c30a3a354a45size : 145051648stride : 128type : mirrorstatus : inconsistentsubsets: 0devs : 1spares : 0[root@web1 mapper]# dmsetup statusddf1_4035305a8680b02520202020202020209a33c30a3a354a45:0 145051651 linear释放对磁盘的使用可以使用如下方法:1) dmsetup remove_all[root@web1 mapper]# dmsetup remove_all# dmsetup remove /dev/mapper/[device][root@web1 mapper]# dmsetup statusNo devices found2) 用dmraid来disableactive状态:dmraid -a no[root@web1 conf]# dmraid -a noERROR: ddf1: wrong # of devices in RAID set"ddf1_4035305a8680b02520202020202020209a33c30a3a354a45" [1/2] on/dev/sdaERROR: device"ddf1_4035305a8680b02520202020202020209a33c30a3a354a45" could not befoundRAID set"ddf1_4035305a8680b02520202020202020209a33c30a3a354a45" is not active[root@web1 conf]#--验证:[root@web1 ~]# dmraid -sERROR: ddf1: wrong # of devices in RAID set"ddf1_4035305a8680b02520202020202020209a33c30a3a354a45" [1/2] on/dev/sda*** Group superset .ddf1_disks--> *Inconsistent*Subsetname : ddf1_4035305a8680b02520202020202020209a33c30a3a354a45size : 145051648stride : 128type : mirrorstatus : inconsistentsubsets: 0devs : 1spares : 0[root@web1 ~]#释放以后我们就可以对磁盘格式化,在进行挂载了。但这样在系统重启之后,还是会识别到磁盘的RAID信息,依旧不能正常mount。尝试清除磁盘上RAID的信息。--使用dmraid –x:[root@web1 ~]# dmraid -xERROR: ddf1: wrong # of devices in RAID set"ddf1_4035305a8680b02520202020202020209a33c30a3a354a45" [1/2] on/dev/sdaAbout to delete RAID setddf1_4035305a8680b02520202020202020209a33c30a3a354a45WARNING: The metadata stored on theraidset(s) will not be accessible after deletionDo you want to continue ? [y/n] :yERROR: Raid set deletion is notsupported in "ddf1" format[root@web1 ~]#--使用:dmraid -rE[root@web1 mapper]# dmraid -rEDo you really want to erase"ddf1" ondisk metadata on /dev/sda ? [y/n] :yERROR: ddf1: seeking device"/dev/sda" to 38070153641984ERROR: writing metadata to /dev/sda, offset74355768832 sectors, size 0 bytes returned 0ERROR: erasing ondisk metadata on /dev/sda[root@web1 mapper]#都不能成功清除,这样即使我把mount信息添加到/etc/fstab里,在启动启动之后,也不能正常mount。所以选择了一种方法。在/etc/rc.d/rc.local 文件中添加了如下信息:dmraid -a nosleep 5mount /dev/sda1 /backup这样就可以自动挂载了。Multipath实现LUN设备名称的持久化SSD安装UbuntuKylin 13.04相关资讯 RAID
- RHCE学习笔记:RAID种类 (08月01日)
- LFCS 系列第六讲:组装分区为RAID (04月18日)
- RAID级别和实现实例操作详解 (12/22/2015 14:57:09)
| - 图解RAID 0, RAID 1, RAID 5, RAID (07月27日)
- Red Hat Linux 7 下软件仿真 磁盘 (03月17日)
- 在 Linux 下使用 RAID(九):如何 (10/24/2015 14:40:07)
|
本文评论 查看全部评论 (0)