zoukankan      html  css  js  c++  java
  • [quote] Using RAW Devices In VirtualBox VMs

    Original URL

    http://www.howtoforge.com/using-raw-devices-in-virtualbox-vms-p2

    How to access a second .vdi image created in virtualbox stoage tab.

    Disk /dev/sdb: 5368 MB, 5368709120 bytes
    255 heads, 63 sectors/track, 652 cylinders, total 10485760 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: 0x00000000

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

    You can now use this drive as you would normally do, e.g. partition it...

    fdisk /dev/sdb

    root@vm10:~# 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 0x862fb2cf.
    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
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p):
     <-- p
    Partition number (1-4, default 1): <-- 1
    First sector (2048-10485759, default 2048): <-- ENTER
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759):
     <-- ENTER
    Using default value 10485759

    Command (m for help):
     <-- t
    Selected partition 1
    Hex code (type L to list codes):
     <-- 83

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

    Calling ioctl() to re-read partition table.
    Syncing disks.
    root@vm10:~#

    ... create a file system on it (e.g. ext4)...

    mkfs.ext4 /dev/sdb1

    ... and mount it:

    mount /dev/sdb1 /mnt

  • 相关阅读:
    hdu 5007 水题 (2014西安网赛A题)
    hdu 1698 线段树(成段替换 区间求和)
    poj 3468 线段树 成段增减 区间求和
    hdu 2795 公告板 (单点最值)
    UVaLive 6833 Miscalculation (表达式计算)
    UVaLive 6832 Bit String Reordering (模拟)
    CodeForces 124C Prime Permutation (数论+贪心)
    SPOJ BALNUM (数位DP)
    CodeForces 628D Magic Numbers (数位DP)
    POJ 3252 Round Numbers (数位DP)
  • 原文地址:https://www.cnblogs.com/lake-of-embedded-system/p/3644074.html
Copyright © 2011-2022 走看看