Журнал лабораторных работ

Содержание

Журнал

Понедельник (03/22/10)

/dev/pts/6
15:35:00
#apt-file search ext2online

15:35:08
#apt-file search ext2resize

15:35:13
#apt-file search ext3resize

15:35:17
#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
15:35:50
#resize2fs
resize2fs 1.41.3 (12-Oct-2008)
Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [new_size]
15:35:59
#mdadm -A /dev/md0 /dev/loop[123]
mdadm: /dev/md0 assembled from 3 drives - need all 4 to start it (use --run to insist).
15:36:41
#mdadm -A /dev/md0 /dev/loop[1234]
mdadm: /dev/md0 has been started with 4 drives.
15:36:47
#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>
15:37:34
#mount /dev/md0 /mnt

15:37:36
#df -h /mnt
Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              6.0G  141M  5.5G   3% /mnt
15:37:38
#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
15:37:48
#losetup /dev/loop5 disk5.img

15:38:01
#mdadm /dev/md0 -a /dev/loop5
mdadm: added /dev/loop5
15:38:18
#mdadm -G /dev/md0 --raid-devices=5
mdadm: Need to backup 768K of critical section..
mdadm: ... critical section passed.
15:38:28
#df -h /mnt
Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              6.0G  141M  5.5G   3% /mnt
15:38:40
#resize2fs /dev/md0
resize2fs 1.41.3 (12-Oct-2008)
The filesystem is already 1572816 blocks long.  Nothing to do!
15:39:15
#df -h /mnt
Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              6.0G  141M  5.5G   3% /mnt
15:39:19
#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
15:39:40
#partprobe

15:40:55
#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>
15:40:59
#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
15:41:16
#date
Mon Mar 22 16:58:54 EET 2010
прошло 17 минут
15:58:54
#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.
16:05:39
#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
16:06:25
#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.
16:09:10
#Ðpartprobe

16:10:53
#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
16:10:58
#mdadm -s /dev/md0
mdadm: -s does not set the mode, and so cannot be the first option.
16:11:10
#mdadm --stop /dev/md0
mdadm: fail to stop array /dev/md0: Device or resource busy
16:11:15
#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)
16:11:20
#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>
16:11:27
#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.
16:11:51
#df -h /mnt
Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              7.9G  142M  7.4G   2% /mnt
16:11:56
#umount /mnt

16:12:06
#mdadm --stop /dev/md0
mdadm: stopped /dev/md0
16:12:15
#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
16:12:29
#pvcreate /dev/sda5
  Physical volume "/dev/sda5" successfully created
16:13:23
#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
16:13:41
#vgcreate DATA /dev/sda5
  Volume group "DATA" successfully created
16:16:21
#lvcreate -L 5GB -n lv1 DATA
  Logical volume "lv1" created
16:18:36
#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
16:19:06
#lvcreate -l 1024 -n lv2 DATA
  Logical volume "lv2" created
16:20:01
#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
16:21:41
#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.
16:22:48
#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.
16:22:54
#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.
16:22:55
#mkdir -p /data/lv{1..3}

16:23:13
#ls /data/lv*
/data/lv1:
/data/lv2:
/data/lv3:
16:23:16
#mount /dev/DATA/lv1 /data/lv1

16:23:25
#mount /dev/DATA/lv2 /data/lv2

16:23:28
#mount /dev/DATA/lv3 /data/lv3

16:23:30
#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
16:23:34
#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
16:25:30
#lvresize -L2G /dev/DATA/lv3
  Extending logical volume lv3 to 2.00 GB
  Logical volume lv3 successfully resized
16:27:35
#resize2fs
resize2fs 1.41.3 (12-Oct-2008)
Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [new_size]
16:32:56
#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.
16:33:25
#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.

Вторник (03/23/10)

/dev/pts/0
08:38:45
#screen -x
/dev/pts/2
08:39:57
#screen -x
/dev/pts/4
08:40:32
#screen -x
/dev/pts/6
08:41:38
#screen -x
/dev/pts/8
08:41:48
#screen -x
/dev/pts/10
08:41:50
#screen -x
/dev/pts/14
08:41:52
#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
08:42:35
#lvdisplay | less
08:43:24