Chinaunix

标题: 如何识别本地磁盘还是挂载磁盘? [打印本页]

作者: 向上爬的蜗牛    时间: 2014-03-05 11:33
标题: 如何识别本地磁盘还是挂载磁盘?
Linux中如何判断其磁盘是本地磁盘还是挂载磁盘?
作者: zhaopingzi    时间: 2014-03-05 11:38
啥意思?你说的本地磁盘和挂载的磁盘都是怎么定义的?
作者: leiminhaha    时间: 2014-03-05 11:41
命令df可以区分:
类似如下:
/dev/mapper/VolGroup00-LogVol00
                      47612792  32093576  13061616  72% /
/dev/mapper/VolGroup00-LogVol02
                      75385912    184220  71310492   1% /log
/dev/sda1               101086     28614     67253  30% /boot
tmpfs                 65011712  17010624  48001088  27% /dev/shm
/dev/mapper/csser2dblunp1
                     768996568 242766308 487167468  34% /u02

tmpfs 下面为挂载的盘
作者: 向上爬的蜗牛    时间: 2014-03-05 11:43
回复 2# zhaopingzi

比如说搭建Oracle RAC的时候,不是需要共享存储吗?共享存储用到的磁盘肯定不可能是本地磁盘。那么,我怎么判断系统上的一块磁盘是本地磁盘还是非本地磁盘?


   
作者: 向上爬的蜗牛    时间: 2014-03-05 11:46
回复 3# leiminhaha


    这种方法不妥吧?
作者: cryboy2001    时间: 2014-03-05 13:18
mount行不,不过如果是iscsi挂的也看不出
# mount
/dev/mapper/vg_host-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_ubject_r:tmpfs_t:s0"
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_kvmhost-lv_home on /home type ext4 (rw)
/dev/sdb1 on /mnt/sdb type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root@kvmhost ~]#

作者: leiminhaha    时间: 2014-03-05 13:55
回复 5# 向上爬的蜗牛


    你指的共享存储是磁阵上的某个映射,还是类似NFS服务的共享盘?
    本地硬盘没用 LVM的话,你看到的分区一般都是在 /dev/sda ;/dev/sdb 之类的名字

   如果是磁盘阵列的映射一般就是/dev/mapper/映射名

   
作者: tz104    时间: 2014-03-05 14:18
iscsi映射过来的盘真得没法子识别吗???
作者: 向上爬的蜗牛    时间: 2014-03-05 14:21
回复 6# cryboy2001

这是我2个节点RAC+ASMLib中的其中一个节点的环境
[root@rac1 ~]# mount
/dev/sda3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
oracleasmfs on /dev/oracleasm type oracleasmfs (rw)
[root@rac1 ~]#
[root@rac1 ~]#
[root@rac1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             128G   30G   93G  24% /
/dev/sda1             485M   38M  422M   9% /boot
tmpfs                 3.9G  231M  3.7G   6% /dev/shm
[root@rac1 ~]#
[root@rac1 ~]#

btw,“iscsi挂的”的是什么意思?
作者: 向上爬的蜗牛    时间: 2014-03-05 14:22
回复 7# leiminhaha


    这是我2个节点RAC+ASMLib中的其中一个节点的环境
[root@rac1 ~]# mount
/dev/sda3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
oracleasmfs on /dev/oracleasm type oracleasmfs (rw)
[root@rac1 ~]#
[root@rac1 ~]#
[root@rac1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             128G   30G   93G  24% /
/dev/sda1             485M   38M  422M   9% /boot
tmpfs                 3.9G  231M  3.7G   6% /dev/shm
[root@rac1 ~]#
[root@rac1 ~]#

我的环境应该不属于磁盘阵列映射吧?
作者: cryboy2001    时间: 2014-03-05 16:38
tz104 发表于 2014-03-05 14:18
iscsi映射过来的盘真得没法子识别吗???


#ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root  9 Jan 28 07:53 ip-192.168.10.1:3260-iscsi-iqn.2011-09.disk1-lun-1 -> ../../sdh
lrwxrwxrwx 1 root root 10 Jan 28 07:53 ip-192.168.10.1:3260-iscsi-iqn.2011-09.disk1-lun-1-part1 -> ../../sdh1
lrwxrwxrwx 1 root root  9 Jan 28 07:53 ip-192.168.10.1:3260-iscsi-iqn.2011-09.disk2-lun-1 -> ../../sde
lrwxrwxrwx 1 root root 10 Jan 28 07:53 ip-192.168.10.1:3260-iscsi-iqn.2011-09.disk2-lun-1-part1 -> ../../sde1
lrwxrwxrwx 1 root root 10 Jan 28 07:53 ip-192.168.10.1:3260-iscsi-iqn.2011-09.disk2-lun-1-part2 -> ../../sde2
lrwxrwxrwx 1 root root  9 Jan 28 07:53 ip-192.168.10.1:3260-iscsi-iqn.2011-09.disk3-lun-1 -> ../../sdd

可以看到哪个是映射的
作者: tz104    时间: 2014-03-05 16:58
回复 11# cryboy2001 赞,感谢。


   
作者: sdau    时间: 2014-03-05 17:13
可以从磁盘驱动层查
作者: y君临城下    时间: 2014-03-06 09:06
回复 4# 向上爬的蜗牛


    前面会有设备IP的吧。
作者: 流氓无产者    时间: 2014-03-06 09:25
向上爬的蜗牛 发表于 2014-03-05 14:21
回复 6# cryboy2001

这是我2个节点RAC+ASMLib中的其中一个节点的**

看总线吧,iscsi一般是session,其他一般是pci or usb or something else
作者: 向上爬的蜗牛    时间: 2014-03-06 16:15
回复 11# cryboy2001

如果我使用ls -l /dev/disk/by-path/的话,看到的全是pci-000开头的东西。请问这表示什么?
   
作者: 向上爬的蜗牛    时间: 2014-03-06 16:16
回复 15# 流氓无产者


    如何看总线?pci的表示什么意思呢?
作者: 流氓无产者    时间: 2014-03-06 18:28
向上爬的蜗牛 发表于 2014-03-06 16:16
回复 15# 流氓无产者

ls /sys/block/sda/device -l
pci 总线的




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2