Translate

Kamis, 08 Desember 2011

Rumus Kode Linux Untuk UAS

User teknik may run the following commands on this host:
    (ALL) ALL
teknik@teknik-VirtualBox:~$ mkdir sudo -l
mkdir: invalid option -- 'l'
Try `mkdir --help' for more information.
teknik@teknik-VirtualBox:~$ m
m: command not found
teknik@teknik-VirtualBox:~$ dev/sdb1
bash: dev/sdb1: No such file or directory
teknik@teknik-VirtualBox:~$ mkdir fdisk -l
mkdir: invalid option -- 'l'
Try `mkdir --help' for more information.
teknik@teknik-VirtualBox:~$ sudo -l
Matching Defaults entries for teknik on this host:
    env_reset

User teknik may run the following commands on this host:
    (ALL) ALL
teknik@teknik-VirtualBox:~$ sudo fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00031dc4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         994     7977984   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2             994        1045      407553    5  Extended
/dev/sda5             994        1045      407552   82  Linux swap / Solaris

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table
teknik@teknik-VirtualBox:~$ m
m: command not found
teknik@teknik-VirtualBox:~$ fkdisk -h
No command 'fkdisk' found, did you mean:
 Command 'mkdisk' from package 'xtrs' (multiverse)
 Command 'fdisk' from package 'gnu-fdisk' (universe)
 Command 'fdisk' from package 'util-linux' (main)
fkdisk: command not found
teknik@teknik-VirtualBox:~$ fdisk -h

Usage:
 fdisk [options] <disk>    change partition table
 fdisk [options] -l <disk> list partition table(s)
 fdisk -s <partition>      give partition size(s) in blocks

Options:
 -b <size>                 sector size (512, 1024, 2048 or 4096)
 -c                        switch off DOS-compatible mode
 -h                        print help
 -u <size>                 give sizes in sectors instead of cylinders
 -v                        print version
 -C <number>               specify the number of cylinders
 -H <number>               specify the number of heads
 -S <number>               specify the number of sectors per track

teknik@teknik-VirtualBox:~$ 1
1: command not found
teknik@teknik-VirtualBox:~$ mm
The program 'mm' can be found in the following packages:
 * mountmanager
 * multimail
Try: sudo apt-get install <selected package>
teknik@teknik-VirtualBox:~$ m
m: command not found
teknik@teknik-VirtualBox:~$ w
 13:53:55 up 16 min,  2 users,  load average: 0.05, 0.38, 0.33
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
teknik   tty7     :0               13:38   16:11  10.82s  0.33s gnome-session
teknik   pts/0    :0.0             13:50    0.00s  0.27s  0.00s w
teknik@teknik-VirtualBox:~$ sudo fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00031dc4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         994     7977984   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2             994        1045      407553    5  Extended
/dev/sda5             994        1045      407552   82  Linux swap / Solaris

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table
teknik@teknik-VirtualBox:~$ fdisk -l
teknik@teknik-VirtualBox:~$ m
m: command not found
teknik@teknik-VirtualBox:~$ sudo fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x33e34c41.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   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)
e
Partition number (1-4): 1
First cylinder (1-261, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261): 261

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
p
Partition number (1-4): a
Partition number (1-4): 1
Partition 1 is already defined.  Delete it before re-adding it.

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
m
Invalid partition number for type `m'
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
p
Partition number (1-4): q
Partition number (1-4): 1
Partition 1 is already defined.  Delete it before re-adding it.

Command (m for help): q

teknik@teknik-VirtualBox:~$ sudo fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x1764d94c.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   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-261, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261): 1g

Command (m for help): p

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1764d94c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           1        8001   83  Linux

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
teknik@teknik-VirtualBox:~$ sudo fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00031dc4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         994     7977984   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2             994        1045      407553    5  Extended
/dev/sda5             994        1045      407552   82  Linux swap / Solaris

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1764d94c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           1        8001   83  Linux
teknik@teknik-VirtualBox:~$ sudo fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   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): 2
First cylinder (2-261, default 2):
Using default value 2
Last cylinder, +cylinders or +size{K,M,G} (2-261, default 261):
Using default value 261

Command (m for help): p

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1764d94c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           1        8001   83  Linux
/dev/sdb2               2         261     2088450   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
teknik@teknik-VirtualBox:~$ fdisk -l
teknik@teknik-VirtualBox:~$ sudo fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00031dc4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         994     7977984   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2             994        1045      407553    5  Extended
/dev/sda5             994        1045      407552   82  Linux swap / Solaris

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1764d94c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           1        8001   83  Linux
/dev/sdb2               2         261     2088450   83  Linux
teknik@teknik-VirtualBox:~$ ext3
ext3: command not found
teknik@teknik-VirtualBox:~$ sudo mkfs.ext /dev/sbd1
sudo: mkfs.ext: command not found
teknik@teknik-VirtualBox:~$ sudo mkfs.ext /dev/sdb1
sudo: mkfs.ext: command not found
teknik@teknik-VirtualBox:~$ sudo mkfs.ext /dev/sdb
sudo: mkfs.ext: command not found
teknik@teknik-VirtualBox:~$ sudo mkfs.ext3 /dev/sdb
mke2fs 1.41.12 (17-May-2010)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) n
teknik@teknik-VirtualBox:~$ sudo mkfs.ext3 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
2000 inodes, 8000 blocks
400 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=8388608
1 block group
8192 blocks per group, 8192 fragments per group
2000 inodes per group

Writing inode tables: done                           
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
teknik@teknik-VirtualBox:~$ sudo mkfs.ext3 /dev/sdb2
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
130560 inodes, 522112 blocks
26105 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912

Writing inode tables: done                           
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
teknik@teknik-VirtualBox:~$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /var/lib/ureadahead/debugfs type debugfs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/teknik/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=teknik)
teknik@teknik-VirtualBox:~$ mount/sdb1 /dhcp
bash: mount/sdb1: No such file or directory
teknik@teknik-VirtualBox:~$ mount /sdb1/dhcp
mount: can't find /sdb1/dhcp in /etc/fstab or /etc/mtab
teknik@teknik-VirtualBox:~$ mount /sdb1
mount: can't find /sdb1 in /etc/fstab or /etc/mtab
teknik@teknik-VirtualBox:~$ mount /dev/sdb1/dhcp
mount: can't find /dev/sdb1/dhcp in /etc/fstab or /etc/mtab
teknik@teknik-VirtualBox:~$ mount /dev/sdb1/data5
mount: can't find /dev/sdb1/data5 in /etc/fstab or /etc/mtab
teknik@teknik-VirtualBox:~$ nount /sdb1/data5
No command 'nount' found, did you mean:
 Command 'mount' from package 'mount' (main)
 Command 'mount' from package 'loop-aes-utils' (universe)
nount: command not found
teknik@teknik-VirtualBox:~$ mount /sdb1
mount: can't find /sdb1 in /etc/fstab or /etc/mtab
teknik@teknik-VirtualBox:~$ /sdb1 /etc/fstab
bash: /sdb1: No such file or directory
teknik@teknik-VirtualBox:~$ sudo mkdir data5
teknik@teknik-VirtualBox:~$ ls
data5    Documents  examples.desktop  Music     Public  Templates
Desktop  Downloads  m                 Pictures  teknik  Videos
teknik@teknik-VirtualBox:~$ sudo mkdir data6
teknik@teknik-VirtualBox:~$ ls
data5  Desktop    Downloads         m      Pictures  teknik     Videos
data6  Documents  examples.desktop  Music  Public    Templates
teknik@teknik-VirtualBox:~$ sudo mkdir data7
teknik@teknik-VirtualBox:~$ ls
data5  data7    Documents  examples.desktop  Music     Public  Templates
data6  Desktop  Downloads  m                 Pictures  teknik  Videos
teknik@teknik-VirtualBox:~$ sudo mkdir data8
teknik@teknik-VirtualBox:~$ ls
data5  data7  Desktop    Downloads         m      Pictures  teknik     Videos
data6  data8  Documents  examples.desktop  Music  Public    Templates
teknik@teknik-VirtualBox:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.5G  2.3G  4.9G  32% /
none                  243M  224K  243M   1% /dev
none                  249M  168K  249M   1% /dev/shm
none                  249M   88K  249M   1% /var/run
none                  249M     0  249M   0% /var/lock
none                  7.5G  2.3G  4.9G  32% /var/lib/ureadahead/debugfs
teknik@teknik-VirtualBox:~$ sudo mount /dev/sdb1 /data5
mount: mount point /data5 does not exist
teknik@teknik-VirtualBox:~$ sudo mount /dev/sdb1/data5
mount: can't find /dev/sdb1/data5 in /etc/fstab or /etc/mtab
teknik@teknik-VirtualBox:~$ sudo mount /dev /sdb1/data5
mount: mount point /sdb1/data5 does not exist
teknik@teknik-VirtualBox:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.5G  2.3G  4.9G  32% /
none                  243M  224K  243M   1% /dev
none                  249M  168K  249M   1% /dev/shm
none                  249M   88K  249M   1% /var/run
none                  249M     0  249M   0% /var/lock
none                  7.5G  2.3G  4.9G  32% /var/lib/ureadahead/debugfs
teknik@teknik-VirtualBox:~$ sudo mount/dev/sdb1 /data5
sudo: mount/dev/sdb1: command not found
teknik@teknik-VirtualBox:~$ sudo mount /dev/sdb1 /data5
mount: mount point /data5 does not exist
teknik@teknik-VirtualBox:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.5G  2.3G  4.9G  32% /
none                  243M  224K  243M   1% /dev
none                  249M  168K  249M   1% /dev/shm
none                  249M   88K  249M   1% /var/run
none                  249M     0  249M   0% /var/lock
none                  7.5G  2.3G  4.9G  32% /var/lib/ureadahead/debugfs
teknik@teknik-VirtualBox:~$ sudo gedit fstab
teknik@teknik-VirtualBox:~$ sudo mount/dev/sdb1 /data6
sudo: mount/dev/sdb1: command not found
teknik@teknik-VirtualBox:~$ sudo gedit fstab
teknik@teknik-VirtualBox:~$ sudo mount /dev/sdb1 /data6
mount: mount point /data6 does not exist
teknik@teknik-VirtualBox:~$ sudo gedit fstab
teknik@teknik-VirtualBox:~$ sudo mount /dev/sdb2 /data7
mount: mount point /data7 does not exist
teknik@teknik-VirtualBox:~$ sudo gedit fstab
teknik@teknik-VirtualBox:~$ sudo mount /dev/sdb2 /data8
mount: mount point /data8 does not exist
teknik@teknik-VirtualBox:~$ sudo geditfstab
sudo: geditfstab: command not found
teknik@teknik-VirtualBox:~$ sudo gedit fstab
teknik@teknik-VirtualBox:~$

Tidak ada komentar:

Posting Komentar