Xensystem 挂载磁盘

  • A+
所属分类:杂谈
[root@MyVPS ~]# fdisk -l (查看磁盘分区)Disk/dev/xvdb:7516 MB,7516192768 bytes
    255 heads,63 sectors/track,913 cylinders
    Units= cylinders of 16065*512=8225280 bytes

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

    Disk /dev/xvda: 10.7 GB, 10737418240 bytes
    255 heads, 63 sectors/track, 1305 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

        Device Boot      Start         End      Blocks   Id  System
    /dev/xvda1   *           1          13      104391   83  Linux
    /dev/xvda2              14        1044     8281507+  8e  Linux LVM
    /dev/xvda3            1045        1305     2096482+  8e  Linux LVM
    [root@MyVPS ~]# df -hal //*查看已划分区空间使用情况*//
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                          9.3G  1.2G  7.7G  13% /
    proc                     0     0     0   -  /proc
    sysfs                    0     0     0   -  /sys
    devpts                   0     0     0   -  /dev/pts
    /dev/xvda1             99M   29M   66M  31% /boot
    tmpfs                 151M     0  151M   0% /dev/shm
    none                     0     0     0   -  /proc/sys/fs/binfmt_misc
    sunrpc                   0     0     0   -  /var/lib/nfs/rpc_pipefs
    [root@MyVPS ~]# fdisk /dev/xvdb //*对硬盘/dev/xvdb进行增加分区操作*//
    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.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)Command(m for help): n //*输入n新建分区*//Command action
       e   extended
       p   primary partition (1-4)
    p //*输入p主分区*//Partition number (1-4):1//*输入1第一个分区*//First cylinder (1-913,default1)://*回车跳过*//Usingdefault value 1Last cylinder or+size or+sizeM or+sizeK (1-913,default913)://*回车跳过*//Usingdefault value 913Command(m for help): w //*输入W保存退出*//The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.[root@MyVPS ~]# mkfs -t ext3 /dev/xvdb1 //*将新分区xvdb1(此名称因系统而异)格式化为ext3格式*//
    mke2fs 1.39(29-May-2006)Filesystem label=
    OS type:LinuxBlock size=4096(log=2)Fragment size=4096(log=2)917504 inodes,1833410 blocks
    91670 blocks (5.00%) reserved for the super user
    First data block=0Maximum filesystem blocks=187904819256 block groups
    32768 blocks per group,32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks:32768,98304,163840,229376,294912,819200,884736,1605632Writing inode tables:doneCreating journal (32768 blocks):doneWriting superblocks and filesystem accounting information:doneThis filesystem will be automatically checked every 21 mounts or180 days, whichever comes first.Use tune2fs -c or-i to override.[root@MyVPS ~]# mount /dev/xvdb1 /home //*将新分区xvdb1挂载到目录/home*//[root@MyVPS ~]# df -hal
    FilesystemSizeUsedAvailUse%Mounted on
    /dev/mapper/VolGroup00-LogVol009.3G1.2G7.7G13%/
    proc                     000-/proc
    sysfs                    000-/sys
    devpts                   000-/dev/pts
    /dev/xvda1             99M29M66M31%/boot
    tmpfs                 151M0151M0%/dev/shm
    none                     000-/proc/sys/fs/binfmt_misc
    sunrpc                   000-/var/lib/nfs/rpc_pipefs
    /dev/xvdb1            6.9G144M6.4G3%/home
    [root@MyVPS ~]# echo "/dev/xvdb1 /home ext3 defaults 1 2">>/etc/fstab //*添加开机自动挂载*////*S4 Did For AoyoHost*//

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:1   其中:访客  1   博主  0

    • avatar 防辐射网

      哈哈,高级了,不懂