Linux Mount Storage Method

Source: Internet
Author: User

Application of virtual machine due to total downtime, after processing the allocation of more than my 100G space, or hard to pay attention to the well, Mount method is as follows:

Initial disk mount Condition:
[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda2 19G 9.0G 9.1G 50%/
/DEV/SDA4 44G 181M 41G 1%/u01
/DEV/SDA1 99M 22M 73M 23%/boot
Tmpfs 4.0G 0 4.0G 0%/dev/shm

To view disks:
[Email protected] ~]# fdisk-l
disk/dev/sda:85.8 GB, 85899345920 bytes
255 heads, Sectors/track, 10443 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 104391 Linux
/dev/sda2 2563 20482875 Linux
/dev/sda3 2564 4603 16386300, Linux Swap/solaris
/DEV/SDA4 4604 10443 46909800-up Linux
disk/dev/sdb:107.3 GB, 107374182400 bytes
255 heads, Sectors/track, 13054 cylinders
Units = Cylinders of 16065 * 8225280 bytes


To partition a disk with Fdisk:
[Email protected] ~]# Fdisk/dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF Disklabel
Building a new DOS disklabel. Changes'll remain in memory only,
Until decide to write them. After that, of course, the previous
Content won ' t be recoverable.

The number of cylinders for this disk was set to 13054.
There is nothing wrong with the, but this is larger than 1024,
And could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from the other OSs
(e.g., DOS fdisk, OS/2 fdisk)
Warning:invalid flag 0x0000 of partition Table 4 would be a corrected by W (rite)
Command (M for help): P
disk/dev/sdb:107.3 GB, 107374182400 bytes
255 heads, Sectors/track, 13054 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
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)
P
Partition number (1-4): 1
First cylinder (1-13054, default 1):
Using Default value 1
Last cylinder or +size or +sizem or +sizek (1-13054, default 13054):
Using Default Value 13054
Command (M for help): P
disk/dev/sdb:107.3 GB, 107374182400 bytes
255 heads, Sectors/track, 13054 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDB1 1 13054 104856223+ Linux
Command (M for help): W
The partition table has been altered!
Calling IOCTL () to re-read partition table.
Syncing disks.

View disk again:
[[[email protected] ~]# fdisk-l
disk/dev/sda:85.8 GB, 85899345920 bytes
255 heads, sectors/ Track, 10443 cylinders
Units = cylinders of 16065 * mb = 8225280 bytes
Device Boot Start End Blocks Id System
/ DEV/SDA1 * 1 104391 for Linux
/dev/sda2 2563 20482875, Linux
/dev/sda3 2564 4603 16386300. Linux Swap/sol Aris
/dev/sda4 4604 10443 46909800 Linux
disk/dev/sdb:107.3 GB, 107374182400 bytes
255 heads, Sectors/tra CK, 13054 cylinders
Units = cylinders of 16065 * mb = 8225280 bytes
Device Boot Start End Blocks Id System
/dev /SDB1 1 13054 104856223+ Linux


To format a disk:
[Email protected] ~]# mkfs-t EXT3/DEV/SDB1
MKE2FS 1.39 (29-may-2006)
Filesystem label=
OS Type:linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
13107200 inodes, 26214055 blocks
1310702 blocks (5.00%) reserved for the Super user
First Data block=0
Maximum filesystem blocks=4294967296
Block groups
32768 blocks per group, 32768 fragments per group
16384 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 filesystem accounting Information:done
This filesystem'll be automatically checked every mounts or
Whichever comes first. Use Tune2fs-c or-i to override.


Mount Disk:
[Email protected] ~]# mount/dev/sdb1/u01/

[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda2 19G 9.0G 9.1G 50%/
/DEV/SDA4 99G 188M 94G 1%/u01
/DEV/SDA1 99M 22M 73M 23%/boot
Tmpfs 4.0G 0 4.0G 0%/dev/shm
/DEV/SDB1 99G 188M 94G 1%/u01

Set up auto-mount on boot:
[Email protected] ~]# Vi/etc/fstab
/dev/sdb1/u01 ext3 defaults 0 0

Linux Mount Storage Method

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.