虚拟机Linux增加硬盘

red hat常用配置:点击打开链接

虚拟机设置中选择添加硬盘

具体操作如下

[root@victredhat6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_victredhat6-lv_root
                       13G   11G  1.3G  89% /
tmpfs                 504M  300M  204M  60% /dev/shm
/dev/sda1             485M   30M  430M   7% /boot
[root@victredhat6 mapper]# ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 Jul 14 09:57 /dev/sda
brw-rw---- 1 root disk 8,  1 Jul 14 09:57 /dev/sda1
brw-rw---- 1 root disk 8,  2 Jul 14 09:57 /dev/sda2
brw-rw---- 1 root disk 8, 16 Jul 14 09:57 /dev/sdb
[root@victredhat6 mapper]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x150cd4e2.
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): c

DOS Compatibility flag is not set

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-1958, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1958, default 1958): 
Using default value 1958

Command (m for help): p
Disk /dev/sdb: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders, total 31457280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x150cd4e2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    31455269    15726611   83  Linux

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
df: no file systems processed

[root@victredhat6 mapper]# ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 Jul 14 09:57 /dev/sda
brw-rw---- 1 root disk 8,  1 Jul 14 09:57 /dev/sda1
brw-rw---- 1 root disk 8,  2 Jul 14 09:57 /dev/sda2
brw-rw---- 1 root disk 8, 16 Jul 14 16:51 /dev/sdb
brw-rw---- 1 root disk 8, 17 Jul 14 16:51 /dev/sdb1

[root@victredhat6 mapper]# mkdir /test
[root@victredhat6 mapper]# mount -t  ext3 /dev/sdb1 /test
[root@victredhat6 mapper]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_victredhat6-lv_root
                       13G   11G  1.3G  89% /
tmpfs                 504M  300M  204M  60% /dev/shm
/dev/sda1             485M   30M  430M   7% /boot
/dev/sdb1              15G  166M   14G   2% /test
[root@victredhat6 ~]# vi /etc/fstab
# /etc/fstab
# Created by anaconda on Wed Jun 18 17:43:52 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_victredhat6-lv_root /                       ext4    defaults        1 1
UUID=bbbeb9df-02a4-4796-828c-c452b03801bc /boot            ext4    defaults        1 2
/dev/mapper/vg_victredhat6-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                           tmpfs   defaults        0 0
devpts                  /dev/pts                           devpts  gid=5,mode=620  0 0
sysfs                   /sys                               sysfs   defaults        0 0
proc                    /proc                              proc    defaults        0 0
/dev/sdb1               /test                              ext3    defaults        1 1
~
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值