centos-rhel服务器相关 / 未分类 · 2015年3月30日

Linux系统挂载数据盘

近来fab买了个新服务器 于是得挂一下数据盘
[root@fab-us ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 20G 1.4G 18G 8% /
tmpfs 938M 0 938M 0% /dev/shm
[root@fab-us ~]# fdisk -l
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00078f9c
Device Boot Start End Blocks Id System
/dev/xvda1 * 1 2611 20970496 83 Linux
Disk /dev/xvdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 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: 0x00000000
查看原来的系统盘是什么格式 ,这里可见为 ext4 所以建议数据盘也为ext4
[root@fab-us ~]# file -s /dev/xvda1
/dev/xvda1: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files)
[root@fab-us ~]# fdisk -S 56 /dev/xvdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x6618f00e.
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-29371, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-29371, default 29371):
Using default value 29371
Command (m for help): wq
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
echo ‘/dev/xvdb1 /data ext4 defaults 0 0’ >>/etc/fstab
mount -a
http://help.aliyun.com/knowledge_detail.htm?knowledgeId=5974154