LFS study notes (a)

Use the host environment: Linux fedora15-64 2.6.43.8-1.fc15.x86_64 # 1 SMP Mon Jun 4 20:33:44 UTC 2012 x86_64 x86_64 x86_64 GNU / Linux

LFS version: Linux From Scratch - Version 7.2

In a new virtual machine virtual disk / dev / sdb as lfs installation disk and create new disk and swap partitions, follow these steps:

First, create a new virtual hard disk

Open VMware, select the menu "VM" -----> settings ----> "Add" -----> "Next" ----> select "Harddisk", "Next" - -> choose "creat a new virtual disk" point "Next" -----> choose "SCSI" point "Next" ------> input you want to build a virtual hard disk size, click " Next "------> input you want to build a virtual hard disk name, click" Finish. "

Up to now, we have created a new virtual hard disk.

However, the newly created virtual hard disk can not be used. Also you need to go through the following steps.

Second, partition

   After landing system, view the partition using fdisk -l, we see that / dev / sdb is no valid partition table.

So here we need to partition it.

 

Use the command fdisk / dev / sdb, partition it, a prompt, I enter "m", a look at the help.

   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)

 

Is the meaning of all the parameters as shown above.

 

Input image above "p", the current partition table.

 

Figure above, an input "n", to add a new partition.

 

Enter "p", choose to create a primary partition, because the establishment of the first partition, so enter "1", if the establishment is the second partition, then enter "2", and so on.

Two partitions, one of which is a swap, swap is achieved by modifying the system id t-command, as shown in FIG.

Device Boot      Start         End      Blocks   Id  System

/dev/sdb1            2048    20000000     9998976+  83  Linux

/dev/sdb2        20000001    20971519      485759+  82  Linux swap / Solaris

 

Enter "p", print the partition table to the screen, and then enter the "w", write the partition table.

 

Enter fdisk -l to check the partitions.

Third, format the new partition

The new partition needs to be formatted before use.

 

Formatting commands: mkfs.ext3 / dev / sdb1 is formatted into ext3

                      mkfs.ext2 / dev / sdb1 is formatted into ext2

I used here mkfs.ext3.

 

    Check disk space usage, and did not find the newly added virtual hard disk space.

This is because the need to mount the new virtual hard disk.

Fourth, mount the new virtual hard disk

 

As shown above, we must first create a folder in the root directory, I created a file named xh folder.

 

Use the command mount dev / sdb1 xh

The dev / sdb1 mount under xh, then you can use this virtual hard drive.

 

As shown above, after rebooting the computer and found to mount a new virtual hard disk can not see, and run the command again mentioned above in the following figure.

 

I looked new virtual hard disk, but this is too inconvenient, you can let the system automatically load new virtual hard disk at startup by modifying the / etc / fstab file.

Open the / etc / fstab file, add a line in there: / dev / sdb1 / xh ext3 defaults 1 2

Save and exit.

Restart, then run df -h, see.

Guess you like

Origin blog.csdn.net/xiebingsuccess/article/details/91859486