| /l3/users/igor-public/nt-scale-2010-03/linux10.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 |
|
|
#apt-file search ext2resize
|
|
#apt-file search ext3resize
|
|
#apt-file search resize2fs
e2fsprogs: /sbin/resize2fs e2fsprogs: /usr/share/man/man8/resize2fs.8.gz e2fsprogs-dbg: /usr/lib/debug/sbin/resize2fs manpages-fr-extra: /usr/share/man/fr/man8/resize2fs.8.gz manpages-ja: /usr/share/man/ja/man8/resize2fs.8.gz |
|
#resize2fs
resize2fs 1.41.3 (12-Oct-2008) Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [new_size] |
|
#mdadm -A /dev/md0 /dev/loop[123]
mdadm: /dev/md0 assembled from 3 drives - need all 4 to start it (use --run to insist). |
|
#mdadm -A /dev/md0 /dev/loop[1234]
mdadm: /dev/md0 has been started with 4 drives. |
|
#cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active raid5 loop1[0] loop2[3] loop3[2] loop4[1]
6291264 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
unused devices: <none>
|
|
#mount /dev/md0 /mnt
|
|
#df -h /mnt
Filesystem Size Used Avail Use% Mounted on /dev/md0 6.0G 141M 5.5G 3% /mnt |
|
#dd if=/dev/zero of=disk5.img seek=2047 bs=1024k count=1
1+0 records in 1+0 records out 1048576 bytes (1.0 MB) copied, 0.0124925 s, 83.9 MB/s |
|
#losetup /dev/loop5 disk5.img
|
|
#mdadm /dev/md0 -a /dev/loop5
mdadm: added /dev/loop5 |
|
#mdadm -G /dev/md0 --raid-devices=5
mdadm: Need to backup 768K of critical section.. mdadm: ... critical section passed. |
|
#df -h /mnt
Filesystem Size Used Avail Use% Mounted on /dev/md0 6.0G 141M 5.5G 3% /mnt |
|
#resize2fs /dev/md0
resize2fs 1.41.3 (12-Oct-2008) The filesystem is already 1572816 blocks long. Nothing to do! |
|
#df -h /mnt
Filesystem Size Used Avail Use% Mounted on /dev/md0 6.0G 141M 5.5G 3% /mnt |
|
#cat /proc/partitions
major minor #blocks name 8 0 244198584 sda 8 1 19535008 sda1 8 2 4883760 sda2 8 3 24418800 sda3 8 16 244198584 sdb 8 17 326963 sdb1 8 18 114682365 sdb2 8 19 1 sdb3 8 21 129189053 sdb5 9 0 6291264 md0 7 1 2097152 loop1 7 2 2097152 loop2 7 3 2097152 loop3 7 4 2097152 loop4 7 5 2097152 loop5 |
|
#partprobe
|
|
#cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active raid5 loop5[4] loop1[0] loop2[3] loop3[2] loop4[1]
6291264 blocks super 0.91 level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]
[======>..............] reshape = 34.5% (725952/2097088) finish=7.5min speed=3037K/sec
unused devices: <none>
|
|
#cat /proc/partitions
major minor #blocks name 8 0 244198584 sda 8 1 19535008 sda1 8 2 4883760 sda2 8 3 24418800 sda3 8 16 244198584 sdb 8 17 326963 sdb1 8 18 114682365 sdb2 8 19 1 sdb3 8 21 129189053 sdb5 9 0 6291264 md0 7 1 2097152 loop1 7 2 2097152 loop2 7 3 2097152 loop3 7 4 2097152 loop4 7 5 2097152 loop5 |
|
#date
Mon Mar 22 16:58:54 EET 2010 |
|
#fdisk /dev/sda
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. The number of cylinders for this disk is set to 30401. There is nothing wrong with that, 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 other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): m Command action a toggle a bootable flag ... Command (m for help): n No free sectors available Command (m for help): 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. |
|
#fdisk -l /dev/sda
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sda: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x722654ae Device Boot Start End Blocks Id System /dev/sda1 1 2432 19535008+ 83 Linux /dev/sda2 2433 3040 4883760 82 Linux swap / Solaris /dev/sda3 3041 6080 24418800 83 Linux /dev/sda4 6081 12160 48837600 5 Extended /dev/sda5 6081 12160 48837568+ 83 Linux |
|
#fdisk /dev/sda
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. The number of cylinders for this disk is set to 30401. There is nothing wrong with that, 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 other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders ... /dev/sda4 6081 30401 195358432+ 5 Extended /dev/sda5 6081 12160 48837568+ 83 Linux /dev/sda6 12161 18240 48837568+ 83 Linux 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. |
|
#Ðpartprobe
|
|
#cat /proc/partitions
major minor #blocks name 8 0 244198584 sda 8 1 19535008 sda1 8 2 4883760 sda2 8 3 24418800 sda3 8 4 1 sda4 8 5 48837568 sda5 8 6 48837568 sda6 8 16 244198584 sdb 8 17 326963 sdb1 8 18 114682365 sdb2 8 19 1 sdb3 8 21 129189053 sdb5 9 0 8388352 md0 7 1 2097152 loop1 7 2 2097152 loop2 7 3 2097152 loop3 7 4 2097152 loop4 7 5 2097152 loop5 |
|
#mdadm -s /dev/md0
mdadm: -s does not set the mode, and so cannot be the first option. |
|
#mdadm --stop /dev/md0
mdadm: fail to stop array /dev/md0: Device or resource busy |
|
#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) procbususb on /proc/bus/usb type usbfs (rw) 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) /dev/md0 on /mnt type ext3 (rw) |
|
#cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active raid5 loop5[4] loop1[0] loop2[3] loop3[2] loop4[1]
8388352 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]
unused devices: <none>
|
|
#resize2fs /dev/md0
resize2fs 1.41.3 (12-Oct-2008) Filesystem at /dev/md0 is mounted on /mnt; on-line resizing required old desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/md0 to 2097088 (4k) blocks. The filesystem on /dev/md0 is now 2097088 blocks long. |
|
#df -h /mnt
Filesystem Size Used Avail Use% Mounted on /dev/md0 7.9G 142M 7.4G 2% /mnt |
|
#umount /mnt
|
|
#mdadm --stop /dev/md0
mdadm: stopped /dev/md0 |
|
#fdisk -l /dev/sda
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sda: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x722654ae Device Boot Start End Blocks Id System /dev/sda1 1 2432 19535008+ 83 Linux /dev/sda2 2433 3040 4883760 82 Linux swap / Solaris /dev/sda3 3041 6080 24418800 83 Linux /dev/sda4 6081 30401 195358432+ 5 Extended /dev/sda5 6081 12160 48837568+ 83 Linux /dev/sda6 12161 18240 48837568+ 83 Linux |
|
#pvcreate /dev/sda5
Physical volume "/dev/sda5" successfully created |
|
#pvdisplay
"/dev/sda5" is a new physical volume of "46.58 GB" --- NEW Physical volume --- PV Name /dev/sda5 VG Name PV Size 46.58 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID Kuv1dh-cAk4-ofkq-uPDo-tjuw-ndtJ-jkHq8b |
|
#vgcreate DATA /dev/sda5
Volume group "DATA" successfully created |
|
#lvcreate -L 5GB -n lv1 DATA
Logical volume "lv1" created |
|
#vgdisplay
--- Volume group --- VG Name DATA System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 46.57 GB PE Size 4.00 MB Total PE 11923 Alloc PE / Size 1280 / 5.00 GB Free PE / Size 10643 / 41.57 GB VG UUID G3WPnT-gf8B-iUJh-6mIR-tlkh-YHAA-NOHFfr |
|
#lvcreate -l 1024 -n lv2 DATA
Logical volume "lv2" created |
|
#ls -l /dev/DATA/lv*
lrwxrwxrwx 1 root root 20 2010-03-22 17:18 /dev/DATA/lv1 -> /dev/mapper/DATA-lv1 lrwxrwxrwx 1 root root 20 2010-03-22 17:19 /dev/DATA/lv2 -> /dev/mapper/DATA-lv2 lrwxrwxrwx 1 root root 20 2010-03-22 17:20 /dev/DATA/lv3 -> /dev/mapper/DATA-lv3 |
|
#mkfs.ext3 /dev/DATA/lv1
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
|
|
#mkfs.ext3 /dev/DATA/lv2
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
262144 inodes, 1048576 blocks
52428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
|
|
#mkfs.ext3 /dev/DATA/lv3
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
3072 inodes, 12288 blocks
614 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=12582912
2 block groups
8192 blocks per group, 8192 fragments per group
1536 inodes per group
Superblock backups stored on blocks:
8193
Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
|
|
#mkdir -p /data/lv{1..3}
|
|
#ls /data/lv*
/data/lv1: /data/lv2: /data/lv3: |
|
#mount /dev/DATA/lv1 /data/lv1
|
|
#mount /dev/DATA/lv2 /data/lv2
|
|
#mount /dev/DATA/lv3 /data/lv3
|
|
#df -h
Filesystem Size Used Avail Use% Mounted on /dev/sda1 19G 14G 4.3G 76% / tmpfs 1.5G 0 1.5G 0% /lib/init/rw udev 10M 1.3M 8.8M 13% /dev tmpfs 1.5G 0 1.5G 0% /dev/shm /dev/mapper/DATA-lv1 5.0G 139M 4.6G 3% /data/lv1 /dev/mapper/DATA-lv2 4.0G 137M 3.7G 4% /data/lv2 /dev/mapper/DATA-lv3 12M 1.2M 10M 11% /data/lv3 |
|
#lvs -a
LV VG Attr LSize Origin Snap% Move Log Copy% Convert lv1 DATA -wi-ao 5.00G lv2 DATA -wi-ao 4.00G lv3 DATA -wi-ao 12.00M |
|
#lvresize -L2G /dev/DATA/lv3
Extending logical volume lv3 to 2.00 GB Logical volume lv3 successfully resized |
|
#resize2fs
resize2fs 1.41.3 (12-Oct-2008) Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [new_size] |
|
#resize2fs /dev/DATA/lv3 1000000
resize2fs 1.41.3 (12-Oct-2008) Filesystem at /dev/DATA/lv3 is mounted on /data/lv3; on-line resizing required old desc_blocks = 1, new_desc_blocks = 4 Performing an on-line resize of /dev/DATA/lv3 to 1000000 (1k) blocks. The filesystem on /dev/DATA/lv3 is now 1000000 blocks long. |
|
#lvresize -L1G /dev/DATA/lv3
WARNING: Reducing active and open logical volume to 1.00 GB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce lv3? [y/n]: n Logical volume lv3 NOT reduced Command failed with status code 5. |
|
#lvdisplay
--- Logical volume --- LV Name /dev/DATA/lv1 VG Name DATA LV UUID pDg4hT-DAiF-sXIq-9VDq-SEEH-4vMq-qevwGp LV Write Access read/write LV Status available # open 1 LV Size 5.00 GB Current LE 1280 Segments 1 ... LV Write Access read/write LV Status available # open 1 LV Size 2.00 GB Current LE 512 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:2 |
|
#lvdisplay | less
|
|
|