株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

480GBのSSDを買ってきて、USB外付けができるユニットを手に入れたので、接続してみよう!
追加したはいいけど、今のところ使い道があまりない。。。
外付けディスクに仮想マシン入れるのってどうなんだろう。
ちょっと前の現場で、外付けHDDに仮想マシン入れまくっているESXiを動かしていたけど、とてつもない遅さでよくクラッシュしていたよ。
とりあえず、だめならやめればいいかな。
あ、UUIDだったりでfstabに書いたほうがよかったような気がするけどまあいいか。
起動してくることにデバイス番号変わったりしちゃうよねたしか。あれはなんでなんだろう。

一応GUIで出ていたメッセージ。再起動したら大丈夫だった。

# ホットプラグで接続しても認識しない
[root@localhost ~]# dmesg | tail -30
[5255310.992864] usb usb3-port1: cannot disable (err = -32)
[5255310.992869] usb 3-1: USB disconnect, device number 2
[5255313.194617] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[5255314.644602] xhci_hcd 0000:00:14.0: Cannot set link state.
[5255314.644615] usb usb3-port1: cannot disable (err = -32)
[5255314.644635] xhci_hcd 0000:00:14.0: Cannot set link state.
[5255314.644642] usb usb3-port1: cannot disable (err = -32)
[5255406.104884] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready
[5255562.837784] usb 2-2: USB disconnect, device number 2
[5255583.005486] usb 2-2: new high-speed USB device number 8 using xhci_hcd
[5255583.130872] usb 2-2: New USB device found, idVendor=05e3, idProduct=3321
[5255583.130881] usb 2-2: New USB device strings: Mfr=4, Product=5, SerialNumber=6
[5255583.130887] usb 2-2: Product: HE-V300-2
[5255583.130891] usb 2-2: Manufacturer: SSK
[5255583.130894] usb 2-2: SerialNumber: 18062500813
[5255583.142836] usb-storage 2-2:1.0: USB Mass Storage device detected
[5255583.142924] scsi host4: usb-storage 2-2:1.0
[5255583.900527] usb 2-2: USB disconnect, device number 8
[5255584.012690] usb 3-2: new SuperSpeed USB device number 4 using xhci_hcd
[5255584.026478] usb 3-2: New USB device found, idVendor=05e3, idProduct=3321
[5255584.026484] usb 3-2: New USB device strings: Mfr=4, Product=5, SerialNumber=6
[5255584.026488] usb 3-2: Product: HE-V300-2
[5255584.026491] usb 3-2: Manufacturer: SSK
[5255584.026494] usb 3-2: SerialNumber: 18062500813
[5255584.037019] usb-storage 3-2:1.0: USB Mass Storage device detected
[5255584.039481] scsi host5: usb-storage 3-2:1.0
[5255584.333802] usb 3-2: reset SuperSpeed USB device number 4 using xhci_hcd
[5255585.401767] usb 3-2: reset SuperSpeed USB device number 4 using xhci_hcd
[5255586.115674] usb 3-2: reset SuperSpeed USB device number 4 using xhci_hcd
[5255586.832764] usb 3-2: reset SuperSpeed USB device number 4 using xhci_hcd

# OS再起動後、dmesgを見てみるとsdbでマウントされている 
[root@localhost ~]# dmesg | grep sdb
[    7.098936] sd 3:0:0:0: [sdb] 1000215200 512-byte logical blocks: (512 GB/476 GiB)
[    7.100508] sd 3:0:0:0: [sdb] Write Protect is off
[    7.100514] sd 3:0:0:0: [sdb] Mode Sense: 5f 00 10 08
[    7.101351] sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
[    7.106282] sd 3:0:0:0: [sdb] Attached SCSI disk

# fdiskでパーテーションを作成
[root@localhost ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x8e18e208.

コマンド (m でヘルプ): p

Disk /dev/sdb: 512.1 GB, 512110182400 bytes, 1000215200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
Disk label type: dos
ディスク識別子: 0x8e18e208

デバイス ブート      始点        終点     ブロック   Id  システム

コマンド (m でヘルプ): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
パーティション番号 (1-4, default 1):
最初 sector (2048-1000215199, 初期値 2048):
初期値 2048 を使います
Last sector, +sectors or +size{K,M,G} (2048-1000215199, 初期値 1000215199):
初期値 1000215199 を使います
Partition 1 of type Linux and of size 477 GiB is set

コマンド (m でヘルプ): w
パーティションテーブルは変更されました!

ioctl() を呼び出してパーティションテーブルを再読込みします。
ディスクを同期しています。
[root@localhost ~]#

# xfsフォーマットでファイルシステムを作成
[root@localhost ~]# mkfs.xfs /dev/sdb1
meta-data=/dev/sdb1              isize=512    agcount=4, agsize=31256661 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=125026644, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=61048, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

# マウントする
[root@localhost ~]# mkdir /disk1
[root@localhost ~]# mount /dev/sdb1 /disk1/
[root@localhost ~]# df
ファイルシス            1K-ブロック     使用    使用可 使用% マウント位置
/dev/mapper/centos-root    52403200 42514376   9888824   82% /
devtmpfs                    3837516        0   3837516    0% /dev
tmpfs                       3854876        0   3854876    0% /dev/shm
tmpfs                       3854876    10060   3844816    1% /run
tmpfs                       3854876        0   3854876    0% /sys/fs/cgroup
/dev/sda1                   1038336   225436    812900   22% /boot
/dev/mapper/centos-home    63522504 41983144  21539360   67% /home
tmpfs                        770976       28    770948    1% /run/user/0
/dev/sdb1                 499862384    32992 499829392    1% /disk1
[root@localhost ~]#

# 自動マウント設定
[root@localhost ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sat Mar  2 07:45:10 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=1871ad0e-bcc0-4364-83ca-d71af9ed8f2e /boot                   xfs     defaults        0 0
/dev/mapper/centos-home /home                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0
/dev/sdb1       /disk1                          xfs     defaults        0 0

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)