Linux Method 5

Source: Internet
Author: User

I believe many new users who want to learn linux are wondering what linux learning courses are good. The following small series will collect and organize several important tutorials for you to learn, if you want to learn more, go to the wdlinux school to find more tutorials.
LinuxMount NTFSPartitioning and attaching Methods
If your disk is in NTFS format, follow these steps to skip the next step.
First download a NTFS-3G
: Http://www.tuxera.com/community/ntfs-3g-download/
Upload the downloaded package to the root folder.

Column such as: File Name: ntfs-3g_ntfsprogs-2013.1.13.tgz


Unzip: tar zxvf ntfs-3g_ntfsprogs-2013.1.13.tgz
Go to the unzip Folder: cd ntfs-3g_ntfsprogs-2013.1.13
Run:
./Configure
Make
Make install
The installation is complete.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
View partition information: fdisk-l

For example:
[Root @ ntfs-3g_ntfsprogs-2013.1.13] # fdisk-l
Disk/dev/vda: 21.5 GB, 21474836480 bytes
16 heads, 63 sectors/track, 41610 cylinders
Units = cylinders of 1008*512 = 516096 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x000acae9

Device Boot Start End Blocks Id System
/Dev/vda1*3 409 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/Dev/vda2 409 8731 4194304 82 Linux swap/Solaris
Partition 2 does not end on cylinder boundary.
/Dev/vda3 8731 41611 16571392 83 Linux
Partition 3 does not end on cylinder boundary.

Disk/dev/vdb: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x5f72ecd9

Device Boot Start End Blocks Id System
/Dev/vdb1 1 7832 62910508 + 42 SFS (I need to mount the ntfs format partition)

Then go to/etc/fstab
Open fstab and add an automatic mounting code
/Dev/vdb1/www ntfs-3g defaults 0 0

If you are not using the ntfs format, just add the disk format.
For example:
/Dev/vdb1/www ext3 defaults 0 0

Explanation:
/Dev/vdb1 for your partition name can be viewed in the previous step
/Www to mount to a folder


LinuxFdisk of the system hard disk partitioning Tool
Fdisk is a hard disk partition tool in linux with the same principle, but the tool format is different. One is the partition when the system is installed, and the other is the partition after the system is installed.
The partitions during system installation cannot be modified or adjusted after the system is installed. Hard Disk Space Not partitioned during system installation can be operated or loaded by partitions after the system is installed.

Here we mainly talk about this situation. One is to operate unpartitioned idle hard disks or newly added hard disks.
Fdisk will be used here, but this can only be operated on a hard disk within 2 TB. If it is larger than 2 TB, it cannot be used. Another parted tool must be used.

In addition, Linux's understanding of hard disks is as follows:
/Dev/hd | sd (a | B | xxx) in this way
Hd is mainly used for IDE hard disks, which is rarely seen.
Most of them start with sd, including stata, sas, scsi, and other interface hard disks, such
Hda is the first hard disk.
Hdb is the second hard disk.
Sda is the first hard disk.
Sdb is the second hard disk.
The order here is also related to a factor, that is, the interface sequence or jumper. You should know that there is a jumper in the hard disk interface, that is, a master hard disk, etc.

The usage of fdisk is described below
Fdisk-l is the list of all hard disks, as shown below
[Root @ hnwt ~] # Fdisk-l

Disk/dev/sda: 320.0 GB, 320071851520 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065*512 = 8225280 bytes

Device Boot Start End Blocks Id System
/Dev/sda1*1 13 104391 83 Linux
/Dev/sda2 14 38913 312464250 8e Linux LVM


Fdisk/dev/sda indicates operating the hard disk. After running this operation, the interaction status of fdisk is displayed, as shown below:
[Root @ hnwt ~] # Fdisk/dev/sda

The number of cylinders for this disk is set to 38913.
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)

Command (m for help ):

Here, we will prompt you to press m, as shown in figure

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 list all supported partition types
M print this menu displays this menu
N add a new partition
O create a new empty DOS partition table
P print the partition table displays partition information
Q quit without saving changes exit and not save
S create a new empty Sun disklabel
T change a partition's system id to change the partition type
U change display/entry units
V verify the partition table
W write table to disk and exit write to partition table and exit
X extra functionality (experts only)

Command (m for help ):

All parameters are listed here.
Follow the prompts above to continue the operation, as described below:
Add Partition
1 add by n
2. Select primary/extended partitions.
3. Start value. Press enter by default.
4. Partition size value
Complete

Delete Partition
1 By d
2. Select the corresponding Partition Number and press Enter.

Change partition type
1 By t
2. Select partitions.
3. Select the partition type (list all partitions and IDS by l)
In linux, this operation is mainly required in a swap partition.

General operations, such as the three above
When all operations are completed, you can press w to save and exit
If any operation is incorrect, press q to exit.

Do not test online or production environments. Otherwise, you are solely responsible for the consequences.
You can operate the test machine or virtual machine several times.
 
 
LinuxSystem restart/Shutdown command sorting
Restart command:
1. reboot
2. shutdown-r now restarts immediately (used by the root user)
3. shutdown-r restarts automatically after 10 minutes (used by root users)
4. shutdown-r restart at (for root users)
If you use the shutdown command to set the restart, you can use the shutdown-c command to cancel the restart.


Shutdown command:
1. Shut down halt immediately
2. Power off immediately
3. shutdown-h now shut down immediately (used by the root user)
4. shutdown-h: shutdown automatically 10 minutes later
If you use the shutdown command to set shutdown, you can use the shutdown-c command to cancel the restart.
 
This tutorial is taken from the wdlinux Forum http://www.wdlinux.cn/bbs ~

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.