linux查看lun对应的硬盘,手把手教你在不同操作系统下如何识别存储磁盘LUN,如何管理磁盘LUN。...

一、在LINUX系统下如何识别存储磁盘LUN,如何管理LUN。

1.Netapp 创建一个3774 MB 的linux lun,需要重启linux系统才能认到盘符.(如何使用裸映射功能点击此处)

2.   通过fdsik命令查看磁盘列表

[root@localhost ~]#  fdisk -l

Disk /dev/sda: 146.8 GB, 146815733760 bytes

255 heads, 63 sectors/track, 17849 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000080

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          26      204800   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              26         287     2097152   82  Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

/dev/sda3             287       17850   141071360   83  Linux

Disk /dev/sdd: 3774 MB, 3774873600 bytes

117 heads, 62 sectors/track, 1016 cylinders

Units = cylinders of 7254 * 512 = 3714048 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 4096 bytes / 65536 bytes

Disk identifier: 0x00000000

Disk /dev/sdd doesn't contain a valid partition table        -------可以看到已经识别到创建的LUN。但这个盘符是新建盘符没有分区和格式化,不可用。

3.  将磁盘分区:

[root@localhost ~]# fdisk /dev/sdd

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0xac956c3a.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

switch off the mode (command 'c') and change display units to

sectors (command 'u').

Command (m for help): p ------------------------打印盘符

Disk /dev/sdd: 3774 MB, 3774873600 bytes

117 heads, 62 sectors/track, 1016 cylinders

Units = cylinders of 7254 * 512 = 3714048 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 4096 bytes / 65536 bytes

Disk identifier: 0xac956c3a

Device Boot      Start         End      Blocks   Id  System

Command (m for help): n------------------------新建分区

Command action

e   extended

p   primary partition (1-4)

p-----------------------------选择主分区

Partition number (1-4): 1

First cylinder (1-1016, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-1016, default 1016):

Using default value 1016

Command (m for help): w ---------------------写入列表相当于保存

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

注:如果同一台设备的两个node挂同样的盘符,另一个盘符还需要再次写入w就行。不需要n了。

4.  格式化磁盘,需要格式化成操作系统可以识别的磁盘,操作系统才可以对磁盘进行管理操作:

[root@localhost ~]# mkfs.ext4 /dev/sdd1

mke2fs 1.41.12 (17-May-2010)

/dev/sdd1 alignment is offset by 1024 bytes.

This may result in very poor performance, (re)-partitioning suggested.

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=1 blocks, Stripe width=16 blocks

230608 inodes, 921250 blocks

46062 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=943718400

29 block groups

32768 blocks per group, 32768 fragments per group

7952 inodes per group

Superblock backups stored on blocks:

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

Writing inode tables: done

Creating journal (16384 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.

5. 查看盘符挂载情况:

[root@localhost ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda3             133G  8.5G  118G   7% /

tmpfs                 3.9G   96K  3.9G   1% /dev/shm

/dev/sda1             194M   32M  153M  17% /boot

6. 将刚才格式化的磁盘/dev/sdd1挂载到 /mnt

[root@localhost ~]# mount /dev/sdd1 /mnt

[root@localhost ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda3             133G  8.5G  118G   7% /

tmpfs                 3.9G   96K  3.9G   1% /dev/shm

/dev/sda1             194M   32M  153M  17% /boot

/dev/sdd1             3.5G   72M  3.3G   3% /mnt    --------成功挂载/dev/sdd1挂载到 /mnt

这样在linux下就可以对新建的lun进行管理操作了:

[root@localhost ~]# cd /mnt/    进入挂载目录/mnt下对磁盘进行管理操作。

[root@localhost mnt]# touch x

二、在ESX系统下如何识别存储磁盘LUN,如何管理LUN。

在ESX操作系统下LUN有两种使用方式:一种是将LUN格式化成VMFS(vm文件系统)格式,做为类似于本地存储的设备。另一种是裸磁盘映射(RDM)。

成功新建好LUN后,使用vsphere登录到ESX主机。

1.选中ESX主机----配置----存储器:刷新一下列表再全部重新扫描一下。

2.点击添加存储器:

3.选择磁盘/LUN

4.可以看到ESX已经别到新的存储LUN:

到这里有两个选择:

如果做裸磁盘映射就直接退出。

如果是想格式化成vmfs文件系统就继续下一步,一直到最后一步。

最后在存储数据页面下就可以看到识别成本地存储设备,这样就可以直接在ESX操作系统下管理操作这个存储设备:

选中存储设备右击浏览存储设备,可以对磁盘进行上传和下载文件。

三、在windows系统下如何识别存储磁盘LUN,如何管理LUN。

1.在windows操作系统下找到服务器磁盘管理:菜单上选择存储---磁盘管理---右击重新扫描磁盘:

2.新获取的磁盘,操作系统还无法识别,只是在磁盘管理中可以看到有新磁盘信息。

3.接着格式化磁盘:选中新的磁盘右击联机

4.右击空白处新建磁盘卷,全部使用默认值下一步最后完成:磁盘卷就会添加上盘符。

5.最后在我的电脑中就可以看到新的盘符,你就可以像使用本地磁盘一样操作这个新的磁盘卷。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值