/l3/users/eb/2009/linux4/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 :23 :24 :25 :26 :27 :28 |
|
#mount
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) rootfs on / type rootfs (rw) /dev/sdb1 on /mnt type ext3 (rw) |
#echo `;` | sfdisk /dev/sda
bash: command substitution: line 1: syntax error near unexpected token `;' bash: command substitution: line 1: `;' Checking that no-one is using this disk right now ... OK Disk /dev/sda: 10011 cylinders, 255 heads, 63 sectors/track Old situation: Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 * 0+ 10010 10011- 80413326 7 HPFS/NTFS /dev/sda2 0 - 0 0 0 Empty /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty New situation: No partitions found sfdisk: no partition table present. |
#echo `;` | sfdisk /dev/sda1
bash: command substitution: line 1: syntax error near unexpected token `;' bash: command substitution: line 1: `;' Checking that no-one is using this disk right now ... BLKRRPART: Invalid argument OK Warning: start=63 - this looks like a partition rather than the entire disk. Using fdisk on it is probably meaningless. [Use the --force option if you really want this] bash: echo: write error: Broken pipe |
#echo `;` | sfdisk /dev/sda
bash: command substitution: line 1: syntax error near unexpected token `;' bash: command substitution: line 1: `;' Checking that no-one is using this disk right now ... OK Disk /dev/sda: 10011 cylinders, 255 heads, 63 sectors/track Old situation: Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 * 0+ 10010 10011- 80413326 7 HPFS/NTFS /dev/sda2 0 - 0 0 0 Empty /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty New situation: No partitions found sfdisk: no partition table present. |
#fdisk
Usage: fdisk [-l] [-b SSZ] [-u] device E.g.: fdisk /dev/hda (for the first IDE disk) or: fdisk /dev/sdc (for the third SCSI disk) or: fdisk /dev/eda (for the first PS/2 ESDI drive) or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices) ... |
#fdisk /dev/sda
The number of cylinders for this disk is set to 10011. 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 b edit bsd disklabel ... 11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f0 Linux/PA-RISC b 12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f1 SpeedStor 14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f4 SpeedStor 16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot f2 DOS secondary 17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fd Linux raid auto 18 AST SmartSleep 65 Novell Netware b8 BSDI swap fe LANstep 1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid ff BBT 1c Hidden W95 FAT3 75 PC/IX Command (m for help): Command (m for help): ^C |
#fdisk /dev/sda
The number of cylinders for this disk is set to 10011. 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 b edit bsd disklabel ... v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): d Selected partition 1 Command (m for help): n Command action e extended p primary partition (1-4) ^C |
#fdiosk -l
bash: fdiosk: command not found |
#fdisk -l
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 * 1 10011 80413326 7 HPFS/NTFS Disk /dev/sdb: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xbc351890 Device Boot Start End Blocks Id System /dev/sdb1 * 1 2432 19535008+ 83 Linux |
#echo ';' | sfdisk /dev/sda
Checking that no-one is using this disk right now ... OK Disk /dev/sda: 10011 cylinders, 255 heads, 63 sectors/track Old situation: Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 * 0+ 10010 10011- 80413326 7 HPFS/NTFS /dev/sda2 0 - 0 0 0 Empty /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty ... /dev/sda2 0 - 0 0 0 Empty /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty Warning: no primary partition is marked bootable (active) This does not matter for LILO, but the DOS MBR will not boot this disk. Successfully wrote the new partition table Re-reading the partition table ... If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (See fdisk(8).) |
#fdisk /dev/sda
w write table to disk and exit x extra functionality (experts only) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-10011, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-10011, default 10011): +10G ... Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 1217 9775521 83 Linux /dev/sda2 1218 2434 9775552+ 83 Linux /dev/sda3 2435 3651 9775552+ 83 Linux /dev/sda4 3652 10011 51086700 5 Extended /dev/sda5 3652 6084 19543041 83 Linux /dev/sda6 6085 10011 31543596 83 Linux Command (m for help): q |
#ls /dev/sda*
/dev/sda /dev/sda1 |
#fdisk /dev/sda
The number of cylinders for this disk is set to 10011. 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): q |
#fdisk -l /dev/sda
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 10011 80413357 83 Linux |
#fdisk -l /dev/sda*
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 10011 80413357 83 Linux Disk /dev/sda1: 82.3 GB, 82343277568 bytes 255 heads, 63 sectors/track, 10010 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/sda1 doesn't contain a valid partition table |
#apt-get install parted
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: portmap Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libparted1.8-10 Suggested packages: libparted1.8-dev libparted1.8-i18n parted-doc ... Get:2 http://127.0.0.1 sid/main parted 1.8.8.git.2008.03.24-11.1 [64.5kB] Fetched 262kB in 0s (1817kB/s) Selecting previously deselected package libparted1.8-10. (Reading database ... 54868 files and directories currently installed.) Unpacking libparted1.8-10 (from .../libparted1.8-10_1.8.8.git.2008.03.24-11.1_i386.deb) ... Selecting previously deselected package parted. Unpacking parted (from .../parted_1.8.8.git.2008.03.24-11.1_i386.deb) ... Processing triggers for man-db ... Setting up libparted1.8-10 (1.8.8.git.2008.03.24-11.1) ... Setting up parted (1.8.8.git.2008.03.24-11.1) ... |
#parted
GNU Parted 1.8.8 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) help check NUMBER do a simple check on the file system cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition help [COMMAND] print general help, or help on COMMAND mklabel,mktable LABEL-TYPE create a new disklabel (partition table) mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER mkpart PART-TYPE [FS-TYPE] START END make a partition ... rescue START END rescue a lost partition near START and END resize NUMBER START END resize partition NUMBER and its file system rm NUMBER delete partition NUMBER select DEVICE choose the device to edit set NUMBER FLAG STATE change the FLAG on partition NUMBER toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER unit UNIT set the default unit to UNIT version display the version number and copyright information of GNU Parted (parted) quit |
#part
parted partprobe partx |
#partprobe
|
#fdisk -l /dev/sda
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 10011 80413357 83 Linux |
#fdisk -l /dev/sda
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 1217 9775521 83 Linux /dev/sda2 1218 2434 9775552+ 83 Linux /dev/sda4 2435 10011 60862252+ 5 Extended /dev/sda5 2435 4867 19543041 83 Linux /dev/sda6 4868 10011 41319148+ 83 Linux |
#partprobe
|
#cfdisk
|
#fdisk -l /dev/sda
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 1217 9775521 83 Linux /dev/sda2 1218 2434 9775552+ 83 Linux /dev/sda4 2435 10011 60862252+ 5 Extended /dev/sda5 2435 4867 19543041 83 Linux /dev/sda6 4868 10011 41319148+ 83 Linux |
#cfdisk
|
#cfdisk
|
#fdisk /dev/sda
The number of cylinders for this disk is set to 10011. 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: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes ... /dev/sda1 1 1217 9775521 83 Linux /dev/sda2 1218 2434 9775552+ 83 Linux /dev/sda3 2435 3651 9775552+ 83 Linux /dev/sda4 3652 10011 51086700 5 Extended /dev/sda5 3652 6084 19543041 83 Linux /dev/sda6 6085 10011 31543596 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. |
#cfdisk
|
#mkfs.ext3 /dev/sda1
mke2fs 1.41.5 (23-Apr-2009) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 612000 inodes, 2443880 blocks 122194 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2503999488 75 block groups 32768 blocks per group, 32768 fragments per group 8160 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Writing inode tables: done Creating journal (32768 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. |
#mkfs.ext3 /dev/sda2
mke2fs 1.41.5 (23-Apr-2009) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 612000 inodes, 2443888 blocks 122194 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2503999488 75 block groups 32768 blocks per group, 32768 fragments per group 8160 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 21 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. |
#mkfs.ext3 /dev/sda3
mke2fs 1.41.5 (23-Apr-2009) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 612000 inodes, 2443888 blocks 122194 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2503999488 75 block groups 32768 blocks per group, 32768 fragments per group 8160 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 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/sda4
mke2fs 1.41.5 (23-Apr-2009) mkfs.ext3: inode_size (128) * inodes_count (0) too big for a filesystem with 0 blocks, specify higher inode_ratio (-i) or lower inode count (-N). |
#mkfs.ext3 /dev/sda5
mke2fs 1.41.5 (23-Apr-2009) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 1221600 inodes, 4885760 blocks 244288 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=0 150 block groups 32768 blocks per group, 32768 fragments per group 8144 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000 Writing inode tables: done Creating journal (32768 blocks): ^[[Adone Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 27 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. |
#mkfs.ext3 /dev/sda6
mke2fs 1.41.5 (23-Apr-2009) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 1974272 inodes, 7885899 blocks 394294 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=0 241 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, 1605632, 2654208, 4096000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 24 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. |
#fdisk /dev/sda
The number of cylinders for this disk is set to 10011. 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): q |
#fdisk -l /dev/sda
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 1217 9775521 83 Linux /dev/sda2 1218 2434 9775552+ 83 Linux /dev/sda3 2435 3651 9775552+ 83 Linux /dev/sda4 3652 10011 51086700 5 Extended /dev/sda5 3652 6084 19543041 83 Linux /dev/sda6 6085 10011 31543596 83 Linux |
#vol_id /dev/sda1
ID_FS_USAGE=filesystem ID_FS_TYPE=ext3 ID_FS_VERSION=1.0 ID_FS_UUID=0c9b1a98-7659-4d83-95bd-c858daa943b6 ID_FS_UUID_ENC=0c9b1a98-7659-4d83-95bd-c858daa943b6 ID_FS_LABEL= ID_FS_LABEL_ENC= |
#apt-get install uuidgen
Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package uuidgen |
#mount -L MEGADISK
mount: no such partition found |
#df /mnt
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 9621848 152684 8980388 2% /mnt |
#cd /mnt
|
#ls
lost+found |
#umount /mnt
umount: /mnt: device is busy umount: /mnt: device is busy umount: /mnt: device is busy |
#lsof +d /mnt
bash: lsof: command not found |
#fuser /mnt
/mnt: 11408c |
#ps -aux | grep /mnt
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html root 16411 0.0 0.0 3952 744 pts/2 S+ 12:19 0:00 grep /mnt |
#ps aux | grep /mnt
root 16454 0.0 0.0 3952 736 pts/2 R+ 12:20 0:00 grep /mnt |
#ps aux | grep $$
root 11408 0.0 0.0 6260 2996 pts/2 Ss 11:10 0:00 bash root 16497 0.0 0.0 3952 748 pts/2 S+ 12:21 0:00 grep 11408 |
#fuser -k
No process specification given Usage: fuser [ -fuv ] [ -a | -s ] [ -4 | -6 ] [ -c | -m | -n SPACE ] [ -k [ -i ] [ -SIGNAL ]] NAME... fuser -l fuser -V Show which processes use the named files, sockets, or filesystems. -a display unused files too -c Same as -m (for POSIX compatibility) -f silently ignored (for POSIX compatibility) -i ask before killing (ignored without -k) -k kill processes accessing the named file ... -n SPACE search in this name space (file, udp, or tcp) -s silent operation -SIGNAL send this signal instead of SIGKILL -u display user IDs -v verbose output -V display version information -4 search IPv4 sockets only -6 search IPv6 sockets only - reset options udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]] |
#cd
|
#umount /dev/sda
umount: /dev/sda: not mounted |
#umount /dev/sda1
|
#vi /etc/fstab
--- /tmp/l3-saved-11408.757.29096 2009-05-30 12:24:07.000000000 +0300 +++ /etc/fstab 2009-05-30 12:25:01.000000000 +0300 @@ -1 +1 @@ -# UNCONFIGURED FSTAB FOR BASE SYSTEM +LABEL=DATA /data ext3 defaults 1 0 |
#LABEL=DATA /data ext3 defaults 1 0
|
#ls
bin dev home lib media opt root selinux sys usr vmlinuz boot etc initrd.img lost+found mnt proc sbin srv tmp var |
#mkdir data
|
#cd
|
#ls
1 hello screen.dot screen.png t1.txt |
#vi /etc/fstab
--- /tmp/l3-saved-11408.26792.1674 2009-05-30 12:29:27.000000000 +0300 +++ /etc/fstab 2009-05-30 12:30:26.000000000 +0300 @@ -1 +1 @@ -LABEL=DATA /data ext3 defaults 1 0 +/dev/sda1 /data ext3 defaults 1 0 |
#mount -a
|
#ls /data\
> |
#ls /data
lost+found |
#mkdir m1
|
#ls /data
lost+found |
#mkdir /data/m1
|
#ls /data
lost+found m1 |
#umount /data
|
#ls /data
|
#ls /data/
|
#fdisk -l /dev/sda
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 1217 9775521 83 Linux /dev/sda2 1218 2434 9775552+ 83 Linux /dev/sda3 2435 3651 9775552+ 83 Linux /dev/sda4 3652 10011 51086700 5 Extended /dev/sda5 3652 6084 19543041 83 Linux /dev/sda6 6085 10011 31543596 83 Linux |
#fdisk -l
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 1217 9775521 83 Linux /dev/sda2 1218 2434 9775552+ 83 Linux /dev/sda3 2435 3651 9775552+ 83 Linux /dev/sda4 3652 10011 51086700 5 Extended /dev/sda5 3652 6084 19543041 83 Linux /dev/sda6 6085 10011 31543596 83 Linux Disk /dev/sdb: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xbc351890 Device Boot Start End Blocks Id System /dev/sdb1 * 1 2432 19535008+ 83 Linux |
#fdisk -l /dev/sda
Disk /dev/sda: 82.3 GB, 82347195904 bytes 255 heads, 63 sectors/track, 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe3f20b73 Device Boot Start End Blocks Id System /dev/sda1 1 1217 9775521 83 Linux /dev/sda2 1218 2434 9775552+ 83 Linux /dev/sda3 2435 3651 9775552+ 83 Linux /dev/sda4 3652 10011 51086700 5 Extended /dev/sda5 3652 6084 19543041 83 Linux /dev/sda6 6085 10011 31543596 83 Linux |
#df /data
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 9621848 152688 8980384 2% /data |
#umount /data
|
#df /data
Filesystem 1K-blocks Used Available Use% Mounted on rootfs 19228276 1660072 16591456 10% / |
#cd /flash
bash: cd: /flash: No such file or directory |
#mkcd /flash
bash: mkcd: command not found |
#mkdir /flash
|
#vi /etc/fstab
--- /tmp/l3-saved-11408.13544.6306 2009-05-30 12:45:39.000000000 +0300 +++ /etc/fstab 2009-05-30 12:46:31.000000000 +0300 @@ -1 +1,2 @@ /dev/sda1 /data ext3 defaults 1 0 +/dev/sdc1 /flash auto owner,noauto 0 0 |
#ls /dev
adsp hpet ram0 sda tty11 tty3 tty48 tty9 vcs agpgart initctl ram1 sda1 tty12 tty30 tty49 ttyS0 vcs1 audio input ram10 sda2 tty13 tty31 tty5 ttyS1 vcs2 block kmem ram11 sda3 tty14 tty32 tty50 ttyS2 vcs3 bsg kmsg ram12 sda4 tty15 tty33 tty51 ttyS3 vcs4 bus log ram13 sda5 tty16 tty34 tty52 urandom vcs5 cdrom loop0 ram14 sda6 tty17 tty35 tty53 usbdev1.1_ep00 vcs6 char MAKEDEV ram15 sdb tty18 tty36 tty54 usbdev1.1_ep81 vcs7 console mem ram2 sdb1 tty19 tty37 tty55 usbdev2.1_ep00 vcsa core mixer ram3 shm tty2 tty38 tty56 usbdev2.1_ep81 vcsa1 cpu_dma_latency net ram4 snapshot tty20 tty39 tty57 usbdev3.1_ep00 vcsa2 disk network_latency ram5 snd tty21 tty4 tty58 usbdev3.1_ep81 vcsa3 dri network_throughput ram6 sndstat tty22 tty40 tty59 usbdev4.1_ep00 vcsa4 dsp null ram7 stderr tty23 tty41 tty6 usbdev4.1_ep81 vcsa5 dvd port ram8 stdin tty24 tty42 tty60 usbdev5.1_ep00 vcsa6 etherd ppp ram9 stdout tty25 tty43 tty61 usbdev5.1_ep81 vcsa7 fd printer random tty tty26 tty44 tty62 usbdev6.1_ep00 xconsole full psaux root tty0 tty27 tty45 tty63 usbdev6.1_ep81 zero fuse ptmx rtc tty1 tty28 tty46 tty7 usbdev7.1_ep00 hdb pts rtc0 tty10 tty29 tty47 tty8 usbdev7.1_ep81 |
#cat /etc/fstab
/dev/sda1 /data ext3 defaults 1 0 /dev/sdc1 /flash auto owner,noauto 0 0 |
#dd if=/dev/zero of=harddisk,img count=200 ds=1024
dd: unrecognized operand `ds=1024' Try `dd --help' for more information. |
#dd if=/dev/zero of=harddisk.img count=200 ds=1024
dd: unrecognized operand `ds=1024' Try `dd --help' for more information. |
#ls
1 harddisk.img hello m1 screen.dot screen.png t1.txt |
#ls harddisk.img
harddisk.img |
#ls -l harddisk.img
-rw-r--r-- 1 root root 204800 2009-05-30 14:07 harddisk.img |
#ls -l /dev/loop[0-7]
brw-rw---- 1 root disk 7, 0 2009-05-30 09:24 /dev/loop0 brw-rw---- 1 root disk 7, 1 2009-05-30 14:18 /dev/loop1 brw-rw---- 1 root disk 7, 2 2009-05-30 14:18 /dev/loop2 brw-rw---- 1 root disk 7, 3 2009-05-30 14:18 /dev/loop3 brw-rw---- 1 root disk 7, 4 2009-05-30 14:18 /dev/loop4 brw-rw---- 1 root disk 7, 5 2009-05-30 14:18 /dev/loop5 brw-rw---- 1 root disk 7, 6 2009-05-30 14:18 /dev/loop6 brw-rw---- 1 root disk 7, 7 2009-05-30 14:18 /dev/loop7 |
#ls -l /dev/loop*
brw-rw---- 1 root disk 7, 0 2009-05-30 09:24 /dev/loop0 brw-rw---- 1 root disk 7, 1 2009-05-30 14:18 /dev/loop1 brw-rw---- 1 root disk 7, 2 2009-05-30 14:18 /dev/loop2 brw-rw---- 1 root disk 7, 3 2009-05-30 14:18 /dev/loop3 brw-rw---- 1 root disk 7, 4 2009-05-30 14:18 /dev/loop4 brw-rw---- 1 root disk 7, 5 2009-05-30 14:18 /dev/loop5 brw-rw---- 1 root disk 7, 6 2009-05-30 14:18 /dev/loop6 brw-rw---- 1 root disk 7, 7 2009-05-30 14:18 /dev/loop7 |
#losetup /dev/loop0 harddisk.img
|
#echo ';' | sfdisk /dev/loop0
Checking that no-one is using this disk right now ... BLKRRPART: Invalid argument OK Disk /dev/loop0: cannot get geometry Disk /dev/loop0: 0 cylinders, 255 heads, 63 sectors/track sfdisk: ERROR: sector 0 does not have an msdos signature /dev/loop0: unrecognized partition table type Old situation: No partitions found New situation: ... /dev/loop0p3 0 - 0 0 0 Empty /dev/loop0p4 0 - 0 0 0 Empty Warning: no primary partition is marked bootable (active) This does not matter for LILO, but the DOS MBR will not boot this disk. Successfully wrote the new partition table Re-reading the partition table ... BLKRRPART: Invalid argument If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (See fdisk(8).) |
#apt-get install kpartx
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: portmap Use 'apt-get autoremove' to remove them. The following extra packages will be installed: dmsetup The following NEW packages will be installed: dmsetup kpartx ... Get:2 http://127.0.0.1 sid/main kpartx 0.4.8-15 [25.3kB] Fetched 67.1kB in 0s (282kB/s) Selecting previously deselected package dmsetup. (Reading database ... 54881 files and directories currently installed.) Unpacking dmsetup (from .../dmsetup_2%3a1.02.30-3_i386.deb) ... Selecting previously deselected package kpartx. Unpacking kpartx (from .../kpartx_0.4.8-15_i386.deb) ... Processing triggers for man-db ... Setting up dmsetup (2:1.02.30-3) ... Setting up kpartx (0.4.8-15) ... |
#kpartx -a /dev/loop0
/proc/misc: No entry for device-mapper found Is device-mapper driver missing from kernel? Failure to communicate with kernel device-mapper driver. device mapper prerequisites not met |
/dev/sda1 /data ext3 defaults 1 0 /dev/sdc1 /flash auto owner,noauto 0 0
Время первой команды журнала | 11:37:23 2009- 5-30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 14:23:24 2009- 5-30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 92 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 13.04 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 3.26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.75 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.88 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008