Linux 挂载存储方法
申请的虚拟机因总宕机,处理完之后多分配了我100G空间,还是狠讲究的嘛,挂载方法如下:
初始磁盘挂载情况:
[root@wmstest ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 9.0G 9.1G 50% /
/dev/sda4 44G 181M 41G 1% /u01
/dev/sda1 99M 22M 73M 23% /boot
tmpfs 4.0G 0 4.0G 0% /dev/shm
查看磁盘:
[root@wmstest ~]# fdisk -l
Disk /dev/sda: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2563 20482875 83 Linux
/dev/sda3 2564 4603 16386300 82 Linux swap / Solaris
/dev/sda4 4604 10443 46909800 83 Linux
Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
用fdisk对磁盘分区:
[root@wmstest ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 13054.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-13054, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-13054, default 13054):
Using default value 13054
Command (m for help): p
Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 13054 104856223+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
再次查看磁盘:
[root@wmstest ~]# fdisk -l
Disk /dev/sda: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2563 20482875 83 Linux
/dev/sda3 2564 4603 16386300 82 Linux swap / Solaris
/dev/sda4 4604 10443 46909800 83 Linux
Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 13054 104856223+ 83 Linux
格式化磁盘:
[root@wmstest ~]# mkfs -t ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
13107200 inodes, 26214055 blocks
1310702 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
挂载磁盘:
[root@wmstest ~]# mount /dev/sdb1 /u01/
[root@wmstest ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 9.0G 9.1G 50% /
/dev/sda4 99G 188M 94G 1% /u01
/dev/sda1 99M 22M 73M 23% /boot
tmpfs 4.0G 0 4.0G 0% /dev/shm
/dev/sdb1 99G 188M 94G 1% /u01
设置开机自动挂载:
[root@wmstest ~]# vi /etc/fstab
/dev/sdb1 /u01 ext3 defaults 0 0
Linux 挂载存储方法的更多相关文章
- Oracle Linux 挂载存储
#启动多路径multipathd服务 service multipathd restart #设置开机自动启动multipathd服务 chkconfig multipathd on #查看信息mul ...
- linux 挂载存储步骤(以emc 5300为例)
挂载存储有两种方式:光纤模式(hub卡)和iscsi (以太网).两者大体思路是一样的. 1.在应用服务器上安装hub卡,连接光纤到光纤交换机上: 2.在应用服务器安装hub卡驱动程序: 3.在存储上 ...
- Linux挂载存储(供应商给的资料)
infofile iqn.1994-05.com.redhat:16a2b8b7d8 infodb iqn.1994-05.com.redhat:8518efa2fe72 在iscsi server上 ...
- 截取linux文件存储路径方法
1.截取linux文件存储路径方法 package com.tydic.eshop.action.freemarker; public class dddd { public static void ...
- Linux 挂载Windows共享文件夹和NAS存储
summary: [Linux 挂载共享存储] 概述 将Windows共享文件夹和NAS存储挂载至Linux. Linux系统环境:CentOS 挂载共享存储 查看外部主机共享了哪些目录 smbcli ...
- linux 挂载(转载)
From:http://forum.ubuntu.org.cn/viewtopic.php?t=257333 用linux,就一定要用linux的方式去思维.嗯,说的容易做起来难.我的D盘哪去了?恐怕 ...
- linux挂载U盘(转载)
一.Linux挂载U盘:1.插入u盘到计算机,如果目前只插入了一个u盘而且你的硬盘不是scsi的硬盘接口的话,那它的硬件名称为:sda1.2.在mnt目录下先建立一个usb的目录(如:[root@lo ...
- Win7激活后添加grub引导Linux最简单方法
因为Win7(Vista同理)的激活方式是通过grub摸你OEM的Slic信息,所以主引导分区MBR被这个grub占用,以此才能激活WIn7.但是如果想同时安装Linux在别的分区,就会产生问题:gr ...
- linux挂载本地windows分区或目录
linux挂载本地windows分区或目录 一.linux挂载本地windows硬盘分区 向虚拟机Centos添加本地windows硬盘 注:(添加物理硬盘后,在centos操作会直接写入本地硬盘) ...
随机推荐
- jquery plugins —— datatables ajax post更新数据
通过下面语句,可以定义datatables插件通过ajax post方法从服务器段获取JSON格式的数据. 错误写法(这样写再执行ajax.reload()方法时,ID参数还是初始时,不会更新): v ...
- HTML 5 History API的”前生今世”
History是有趣的,不是吗?在之前的HTML版本中,我们对浏览历史记录的操作非常有限.我们可以来回使用可以使用的方法,但这就是一切我们能做的了. 但是,利用HTML 5的History API,我 ...
- SLR,语法分析表的构建
太累了,感觉不会再爱了.执行了跟编译原理上的一模一样的例子,输出了正确结果 #include <stdio.h> #include <malloc.h> #include &l ...
- Table of Contents - Ehcache
Ehcache 2.9.x API Developer Guide Key Classes and Methods Basic Caching Cache Usage Patterns Searchi ...
- C语言经典参考书籍
<C程序设计语言> Brian W.Kernighan,Dennis M.Ritchie 编著:C语言的开山之作.C程序员应该人手一本. <C语言参考手册> Samuel P. ...
- 根据数据库内容动态生成html页面
之前使用了很多方法,但是都很复杂. 项目里包括了数据库的管理页面,对数据库进行修改(新增,插入,删除)等之后,在另一个页面使用. 使用时采用按下相应label弹出所有信息的方法,以html的形式将数据 ...
- C语言中char* 和 char []区别
想要把丢掉的东西捡起来,还是很辛苦啊,今天我就发现,我连char* 和 char []的区别都不知道. 很多人觉得这两个定义效果一样,其实差别很大.以下是个人的一些看法,有不正确的地方望指正. 本质上 ...
- Javascript获取URL地址变量参数值的方法
今天碰到在做一个动态页面的时候,需要用到 URL 的参数值来作判断,从而决定某一块内容在当前页面是否显示.例如exampe.html?parm1=xxx&parm2=xxx&parm3 ...
- 验证证书的安装之外部用户PC
背景:使用一个域外的用户进行登录并验证 1. 用户登录浏览器下载CA证书或者证书链 2. 下载 3. 安装证书 4. ...
- 《Cocos2d-x实战 JS卷 Cocos2d-JS开发》上线了
感谢大家一直以来的支持! 各大商店均开始销售:京东:http://item.jd.com/11659698.html当当:http://product.dangdang.com/23659808.ht ...