184 The Virtualization Cookbook for Red Hat Enterprise Linux 5.2
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:0
Making a file system from the logical volume
Now you have a logical volume. Use the mke2fs command to create a file system out of it. The
-j flag adds a journal so it will be of type ext3:
# mke2fs -j /dev/homevg/homelv
mke2fs 1.36 (05-Feb-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
402400 inodes, 803840 blocks
40192 blocks (5.00%) reserved for the super user
...
The file system created from the logical volume is now ready to be mounted.
13.1.5 Updating the file system table
You could now mount the file system manually. However, if you add the mount to the file
system table file, /etc/fstab, you can effectively test the change by using the mount
command with only one argument. Add one line to the file:
# cd /etc
# vi fstab
LABEL=/ / ext3 defaults 1 1
/dev/dasdb1 swap swap defaults 0 0
/dev/dasdc1 swap swap defaults 0 0
/dev/homevg/homelv /home ext3 defaults 0 0
...
Mount the /home/ file system with one argument. Use the ls command to verify that there is
no data in the logical volume except the lost+found/ directory. Use the df -h command to
verify that it is mounted.
# mount /home
# ls /home
lost+found/
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/dasda1 2.3G 1.2G 1016M 53% /
tmpfs 124M 0 124M 0% /dev/shm
/dev/mapper/homevg-homelv
9.1G 149M 8.5G 2% /home
Moving data from existing file system
You may have noticed that there may be some data in the directory which will serve as the
mount point. To complete the addition of the logical volume, we recommend that you move
any data from the existing directory to the new logical volume. First unmount the logical
volume and view the contents of the /home/ directory:
# umount /home
# ls -F /home
ldapuser1/
Komentarze do niniejszej Instrukcji