Mkfs-t ext3 error/dev/sdxx is apparently on use by the system; Workaround

Source: Internet
Author: User

?? A 500G space is shared on the storage, mapped to the Linux system provider, and the environment consists of 2 nodes.

A Test one: Direct mount

After formatting with Fdisk is as follows:

[Email protected] u01]# fdisk-l

......

disk/dev/sdk:536.8 GB, 536870912000 bytes

255 heads, Sectors/track, 65270cylinders

Units = Cylinders of 16065 * 8225280bytes

Device Boot Start End Blocks Id System

/DEV/SDK1 1 65270 524281243+ Linux

......

[[Email protected]]#

But create file system times wrong:

[Email protected] u01]# mkfs-t EXT3/DEV/SDK1

MKE2FS 1.39 (29-may-2006)

/dev/sdk1 isapparently in use by the system; Won't make a filesystem here!

Tip/DEV/SDK1 is being used. /DEV/SDK1 is being managed by DM, so we create file system prompt error, we manually remove, you can create a file system, the operation is as follows:

[Email protected] u01]# dmsetup status

mpath2:0 2097152 multipath 2 0 1 0 1 1 A 0 8:16 a 0

mpath11p1:0 1048562487 Linear

mpath9:0 209715200 multipath 2 0 1 0 1 1 A0 1 0 8:128 A 0

mpath8:0 629145600 multipath 2 0 1 0 1 1 A0 1 0 8:112 A 0

mpath7:0 629145600 multipath 2 0 1 0 1 1 A0 1 0 8:96 A 0

mpath6:0 2097152 multipath 2 0 1 0 1 1 A 0 8:80 a 0

mpath5:0 2097152 multipath 2 0 1 0 1 1 A 0 8:64 a 0

mpath11:0 1048576000 multipath 2 0 1 0 1 1 A 0 1 0 8:160 A 0

mpath4:0 2097152 multipath 2 0 1 0 1 1 A 0 8:48 a 0

mpath10:0 209715200 multipath 2 0 1 0 1 1 A 0 1 0 8:144 A 0

mpath3:0 2097152 multipath 2 0 1 0 1 1 A 0 8:32 a 0

[Email protected] u01]# Dmsetup Remove_all

[Email protected] u01]# Dmsetupstatus

No devices found

[Email protected] u01]# MKFS-TEXT3/DEV/SDK1

MKE2FS 1.39 (29-may-2006)

Filesystem label=

OS Type:linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

65536000 inodes, 131070310 blocks

6553515 blocks (5.00%) reserved for thesuper user

First Data block=0

Maximum filesystem blocks=4294967296

4000 block groups

32768 blocks per group, 32768 fragments Pergroup

16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

102400000

Writing Inode Tables:done

Creating Journal (32768 blocks): Done

Writing Superblocks and Filesystemaccounting Information:done

This filesystem'll be automaticallychecked every mounts or

Whichever comes first. Use Tune2fs-c or-i to override.

-- The file system was created successfully.

--mount Success:

[Email protected] u01]# Mount/dev/sdk1/u01/backup

[Email protected] u01]# DF-LH

Filesystem Size used Avail use% mounted on

/dev/sda3 59G 22G 35G 39%/

/DEV/SDA1 996M 51M 894M 6%/boot

Tmpfs 32G 0 32G 0%/dev/shm

/DEV/SDA4 145G 188M 138G 1%/u01/dave

/dev/sdk1 493G 198M 467G 1%/u01/backup

--Modify the/etc/fstab file to automatically mount the boot:

[Email protected] mapper]# Vi/etc/fstab

label=//ext3 Defaults 1 1

Label=/boot/boot ext3 Defaults 1 2

TMPFS/DEV/SHM TMPFS Defaults 0 0

Devpts/dev/pts devpts gid=5,mode=620 0 0

Sysfs/sys Sysfs Defaults 0 0

PROC/PROC proc Defaults 0 0

Label=swap-sda2 swap swap defaults 0 0

/dev/sdk1/u01/backup ext3 defaults 0 0

However, after restarting the test, the file cannot be mounted properly and the manual mount will fail.

Therefore, this solution does not work.

Supplemental content:

Device Mapper is a mapping framework mechanism from logical devices to physical devices provided in the Linux 2.6 kernel, in which the user can easily make a management strategy for implementing storage resources, such as stripe, mirror, snapshot, etc., according to their own needs. The current more popular Linux logical Volume manager such as LVM2 (Linux Volume Manager 2 version), EVMS (Enterprisevolume Management System), Dmraid (Device Mapper Raidtool) is based on this mechanism. As long as the user in the user space to develop a mapping strategy, according to their own needs to write processing specific IO request target driver plug-in, it is convenient to implement these features.

Device mapper mainly contains the kernel space mapping and user space of the device Mapper library and Dmsetup tools.

Two Experiment two: Using Multipath

For multipath configuration instructions, refer to:

Multipath implementing the LUN device name persistence

http://blog.csdn.net/tianlesoftware/article/details/5979061

-- Get Wwid:

[Email protected] mapper]#/sbin/scsi_id-g-U-S/BLOCK/SDK

3690b11c00022bc0e000003e55105b786

-- To Modify the multipath.conf file:

[Email protected] mapper]# vi/etc/multipath.conf

multipaths {

multipath {

Wwid 3690b11c00022bc0e000003e55105b786

Alias backup

Path_grouping_policy Multibus

Path_checker Readsector0

Path_selector "Round-robin 0"

failback Manual

Rr_weight Priorities

No_path_retry 5

}

# multipath {

# Wwid 1dec_____321816758474

# alias Red

#      }

}

"/etc/multipath.conf" 177L, 4832Cwritten

-- Restart multipath:

[[Email protected] mapper]# service Multipathdrestart

Stopping MULTIPATHD daemon: [OK]

Starting MULTIPATHD daemon: [OK]

-- Check File:

[Email protected] mapper]# cd/dev/mapper/

[email protected] mapper]# LL

Total 0

BRW-RW----1 root disk253, 9 Feb 12:35 Backup

BRW-RW----1 root disk253, 12:35 Backupp1

CRW-------1 root root, 12:35 control

BRW-RW----1 root disk 253, 8 Feb 12:35 mpath10

BRW-RW----1 root disk 253, 0 Feb 12:35 mpath2

BRW-RW----1 root disk 253, 1 Feb 12:35 Mpath3

BRW-RW----1 root disk 253, 2 Feb 12:35 Mpath4

BRW-RW----1 root disk 253, 3 Feb 12:35 Mpath5

BRW-RW----1 root disk 253, 4 Feb 12:35 Mpath6

BRW-RW----1 root disk 253, 5 Feb 12:35 Mpath7

BRW-RW----1 root disk 253, 6 Feb 12:35 Mpath8

BRW-RW----1 root disk 253, 7 Feb 12:35 mpath9

--mount File:

[Email protected] mapper]# Mount/dev/mapper/backupp1/u01/backup

-- Check Mount:

[Email protected] mapper]# DF-LH

Filesystem Size used Avail use% mounted on

/dev/sda3 59G 22G 34G 39%/

/DEV/SDA1 996M 51M 894M 6%/boot

Tmpfs 32G 364M 32G 2%/DEV/SHM

/DEV/SDA4 145G 188M 138G 1%/u01/dave

/dev/mapper/backupp1 493G 198M 467G 1%/u01/backup

After modifying the/etc/fstab file, the restart can be mounted automatically. But this is a 2 node, and the storage configuration is shared. However, the files created in Node 1 are not recognized on Node 2 and are tested to see the files created by another node only after the mount has been re-built.

The test steps are as follows:

[email protected] backup]# LL

Total 24

-rw-r--r--1 root root 0 Feb 12:57 bl

Drwxr-xr-x 2 root root 4096 Feb 12:55 Dave

-rw-r--r--1 root root 5 Feb 12:55 DVD

drwx------2 root root 16384 Feb 12:10lost+found

-- Create file Orcl:

[email protected] backup]# Touch ORCL

-- in the Node 2 umount directory:

[Email protected] backup]# Umount/u01/backup

Umount:/u01/backup:device is busy

Umount:/u01/backup:device is busy

[Email protected] backup]# Fuser-km/u01/backup

/u01/backup:9848c

[Email protected] ~]# DF-LH

Filesystem Size used Avail use% mounted on

/dev/sda3 70G 20G 46G 31%/

/DEV/SDA1 996M 51M 894M 6%/boot

Tmpfs 32G 364M 32G 2%/DEV/SHM

/dev/mapper/backupp1 493G 198M 467G 1%/u01/backup

[Email protected] ~]# Umount/u01/backup

-- Confirm Umount Success:

[Email protected] ~]# DF-LH

Filesystem Size used Avail use% mounted on

/dev/sda3 70G 20G 46G 31%/

/DEV/SDA1 996M 51M 894M 6%/boot

Tmpfs 32G 364M 32G 2%/DEV/SHM

-- Mount again:

[Email protected] ~]# Mount/dev/mapper/backupp1/u01/backup

[Email protected] ~]# Cd/u01/backup

[email protected] backup]# LL

Total 24

-rw-r--r--1 root root 0 Feb 12:57 bl

Drwxr-xr-x 2 root root 4096 Feb 12:55 Dave

-rw-r--r--1 root root 5 Feb 12:55 DVD

drwx------2 root root 16384 Feb 12:10lost+found

-rw-r--r--1 root root 0 Feb 14:34 ORCL

[Email protected] backup]#

This time I saw the file created on Node 2 on Node 1.

Mkfs-t ext3 error/dev/sdxx is apparently on use by the system; Workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.