linux 挂载硬盘

将一台原先有两个硬盘的windows server 2003系统装维xen server 6.2 。一个硬盘160g,一个500g。xen sever 系统装在了160里面所以要加载500这个硬盘。

1,查看磁盘情况

[root@xenserver-vm1 ~]# fdisk -l


WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.




Disk /dev/sda: 160.0 GB, 160041885696 bytes
256 heads, 63 sectors/track, 19381 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19382   156290903+  ee  EFI GPT


Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       60801   488384001    7  HPFS/NTFS


2,格式化500g这个磁盘格式ext3

[root@xenserver-vm1 ~]# mkfs -t ext3 /dev/sdb
mke2fs 1.39 (29-May-2006)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y                                                     #只需要这里按y 回车下面默认
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
61063168 inodes, 122096646 blocks
6104832 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
3727 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, 71663616, 78675968, 
        102400000


Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 
done


This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

3,查看磁盘情况

[root@xenserver-vm1 ~]# fdisk -l


WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.




Disk /dev/sda: 160.0 GB, 160041885696 bytes
256 heads, 63 sectors/track, 19381 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19382   156290903+  ee  EFI GPT


Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


Disk /dev/sdb doesn't contain a valid partition table


4,对磁盘分区

[root@xenserver-vm1 ~]# 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 60801.
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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-60801, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): 
Using default value 60801


Command (m for help): w
The partition table has been altered!


Calling ioctl() to re-read partition table.
Syncing disks.

5,创建目录,并将磁盘挂载,并查看挂载是否成功

[root@xenserver-vm1 /]# mkdir /u01
[root@xenserver-vm1 /]# mount /dev/sdb1 /u01
[root@xenserver-vm1 /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             4.0G  1.9G  2.0G  49% /
none                  381M   16K  381M   1% /dev/shm
/opt/xensource/packages/iso/XenCenter.iso
                       52M   52M     0 100% /var/xen/xc-install
/dev/sdb1             459G  199M  435G   1% /u01

6,设置自动开机挂载

[root@xenserver-vm1 /]# vi /etc/fstab 


LABEL=root-zhzzjftt    /         ext3     defaults   1  1
/var/swap/swap.001          swap      swap   defaults   0  0
none        /dev/pts  devpts defaults   0  0
none        /dev/shm  tmpfs  defaults   0  0
none        /proc     proc   defaults   0  0
none        /sys      sysfs  defaults   0  0
/opt/xensource/packages/iso/XenCenter.iso   /var/xen/xc-install   iso9660   loop,ro   0  0
/dev/sdb1   /u01                ext3       defaults 0 0


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值