Last Friday a reader commented that it would be interesting to create a post about how to format a USB and create a bootable USB by the command dd So in this post I will deal with those issues 🙂
Management of units through the terminal.
The first command required is fdisk, this allows manipulating and / or displaying the partition table of any unit, and its use is as simple as its definition ...
# fdisk -l
Displays the list of drives and their partition table
# fdisk /dev/sdx #sdx es un ejemplo
Enter the interactive partition manipulation menu.
mount / umount
When I started years ago in GNU / Linux I asked myself, Will it be possible to mount a USB by the terminal? My instincts told me yes, but ... How? Little by little I began to use the console more and suddenly the answer came alone with mount y umount.
To mount a USB from the terminal we need to create a mount directory, by tradition it will be in / mnt hahaha
# mkdir /mnt/USB
In this directory all the data from the USB will be mounted. Now we connect the USB, the kernel does all the magic by detecting the driver, and telling the system that the device is ready to be used, we can see this with:
$ dmesg | tail
It will show the last 10 lines that the kernel buffer does but for us it will be imperceptible until we use Fdisk to see that it detects a new unit and shows us information about it; suppose the USB is / Dev / sdb and we want to get the information out of it. To mount it enough
# mount /dev/sdb /mnt/USB
Now when going to the directory / mnt / USB we will find that it has all the information of the USB and it is possible
It is possible to create a bootable USB
# dd if=~/imagen.iso of=/dev/sdb
And it only remains to wait until the terminal cursor reappears.
It is possible to make a copy from unit to unit
# dd if=/dev/sdx1 of=/dev/sdx2 bs=4096
Delete data from entire drive
# dd if=/dev/null of=/dev/sdx
Make a horizontal text
$ echo -n "Wada" | bb cbs=1 conv=unblock 2> /dev/null
Convert text to lowercase
$ echo "wada" | bb conv=ucase 2> /dev/null
Well people is everything for today this is the basics that you should know about managing file systems and drives 🙂 We read each other, until next Friday.