Linux File System

Source: Internet
Author: User

The linux version is

[Root @ hzmc ~] # Uname-

Linux hzmc 2.6.18-53. el5xen #1 SMP Mon Nov 12 03:26:12 EST 2007 i686 i686 i386 GNU/Linux

1. Check the hard disk partition of the host. We need to divide the file system in/dev/sdb, And the size is about 80 GB.

[Root @ hzmc bin] # fdisk-l

Disk/dev/sda: 154.7 GB, 154750418432 bytes

255 heads, 63 sectors/track, 18814 cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Device Boot Start End Blocks Id System

/Dev/sda1*1 255 2048256 83 Linux

/Dev/sda2 256 5992 46082452 + 83 Linux

/Dev/sda3 5993 8542 20482875 83 Linux

/Dev/sda4 8543 18814 82509840 5 Extended

/Dev/sda5 8543 11092 20482843 + 83 Linux

/Dev/sda6 11093 12367 10241406 83 Linux

/Dev/sda7 12368 13642 10241406 83 Linux

/Dev/sda8 13643 14662 8193118 + 83 Linux

/Dev/sda9 14663 15044 3068383 + 83 Linux

/Dev/sda10 15045 15426 3068383 + 83 Linux

/Dev/sda11 15427 15808 3068383 + 83 Linux

/Dev/sda12 15809 16063 2048256 82 Linux swap/Solaris

/Dev/sda13 16064 16254 1534176 83 Linux

/Dev/sda14 16255 16267 104391 83 Linux

/Dev/sda15 16268 18814 20458746 8e Linux LVM

Disk/dev/sdb: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Device Boot Start End Blocks Id System

/Dev/sdb1 1 2433 19543041 83 Linux

/Dev/sdb2 2434 3679 10008495 83 Linux

/Dev/sdb3 3680 3804 1004062 + 83 Linux

/Dev/sdb4 3805 60801 457828402 + 5 Extended

/Dev/sdb5 3805 7452 29302528 + 83 Linux

/Dev/sdb6 7453 7577 1004031 83 Linux

2. Divide the file system on/dev/sdb

[Root @ hzmc bin] # fdisk/dev/sdb

The number of cylinders for this disk is set to 60801.

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

First cylinder (7578-60801, default 7578 ):

Using default value 7578

Last cylinder or + size or + sizeM or + sizeK (7578-60801, default 60801): + 81920 M

Command (m for help): w

The partition table has been altered!

Calling ioctl () to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

Note that the system prompts "Device or resource busy.". When this prompt is displayed, you must manually notify the operating system that the partition table has been changed.

[Root @ hzmc bin] # partprobe/dev/sdb

3. Format/dev/sdb7 into an ext3 file system.

[Root @ hzmc bin] # mkfs-t ext3/dev/sdb7

Mke2fs 1.39 (29-may-2006)

Filesystem label =

OS type: Linux

Block size = 4096 (log = 2)

Fragment size = 4096 (log = 2)

10010624 inodes, 20002925 blocks

1000146 blocks (5.00%) reserved for the super user

First data block = 0

Maximum filesystem blocks = 0

611 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768,983 04, 163840,229 376, 294912,819 200, 884736,160 5632, 2654208,

4096000,796 11239424

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 23 mounts or

180 days, whichever comes first. Use tune2fs-c or-I to override.

You have new mail in/var/spool/mail/root

[Root @ hzmc bin] # mkdir/siqi

[Root @ hzmc bin] # mount/dev/sdb7/siqi

4. Add the file system information to the fstab file.

/Dev/sdb7/siqi ext3 defaults 0 0

Here, pay attention to the numerical meanings of columns 4, 5, and 6.

The 4th column uses the default options that are rw, suid, dev, exec, auto, nouser, and async.

The 5th column in/etc/fstab is the dump option. dump checks it and uses the number to decide if a filesystem shocould be backed up. if it's zero, dump will ignore that filesystem. if you take a look at the example fstab, you'll notice that the 5th column is zero in most cases.

The 6th column is a fsck option. fsck looks at the number in the 6th column to determine in which order the filesystems shoshould be checked. if it's zero, fsck won't check the filesystem.
 

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.