debian 8.2 dynamic add disk

本文介绍如何在Debian8.2系统中通过Vmware虚拟机动态添加硬盘,并展示具体操作步骤,包括添加硬盘、刷新硬盘文件及查看日志等过程。

20170628 本次操作是完成虚拟机debian 动态添加磁盘

安装debian 8.2

省略

动态添加硬盘

vmware 里手动添加一块硬盘

root@debian1:/sys/devices/pci0000:00# ls -l /sys/class/scsi_host
总用量 0
lrwxrwxrwx 1 root root 0 6月 28 15:02 host0 -> ../../devices/pci0000:00/0000:00:07.1/ata1/host0/scsi_host/host0
lrwxrwxrwx 1 root root 0 6月 28 15:02 host1 -> ../../devices/pci0000:00/0000:00:07.1/ata2/host1/scsi_host/host1
lrwxrwxrwx 1 root root 0 6月 28 15:02 host2 -> ../../devices/pci0000:00/0000:00:10.0/host2/scsi_host/host2

刷新硬盘文件
# echo “- - -” > /sys/class/scsi_host/host0/scan
# echo “- - -” > /sys/class/scsi_host/host1/scan
# echo “- - -” > /sys/class/scsi_host/host2/scan
# cat /var/log/messages

Jun 28 15:05:27 debian1 kernel: [ 1450.116154] scsi 2:0:1:0: Direct-Access VMware, VMware Virtual S 1.0 PQ: 0 ANSI: 2
Jun 28 15:05:27 debian1 kernel: [ 1450.116177] scsi target2:0:1: Beginning Domain Validation
Jun 28 15:05:27 debian1 kernel: [ 1450.116682] scsi target2:0:1: Domain Validation skipping write tests
Jun 28 15:05:27 debian1 kernel: [ 1450.116684] scsi target2:0:1: Ending Domain Validation
Jun 28 15:05:27 debian1 kernel: [ 1450.116720] scsi target2:0:1: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)
Jun 28 15:05:27 debian1 kernel: [ 1450.117917] sd 2:0:1:0: [sdb] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB)
Jun 28 15:05:27 debian1 kernel: [ 1450.117947] sd 2:0:1:0: [sdb] Write Protect is off
Jun 28 15:05:27 debian1 kernel: [ 1450.118029] sd 2:0:1:0: [sdb] Cache data unavailable
Jun 28 15:05:27 debian1 kernel: [ 1450.118440] sdb: unknown partition table
Jun 28 15:05:27 debian1 kernel: [ 1450.118663] sd 2:0:1:0: [sdb] Attached SCSI disk
Jun 28 15:05:27 debian1 kernel: [ 1450.119722] sd 2:0:1:0: Attached scsi generic sg2 type 0
Jun 28 15:05:30 debian1 kernel: [ 1453.723352] floppy: error -5 while reading block 0
Jun 28 15:05:30 debian1 kernel: [ 1453.743412] floppy: error -5 while reading block 0

发现新的硬盘
root@debian1:/sys/devices/pci0000:00# fdisk -l

Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

之后一定要使用 linux lvm 的方式管理硬盘

转载于:https://www.cnblogs.com/ctypyb2002/p/9793146.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值