Suse11 to create a partition, and set the boot mount automatically

Source: Internet
Author: User

Step (1) To view the status and usage of the current disk:

linux:~ # fdisk–l

disk/dev/sda:2000.4 GB, 2000398934016bytes

255 heads, Sectors/track, 243201cylinders

Units = Cylinders of 16065 * 8225280bytes

Disk identifier:0x0001fa9a

Device Boot Start End Blocks Id System

/DEV/SDA1 * 1 26108 209712478+ Linux

/dev/sda2 26109 30285 33551752+ Linux Swap/solaris

linux:~ # df-h

FileSystem Size Used Avail use% mounted on

/DEV/SDA1 197G 18G 170G 10%/

Devtmpfs 118G 120K 118G 1%/dev

Tmpfs 64G 176K 64G 1%/DEV/SHM

Step (2) below a 100G partition on the/DEV/SDA:

linux:~ # FDISK/DEV/SDA

The number of cylinders for this disk isset to 243201.

There is no wrong with that, but thisis larger than 1024,

And could in certain setups cause Problemswith:

1 software that runs in boot time (e.g.,old versions of LILO)

2) booting and partitioning software fromother OSs

(e.g., DOS fdisk, OS/2 fdisk)

Command (M for help): n--Create a new partition

Command Action

E Extended

P primary partition (1-4)

p--create partition type, E: Extended partition, P: Primary partition

Partition number (1-4): 3--partition No.

Cylinder (30286-243201, default30286): --' carriage return ' defaults

Using Default Value 30286

Last cylinder, +cylinders or +size{k,m,g} (30286-243201, default 243201): +100gb--Specifies the partition size (the point ' enter ' is created after the success)

Command (M for help): p--Print the partition table to see the newly created partition

disk/dev/sda:2000.4 GB, 2000398934016bytes

255 heads, Sectors/track, 243201cylinders

Units = Cylinders of 16065 * 8225280bytes

Disk identifier:0x0001fa9a

Device Boot Start End Blocks Id System

/DEV/SDA1 * 1 26108 209712478+ Linux

/dev/sda2 26109 30285 33551752+ Linux Swap/solaris

/dev/sda3 30286 42444 97667167+ Linux

Command (M for help): w--Write partition table and exit

linux:~ # fdisk-l

disk/dev/sda:2000.4 GB, 2000398934016bytes

255 heads, Sectors/track, 243201cylinders

Units = Cylinders of 16065 * 8225280bytes

Disk identifier:0x0001fa9a

Device Boot Start End Blocks Id System

/DEV/SDA1 * 1 26108 209712478+ Linux

/dev/sda2 26109 30285 33551752+ Linux Swap/solaris

/dev/sda3 30286 42444 97667167+ linux--created successfully

add: If you have already created four primary partitions, then the partition will have the following prompts:

Command (M for help): N

youmust Delete some partition and add an extended partition

This requires that you first delete a primary partition, and then create an extended partition, which is a place to note that if you are creating a primary partition that is larger than four when you create a partition plan, you will need to create an extended partition to meet your planning needs when you create three primary partitions.

Step (3) format the partition and Mount it

Follow the steps (2) to create the following format:

linux:~ # Mkfs.ext3/dev/sda3

MKE2FS 1.41.9 (22-aug-2009)

Could not stat/dev/sda3---No such fileor directory

The device apparently does not exist; Didyou Specify it correctly?

An error has been made. There are two solutions to this problem: restarting or not rebooting-using the Partprobe command, and of course the Partprobe command, to successfully format the partition as a ext3 file system after executing the following command

linux:~ # Partprobe

linux:~ # Mkfs.ext3/dev/sda3

FileSystem label=

OS Type:linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

6111232 inodes, 24416791 blocks

1220839 blocks (5.00%) reserved for thesuper user

The Data block=0

Maximum filesystem blocks=4294967296

746 block groups

32768 blocks per group, 32768 fragments Pergroup

8192 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872

Writing Inode Tables:done

Creating journal (32768 blocks): Done

Writing superblocks and Filesystemaccounting Information:done

This filesystem would be automaticallychecked every mounts or

180 days, whichever comes. Use Tune2fs-c or-i to override.

all goes well, the following can be mounted:

linux:/# mkdir MYNEWPT

linux:/# MOUNT/DEV/SDA3/MYNEWPT

linux:/# df-h

FileSystem Size Used Avail use% mounted on

/DEV/SDA1 197G 18G 170G 10%/

Devtmpfs 118G 124K 118G 1%/dev

Tmpfs 64G 176K 64G 1%/DEV/SHM

/dev/sda3 92G 188M 87G 1%/mynewpt--Successful, partition complete

Step (4) very simple, oh, do not worry, there is a final need to improve the place. According to the above operation, the disk is divided, but if you restart the system, you will find that/dev/sda3 did not mount automatically, this is cumbersome, each need to manually execute Mount command to mount. If you need to start an automatic mount, you only need to modify the configuration file:

linux:/# vi/etc/fstab--Add the following line: /dev/sda3/mynewpt ext3 defaults 0 0

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.