Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Solution & quot;/dev/sdX is apparently in use by the systemwill not make a filesystem here"

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Configure multipath on Linux, divide a 100G LUN on HP EVA storage, then map it to Linux host, and partition the 100G space using fdisk into three zones (for Linux multipath multipathing configuration and use cases, please refer to another blog post of the author: http://blog.itpub.net/31015730/viewspace-2146732/)

[root@seaing mapper] # cat / proc/partitions

Major minor # blocks name

8 0 488386584 sda

8 1 104391 sda1

82 488279610 sda2

8 16 104857600 sdb

8 17 48837568 sdb1

8 18 29302560 sdb2

8 19 19543072 sdb3

8 32 209715200 sdc

8 48 104857600 sdd

8 49 48837568 sdd1

8 50 29302560 sdd2

8 51 19543072 sdd3

8 64 209715200 sde

8 80 104857600 sdf

8 81 48837568 sdf1

8 82 29302560 sdf2

8 83 19543072 sdf3

8 96 209715200 sdg

8 112 104857600 sdh

8 113 48837568 sdh2

8 114 29302560 sdh3

8 115 19543072 sdh4

8 128 209715200 sdi

253 0 469794816 dm-0

253 1 18481152 dm-1

253 2 104857600 dm-2

253 3 209715200 dm-3

But an error occurred while formatting the file system

[root@seaing mapper] # mkfs.ext3 / dev/sdb1

Mke2fs 1.39 (29-May-2006)

/ dev/sdb1 is apparently in use by the system; will not make a filesystem here!

Prompt / dev/sdb1 is in use. / dev/sdb1 is being managed by DM, so we report an error when we create a file system. By removing it manually, we can create a file system normally, as shown below:

[root@seaing mapper] # dmsetup status

Mpath3: 0 419430400 multipath 2 00 0 2 1 A 0 2 0 8:64 A 0 8:128 A 0 E 0 2 0 8:32 A 0 8:96 A 0

Mpath2: 0 209715200 multipath 200 0 2 1 A 0 20 8:16 A 0 8:80 A 0 E 0 20 8:48 A 0 8:112 A 0

VolGroup00-LogVol01: 0 36962304 linear

VolGroup00-LogVol00: 0 939589632 linear

[root@seaing mapper] # mkdir / dev/mapper/mpath2 / comsys/

Mkdir: cannot create directory `/ dev/mapper/mpath2': File exists

Mkdir: cannot create directory `/ comsys/': File exists

[root@seaing mapper] #

[root@seaing mapper] # df-h

Filesystem Size Used Avail Use% Mounted on

/ dev/mapper/VolGroup00-LogVol00

434G 4.9G 407G 2% /

/ dev/sda1 99M 18M 77M 19% / boot

Tmpfs 7.9G 0 7.9G 0% / dev/shm

[root@seaing mapper] #

[root@seaing mapper] #

[root@seaing mapper] # mount / dev/mapper/mpath2 / comsys/

Mount: you must specify the filesystem type

[root@seaing mapper] # mount / dev/sdb1 / comsys/

Mount: / dev/sdb1 already mounted or / comsys/ busy

Delete the mapping relationship and cancel the mapping

[root@seaing mapper] # dmsetup remove_all (or dmsetup remove mpath2)

[root@seaing mapper] #

[root@seaing mapper] # dmsetup status

VolGroup00-LogVol01: 0 36962304 linear

VolGroup00-LogVol00: 0 939589632 linear

[root@seaing mapper] #

[root@seaing mapper] # ll / dev/mapper

Total 0

Crw- 1 root root 10, 63 Oct 24 18:02 control

Brw-rw---- 1 root disk 253, 0 Oct 24 18:02 VolGroup00-LogVol00

Brw-rw---- 1 root disk 253, 1 Oct 24 18:02 VolGroup00-LogVol01

Create the file system again, successfully

[root@seaing mapper] # mkfs.ext3 / dev/sdb1

Mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

6111232 inodes, 12209392 blocks

610469 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

373 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

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

4096000, 7962624, 11239424

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or

180 days, whichever comes first. Use tune2fs-c or-i to override.

Mounted successfully

[root@seaing mapper] # mount / dev/sdb1 / comsys/

[root@seaing mapper] #

[root@seaing mapper] # df-h

Filesystem Size Used Avail Use% Mounted on

/ dev/mapper/VolGroup00-LogVol00

434G 4.9G 407G 2% /

/ dev/sda1 99M 18M 77M 19% / boot

Tmpfs 7.9G 0 7.9G 0% / dev/shm

/ dev/sdb1 46G 181M 44G 1% / comsys

Set to boot mount

[root@seaing mapper] # vi / etc/fstab

/ dev/VolGroup00/LogVol00 / 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

/ dev/VolGroup00/LogVol01 swap swap defaults 00

/ dev/sdb1 / comsys ext3 defaults 0 0

Restart the operating system to see if the automatic mount is successful

[root@seaing /] # reboot

Broadcast message from root (pts/1) (Wed Oct 25 10:16:35 2017):

The system is going down for reboot NOW!

Last login: Wed Oct 25 08:54:28 2017 from 10.1.1.44

[root@seaing ~] # cd / dev/mapper/

[root@seaing mapper] #

[root@seaing mapper] # ll

Total 0

Crw- 1 root root 10, 63 Oct 25 10:19 control

Brw-rw---- 1 root disk 253, 2 Oct 25 10:19 mpath2

Brw-rw---- 1 root disk 253, 4 Oct 25 10:19 mpath2p1

Brw-rw---- 1 root disk 253, 5 Oct 25 10:19 mpath2p2

Brw-rw---- 1 root disk 253, 6 Oct 25 10:19 mpath2p3

Brw-rw---- 1 root disk 253, 3 Oct 25 10:19 mpath3

Brw-rw---- 1 root disk 253, 0 Oct 25 10:19 VolGroup00-LogVol00

Brw-rw---- 1 root disk 253, 1 Oct 25 10:19 VolGroup00-LogVol01

[root@seaing mapper] #

[root@seaing mapper] # ll / dev/mpath/

Total 0

Lrwxrwxrwx 1 root root 7 Oct 25 10:19 mpath2->.. / dm-2

Lrwxrwxrwx 1 root root 7 Oct 25 10:19 mpath2p1->.. / dm-4

Lrwxrwxrwx 1 root root 7 Oct 25 10:19 mpath2p2->.. / dm-5

Lrwxrwxrwx 1 root root 7 Oct 25 10:19 mpath2p3->.. / dm-6

Lrwxrwxrwx 1 root root 7 Oct 25 10:19 mpath3->.. / dm-3

Test after restart, the file cannot be mounted normally, and manual mount will fail.

[root@seaing mapper] # df-h

Filesystem Size Used Avail Use% Mounted on

/ dev/mapper/VolGroup00-LogVol00

434G 4.9G 407G 2% /

/ dev/sda1 99M 18M 77M 19% / boot

Tmpfs 7.9G 0 7.9G 0% / dev/shm

Manual mount will not succeed.

[root@seaing mapper] # mount-a

Mount: / dev/sdb1 already mounted or / comsys busy

So this method can only be mounted temporarily, personally, I think it is not too undesirable! If you want to mount permanently, it is safer to follow the method of another blog post (http://blog.itpub.net/31015730/viewspace-2146732/) of the author.

Author: SEian.G (hard practice changes in 72, but it is difficult to laugh at 81)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report