| /l3/users/igor-public/nt-scale/debian5.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 |
|
|
#pvdisplay
--- Physical volume --- PV Name /dev/md0 VG Name VG0 PV Size 4.66 GiB / not usable 260.00 KiB Allocatable yes PE Size 4.00 MiB Total PE 1192 Free PE 1192 Allocated PE 0 PV UUID EO3JYK-SH1x-FKhg-Q28x-0IEz-350u-94jgIR |
|
#vgdisplay
--- Volume group --- VG Name VG0 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 4.66 GiB PE Size 4.00 MiB Total PE 1192 Alloc PE / Size 0 / 0 Free PE / Size 1192 / 4.66 GiB VG UUID 1shb9G-HVgI-8P40-8jqi-D92G-rkmk-tnth3W |
|
#lvrename /dev/VG0/vol1 /dev/VG0/3d-games
Renamed "vol1" to "3d-games" in volume group "VG0" |
|
#lvdisplay
--- Logical volume --- LV Name /dev/VG0/3d-games VG Name VG0 LV UUID uoJDfW-wBtO-D69O-uGtF-bJ49-92ok-2T7TfO LV Write Access read/write LV Status available # open 0 LV Size 1.00 GiB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:0 |
|
#mkfs.ext3 /dev/VG0/3d-games
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
|
|
#fs
fsadm fsck.ext2 fsck.ext4dev fsck.nfs fstab-decode fsck fsck.ext3 fsck.minix fsck.vfat fstobdf fsck.cramfs fsck.ext4 fsck.msdos fslsfonts fstopgm |
|
#dpkg -L lvm2 | grep bin/fs
/sbin/fsadm |
|
#man fsadm
|
|
#fsadm --help
fsadm: Utility to resize or check the filesystem on a device
fsadm [options] check device
- Check the filesystem on device using fsck
fsadm [options] resize device [new_size[BKMGTPE]]
- Change the size of the filesystem on device to new_size
Options:
-h | --help Show this help message
-v | --verbose Be verbose
-e | --ext-offline unmount filesystem before ext2/ext3/ext4 resize
-f | --force Bypass sanity checks
-n | --dry-run Print commands without running them
-l | --lvresize Resize given device (if it is LVM device)
-y | --yes Answer "yes" at any prompts
new_size - Absolute number of filesystem blocks to be in the filesystem,
or an absolute size using a suffix (in powers of 1024).
If new_size is not supplied, the whole device is used.
|
|
#file `which fsadm `
/sbin/fsadm: Bourne-Again shell script text executable |
|
#less `which fsadm `
|
|
#lvdisplay
--- Logical volume --- LV Name /dev/VG0/3d-games VG Name VG0 LV UUID uoJDfW-wBtO-D69O-uGtF-bJ49-92ok-2T7TfO LV Write Access read/write LV Status available # open 0 LV Size 1.00 GiB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:0 |
|
#mount /dev/VG0/3d-games /mnt
|
|
#df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VG0-3d--games
1008M 34M 924M 4% /mnt
|
|
#lvextend -L 1G /dev/VG0/3d-games
New size (256 extents) matches existing size (256 extents) Run `lvextend --help' for more information. |
|
#lvextend -L +1G /dev/VG0/3d-games
Extending logical volume 3d-games to 2.00 GiB Logical volume 3d-games successfully resized |
|
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 46G 4.2G 40G 10% /
tmpfs 4.0G 0 4.0G 0% /lib/init/rw
udev 4.0G 216K 4.0G 1% /dev
tmpfs 4.0G 0 4.0G 0% /dev/shm
/dev/mapper/VG0-3d--games
1008M 34M 924M 4% /mnt
|
|
#apt-cache search ext2 resize
libparted0-dev - The GNU Parted disk partitioning library development files libparted0-i18n - The GNU Parted disk partitioning library i18n support libparted0debian1-dbg - The GNU Parted disk partitioning library debug development files libparted0debian1 - The GNU Parted disk partitioning shared library parted - The GNU Parted disk partition resizing program partitionmanager - A partition management utility |
|
#apt-cache search ext2 online
|
|
#fsadm --help
fsadm: Utility to resize or check the filesystem on a device
fsadm [options] check device
- Check the filesystem on device using fsck
fsadm [options] resize device [new_size[BKMGTPE]]
- Change the size of the filesystem on device to new_size
Options:
-h | --help Show this help message
-v | --verbose Be verbose
-e | --ext-offline unmount filesystem before ext2/ext3/ext4 resize
-f | --force Bypass sanity checks
-n | --dry-run Print commands without running them
-l | --lvresize Resize given device (if it is LVM device)
-y | --yes Answer "yes" at any prompts
new_size - Absolute number of filesystem blocks to be in the filesystem,
or an absolute size using a suffix (in powers of 1024).
If new_size is not supplied, the whole device is used.
|
|
#fsadm -l /dev/VG0/3d-games
fsadm: Wrong argument "/dev/VG0/3d-games". (see: fsadm --help) |
|
#apt-cache search ext2
libattr1-dev - Extended attribute static libraries and headers autopsy - graphical interface to SleuthKit awesfx - utility programs for AWE32/64 and Emu10k1 driver dump - 4.4bsd dump and restore for ext2 filesystems e2fsck-static - statically-linked version of the ext2/ext3/ext4 filesystem checker e2fslibs-dbg - debugging information for e2fslibs e2fslibs-dev - ext2/ext3/ext4 file system libraries - headers and static libraries e2fslibs - ext2/ext3/ext4 file system libraries e2fsprogs - ext2/ext3/ext4 file system utilities e2tools - utilities for manipulating files in an ext2/ext3 filesystem ... scalpel - A Frugal, High Performance File Carver syslinux-themes-debian-lenny - collection of boot loaders (debian-lenny theme) syslinux-themes-debian-squeeze - collection of boot loaders (debian-squeeze theme) syslinux-themes-debian - collection of boot loaders (theme metapackage) extlinux - collection of boot loaders (ext2/3/4 and btrfs bootloader) syslinux-common - collection of boot loaders (common files) syslinux - collection of boot loaders testdisk - Partition scanner and disk recovery tool vdr-plugin-skinenigmang - Skin plugin for VDR zerofree - zero free blocks from ext2/3 file-systems |
|
#apt-get install e2fsprogs
Reading package lists... Done Building dependency tree Reading state information... Done e2fsprogs is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
|
#resize2fs /dev/VG0/3d-games
resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/VG0/3d-games is mounted on /mnt; on-line resizing required old desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/VG0/3d-games to 524288 (4k) blocks. The filesystem on /dev/VG0/3d-games is now 524288 blocks long. |
|
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 46G 4.2G 40G 10% /
tmpfs 4.0G 0 4.0G 0% /lib/init/rw
udev 4.0G 216K 4.0G 1% /dev
tmpfs 4.0G 0 4.0G 0% /dev/shm
/dev/mapper/VG0-3d--games
2.0G 34M 1.9G 2% /mnt
|
|
#lvextend -L +1G /dev/VG0/3d-games
Extending logical volume 3d-games to 3.00 GiB Logical volume 3d-games successfully resized |
|
#fsadm resize /dev/VG0/3d-games
resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/dm-0 is mounted on /mnt; on-line resizing required old desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/dm-0 to 786432 (4k) blocks. The filesystem on /dev/dm-0 is now 786432 blocks long. |
|
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 46G 4.2G 40G 10% /
tmpfs 4.0G 0 4.0G 0% /lib/init/rw
udev 4.0G 216K 4.0G 1% /dev
tmpfs 4.0G 0 4.0G 0% /dev/shm
/dev/mapper/VG0-3d--games
3.0G 34M 2.8G 2% /mnt
|
|
#cfdisk /dev/sda
|
|
#cfdisk /dev/sda
|
|
#partprobe
|
|
#ls -l /dev/sda7
brw-rw---- 1 root disk 8, 7 Feb 21 15:00 /dev/sda7 |
|
#pvcreate /dev/sda7
Physical volume "/dev/sda7" successfully created |
|
#vgextend /dev/VG0 /dev/sda7
Volume group "VG0" successfully extended |
|
#vgdisplay
--- Volume group --- VG Name VG0 System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 6 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 2 Act PV 2 VG Size 9.31 GiB PE Size 4.00 MiB Total PE 2384 Alloc PE / Size 768 / 3.00 GiB Free PE / Size 1616 / 6.31 GiB VG UUID 1shb9G-HVgI-8P40-8jqi-D92G-rkmk-tnth3W |
|
#lvcreate -L 8G -n ddd /dev/VG0
Insufficient free extents (1616) in volume group VG0: 2048 required |
|
#lvcreate -L5G -n ddd /dev/VG0
Logical volume "ddd" created |
|
#lvremove /dev/VG0/ddd
Do you really want to remove active logical volume ddd? [y/n]: y Logical volume "ddd" successfully removed |
|
#pvmove /dev/sda7
No data to move for VG0 |
|
#lvcreate -L1G -n ddd /dev/VG0
Logical volume "ddd" created |
|
#mkfs.ext3 /dev/VG0/ddd
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
|
|
#pvmove /dev/md0
/dev/md0: Moved: 0.1% /dev/md0: Moved: 8.8% /dev/md0: Moved: 17.5% /dev/md0: Moved: 26.1% /dev/md0: Moved: 34.7% /dev/md0: Moved: 43.3% /dev/md0: Moved: 52.0% /dev/md0: Moved: 60.5% /dev/md0: Moved: 69.0% /dev/md0: Moved: 75.0% /dev/md0: Moved: 83.8% /dev/md0: Moved: 92.4% /dev/md0: Moved: 100.0% |
|
#pvmove /dev/sda7
/dev/sda7: Moved: 0.1% /dev/sda7: Moved: 8.7% /dev/sda7: Moved: 17.4% /dev/sda7: Moved: 25.9% /dev/sda7: Moved: 34.5% /dev/sda7: Moved: 43.2% /dev/sda7: Moved: 51.8% ^[[A^[[ /dev/sda7: Moved: 60.4% /dev/sda7: Moved: 68.9% /dev/sda7: Moved: 75.0% /dev/sda7: Moved: 83.7% /dev/sda7: Moved: 92.5% /dev/sda7: Moved: 100.0% |
|
#vgreduce /dev/VG0
Please enter physical volume paths or option -a Run `vgreduce --help' for more information. |
|
#vgreduce /dev/VG0 /dev/sda7
Removed "/dev/sda7" from volume group "VG0" |
|
#lvremove /dev/VG0/ddd
Do you really want to remove active logical volume ddd? [y/n]: y Logical volume "ddd" successfully removed |
|
#lvdisplay
--- Logical volume --- LV Name /dev/VG0/3d-games VG Name VG0 LV UUID uoJDfW-wBtO-D69O-uGtF-bJ49-92ok-2T7TfO LV Write Access read/write LV Status available # open 1 LV Size 3.00 GiB Current LE 768 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:0 |
|
#lvrename /dev/VG0/3d-games /dev/VG0/vol1
Renamed "3d-games" to "vol1" in volume group "VG0" |
|
#lvcreate -L 100M -n snap1 -s /dev/VG0/vol1
Logical volume "snap1" created |
|
#lvs -a
LV VG Attr LSize Origin Snap% Move Log Copy% Convert snap1 VG0 swi-a- 100.00m vol1 0.01 vol1 VG0 owi-ao 3.00g |
|
#mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro) tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) fusectl on /sys/fs/fuse/connections type fusectl (rw) /dev/mapper/VG0-3d--games on /mnt type ext3 (rw) |
|
#umount /mnt
|
|
#lvs -a
LV VG Attr LSize Origin Snap% Move Log Copy% Convert snap1 VG0 swi-a- 100.00m vol1 0.01 vol1 VG0 owi-a- 3.00g |
|
#mount /dev/VG0/vol1 /mnt
|
|
#touch /mnt/XXX
|
|
#umount /mnt
|
|
#mount /dev/VG0/snap1 /mnt
|
|
#ls /mnt
lost+found |
|
#umount /mnt
|
|
#mount /dev/VG0/vol1 /mnt
|
|
#lvcreate -L 100M -n snap1 -s /dev/VG0/vol1
Logical volume "snap1" created |
|
#lvcreate -L 100M -n snap1 -s /dev/VG0/vol1
2
Logical volume "snap2" created
|
|
#lvcreate -L 100M -n snap2 -s /dev/VG0/vol1
3
Logical volume "snap3" created
|
|
#lvcreate -L 100M -n snap4 -s /dev/VG0/vol1
Logical volume "snap4" created |
|
#lvremove /dev/VG0/snap1
Do you really want to remove active logical volume snap1? [y/n]: y Logical volume "snap1" successfully removed |
|
#lvremove /dev/VG0/snap2
Do you really want to remove active logical volume snap2? [y/n]: y Logical volume "snap2" successfully removed |
|
#lvs -a
LV VG Attr LSize Origin Snap% Move Log Copy% Convert snap3 VG0 swi-a- 100.00m vol1 60.49 snap4 VG0 swi-a- 100.00m vol1 60.49 vol1 VG0 owi-ao 3.00g |
|
#lvremove /dev/VG0/snap3
Do you really want to remove active logical volume snap3? [y/n]: y Logical volume "snap3" successfully removed |
|
#lvremove /dev/VG0/snap3
s -a
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
snap4 VG0 swi-a- 100.00m vol1 80.64
vol1 VG0 owi-ao 3.00g
|
|
#lvremove /dev/VG0/snap3
|
|
#lvs -a
/dev/dm-8: read failed after 0 of 4096 at 0: Input/output error LV VG Attr LSize Origin Snap% Move Log Copy% Convert snap4 VG0 Swi-I- 100.00m vol1 100.00 vol1 VG0 owi-ao 3.00g |
|
#umount /mnt
|
|
#mount /dev/VG0/snap4 /mnt
mount: /dev/mapper/VG0-snap4: can't read superblock |
|
#lvremove /dev/VG0/snap4
/dev/dm-8: read failed after 0 of 4096 at 0: Input/output error Do you really want to remove active logical volume snap4? [y/n]: y Logical volume "snap4" successfully removed |
|
#mount /dev/VG0/snap4 /mnt
mount: special device /dev/VG0/snap4 does not exist |
|
#mount /dev/VG0/vol1 /mnt
|
|
#apt-cache search system-config-lvm
system-config-lvm - A utility for graphically configuring Logical Volumes |
|
|