分类: LINUX
2010-06-10 15:31:39
1. The difference between Linux & Windows file system structure
They both take the hierarchy structure. For Windows, the root of the tree is the drive. But there are no drive letters in Linux, there is just one file structure. It starts with root (/) and all local file systems, all local devices, and all remote file systems are represented as subdirectories in this structure.
When Linux first boots, it builds this file structure based on information in the /etc/fstab file. Where Windows assigns drive letters to hard drive partitions and other storage devices, Linux assigns them directories in the root file structure.
In Linux, each partition is a file system, and has its own directory structure. Linux will organize the directory structure from different partition to a system global hierarchy directory structure.
2. Logical Volume Management(LVM)
Some concepts:
PP(Physical Partition): eg: harddisk partition, RAID partition.
PV(Physical Volume): it is the abstraction of PP, which maintenance PP structure information. It is the basic logical unit to organize VG. A PV corresponds to a PP generally.
PE(Physical Extends): each PV will take PE as the basic unit.
VG(Volume Group): it is the LVM volume group, which includes one or more PV. It could be treated ad LVM storage pool.
LE(Logical Extends): the basic umit of
LVM provide
Advantages:
1) the file system could span multi-disks, so the capacity will not restricted by the physical hard disk.
2) the capacity could be expanded dynamically when the system is running.
3) new disk could be added to the LVM storage pool.
4) important data could be mirrored to multi-physical disks.
5) it is convenient to export the whole VG and import to another machine.
Disadvantages:
1) when remove a disk from the VG, ‘reducevg’ must be used, or there will be problems.
2) when one disk in the volume has any problem, the whole VG will be affected.
3) the storage performance will reduce due to the extra operations.
3. What is “mount”
The term for adding a device to the file system is mounting. Linux will automatically mount a / (root) file system. There may also be a separate /boot file system, containing the core kernel boot files. Linux will also mount some special file systems. The swap space is not shown as a part of the file system, but is handled by the kernel. However, other special file systems such as proc, are seen as a normal part of the file system, and its contents can be handled just like normal files.
Other file systems, such as removable media or remote file systems, will need to be manually mounted. When mounting a file system, you will need to know the correct way to reference it from Linux, and have an empty directory to use as a mount point.
4. Useful commands
fdisk: partition table manipulator
mkfs: build a Linux file system
df: report file system disk usage
du: estimate file space usage
dd: convert and copy a file
(fdisk)
pvcreate
vgcreate
vgdisplay
lvcreate
(mkfs)