2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

/dev/loop を動的作成

Posted at

前提知識

  • CentOS-6.xの初期状態は、合計8つ

状況

  • システム起動時に作成される設定を忘れた
  • 追加してたが、更に追加したい

追加手順(スクリプト)

仕様

  • /dev/loop8 ~ /dev/loop127 まで作成
# !/bin/bash

set -e
set -x

for i in {8..127}; do
  loopdev=/dev/loop${i}
  if [[ -b ${loopdev} ]]; then
    continue
  fi
  mknod -m 660 ${loopdev} b 7 ${i}
  chgrp disk ${loopdev}
done

改良点

  • 127では足りない場合、255などへ変更

あとがき

時々困るだけだけども、大切な作業。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?