Add hard disk to linuxvm

Source: Internet
Author: User
Article Title: Add a hard disk to linuxvm. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Shut down the Virtual Machine and load a hard disk.

Fdisk-l found that the newly loaded hard disk is sdc, that is, the third hard disk.

Fdisk/dev/sdc

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 2349.

There is nothing wrong with that, but this is larger than 1024,

And coshould in certain setups cause problems:

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): 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)

E

Partition number (1-4): 1

First cylinder (1-2349, default 1 ):

Using default value 1

Last cylinder or + size or + sizeM or + sizeK (1-2349, default 2349 ):

Using default value 2349

Command (m for help): w

The partition table has been altered!

Calling ioctl () to re-read partition table.

Syncing disks.

[Root @ qa ~] # Mkfs-t ext3-c/dev/sdc1

Mke2fs 1.39 (29-may-2006)

/Dev/sdc1: Invalid argument passed to ext2 library while setting up superblock

This is expected. The extended partition is added when the partition is created. The extended partition cannot be directly formatted. You need to divide the extended partition into logical partitions.

What are the differences between primary partitions, extended partitions, and logical partitions? What is the relationship? Where are they used?

1. Each hard disk has a primary partition table, each of which represents a primary partition and defines a continuous space on the hard disk,

The primary partition can be of various types, such as fat, linux ext2, fat32, and ntfs.

2. A primary partition table has a limit of up to four partitions, so there is an extended partition:

This is a special primary partition, which cannot be used directly, but is like a pointer pointing to an extended partition table.

Each hard disk can have only one extended partition.

3. The partition defined in the extended partition table is called a logical partition. Its function is similar to that of the primary partition,

But it is limited to the size range defined by the extended partition.

[1] [2] Next page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.