Wednesday, 2 March 2016

Create image of flash drive / Memory card in linux.

Hi guys sometime we need to make image of memory card, pendrive or any flash device.
There is a tools in linux by which we can easily make images.




  1. Insert memory card / flash drive in card reader or usb.
  2. Now open terminal window using ("ctrl + alt + t" in ubuntu).
  3. make a directory at desktop where we will save image by following commands:
    • sudo mkdir ~/Desktop/backupImages
    • cd ~/Desktop/backupImages
  4. give command clear"dmesg"
    • dmesg -C
    • dmesg

  • You will find result "attached scsi removable disk". Here "sdd" is found on my pc.
  • Make sure you check on your computer. "Careful in this step to get your device name"

  • Now give command to make image of your device
    • sudo dd if=/dev/sdd of=myflashbackup.img
  • now wait for few minutes depending upon size of flash drive.
  • A new file is created named "myflashbackup.img".
Note: "if" is source and "of" is destination.

please post if having any query.

Linux Command Line

Basic Linux Commands


  • ls            :       It Shows List of directories.
  • mkdir      :        It make a directory at current path.
  • cd              :       Changes current directory.
  • ps              :        Shows list of process running.
  • dmesg       :        Shows Debug messages.
  • cp              :        Copy file or empty directory from source to destination.
  • cp -rf         :        Copy directory with contents.
  • clear          :        Clear terminal screen.
  • cat              :        Concatenate and print (display) the content of files.
  • chmod       :        Change access permissions.
  • chown        :        Change file owner and group.
  • ifconfig      :        Show networking information.
  • mv              :       Move file/ directory.
  • kill              :       Kill process by process ID.
  • pkill            :       Kill process by its name.
  • touch           :       Edit information details about file.
  • vi                 :       Screen based vi editor is initiated.
  • vim              :       Modified version of vi editor.
  • whoami       :       Displays current user ID.


Linux Boot Process

Linux Boot Process


Basic Structural block diagram:


BIOS: 

  • BIOS stands for Basic Input Output System.
  • It is a small program that checks system integrity.
  • It conducts first hardware checks.
  • In personal computer it resides inside ROM chip populated on mother board.
  • It checks for secondary memory availability.
  • Finally it loads and execute MBR (Master Boot Record).

MBR:

  • MBR stands for master Boot Record.
  • It is located in first sector of  HDD or flash drive. "/dev/hda" or "/dev/sda".
  • MBR is pretty small in size, less than 512 Bytes. It has following three components:
    • Primary bootloader information in first   : 446 Bytes.
    • partition table information                       :   64 Bytes.
    • MBR validation check                              :     2 Bytes.
  • It contains information about bootloader (here we consider GRUB), it simply load and executes GRUB.

GRUB:

  • GRUB stands for Grand Unified Bootloader.
  • It displays the list of all available kernel images in system. I has option to choose any one of them.
  • GRUB has knowledge of Filesystem.
  • Present in /etc/grub.conf or /boot/grub/grub.conf
  • It loads kernel and initrd images.


Kernel:

  • It is a core part of Operating System.
  • It executes /sbin/init program file.
  • It initiates initrd image.
    • initrd stands for initial ramdisk.
    • It is a temporary file system mounted until kernel is booted.
    • initrd has basic device drivers for HDD, other hardware.
  • Mounts root filesystem.


init: 

  • It is very first program which executed by kernel after booting.
  • It has PID =1.
  • It has following runlevels:
    • 0 :  halt
    • 1 : Single user
    • 2 : multi user
    • 3 :
    • 4 : unused
    • 5 : multi user with full GUI.
    • 6 : reboot













Tuesday, 1 March 2016

Introduction to Linux

Hi Guys,

Here we will study about linux OS comprehensively.

Introduction to Linux

What is Linux?

Linux is a operating system based on Unix like kernel. It was initially written by Linus Benedict TorvaldsLinux is written in c.


Why Linux?

  • Source code is freely available.
  • Large community uses Linux.
  • Can be modified or customized.

Which Linux?

  • Red hat.
  • Fedora.
  • Ubuntu.
  • Mint, etc.


Linux Structure


Shells Available: 

  • Ksh
  • Csh
  • Bsh
  • Bash, etc.