In this tutorial I want to install Linux on my laptop using a flash drive. with dd command in the linux terminal. Here are the steps:

I. Identify the location of The Flash Drive installed in the linux system

lsblk

The result is:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT  
sda    8:0   0 111,8G 0 disk  
├─sda1 8:1   0 549M   0 part  
├─sda2 8:2   0 56,3G  0 part  
└─sda3 8:3   0 55G    0 part /  
sdd    8:16  1 3,7G   0 disk  
└─sdd1 8:17  1 3,7G   0 part /media/helmiz/HELMI  <<< My Flash Drive
sr0    11:0  1 1024M  0 rom

II. Unmount The Flash Drive

sudo umount /dev/sdd1

III. Create partition and wipe all The Flash Drive data

  1. Type FDISK:

    sudo fdisk /dev/sdd
    
  2. Type p for print information about our flash drive in the screen:

    Disk /dev/sdd: 3,75 GiB, 4002910208 bytes, 7818184 sectors
    Disk model: DataTraveler G2 
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x15f006ae
    Device     Boot Start     End Sectors  Size Id Type
    /dev/sdd1        2048 7818183 7816136  3,7G  7 HPFS/NTFS/exFAT
    
  3. Type d for wipe partitions.

  4. Type o for create new DOS partition.

  5. Type n for create new partition.

  6. The next thing will show type of partitions Primary or Extended, press enter.

    Partition type
    p   primary (0 primary, 0 extended, 4 free)
    e   extended (container for logical partitions)
    Select (default p): 
    
  7. And then we will create number of sector partitions, just press enter for default value:

    Using default response p.
    Partition number (1-4, default 1): 
    First sector (2048-7818183, default 2048): 
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-7818183, default 7818183): 
    
  8. Default type of partition will created as Linux. Type l show all type of partitions. 7 HPFS/NTFS/exFAT for NTFS partition and b W95 FAT32 for Fat32 partition. Type t for change the partition type.

  9. Type w for write the flash drive

  10. Type q for quit.

IV. Format Flashdisk

  • Format with Fat32:

    sudo mkfs.vfat -F32 -n NAME /dev/sdd1
    
  • Format with NTFS:

    sudo mkfs.ntfs -f -L NAMA /dev/sdd1
    

    Notes: - -n NAME: Flash Drive name (capital letters)

  • Format with exFat:

    sudo apt install dosfstools exfat-fuse exfat-utils
    sudo mkfs.exfat -n NAMA /dev/sdd1
    

V. Flash Drive not detected by Windows

  1. Go To Partition Manager in Windows.
  2. Choose and right click in Flash drive which not detected.
  3. Click Change letter….
  4. Choose the Letter for our Flash Drive.

VI. Bibliography