Tag Archives: dd

Create bootable USB Fedora 24

Every time there is a new release of Linux distro, I need to create a bootable USB. And, I forgot how I did it last time. So, I tried by using the “Startup Disk Creator” program installed on my Ubuntu workstation, only to find out that it didn’t even work.

After a while I remember, it was just a matter of using dd command to copy the ISO image to the USB.

Here is how I did it last time for Fedora 24:

My USB is showed up as /dev/sdx, and the ISO image is: Fedora-Workstation-Live-x86_64-24-1.2.iso.

$ sudo dd if=./Fedora-Workstation-Live-x86_64-24-1.2.iso of=/dev/sdx bs=8M status=progress oflag=direct
[sudo] password for kenno: 
1541406720 bytes (1.5 GB, 1.4 GiB) copied, 648.041 s, 2.4 MB/s 
183+1 records in
183+1 records out
1541406720 bytes (1.5 GB, 1.4 GiB) copied, 650.655 s, 2.4 MB/s

That’s all I had to do. A few words of warning; make sure you double check the name of USB device detected by your counter. In my case, it was /dev/sdc, but I used /dev/sdx as an example.

For more details check out https://fedoraproject.org/wiki/How_to_create_and_use_Live_USB

Copy RaspBSD image to micro SD card

The RaspBSD image for Raspberry Pi can be found at http://raspbsd.org/raspberrypi.html.

After it’s been downloaded, we need to copy it to a microSD card. Before we can do that, we need to find out the device name represents the microSD card. One way to find out is to plug the card in, and check the newest messages of ”dmesg”.

$ dmesg
[282430.689656] mmc0: new SDHC card at address aaaa
[282430.691039] mmcblk0: mmc0:aaaa SU08G 7.40 GiB 
[282430.711060]  mmcblk0: p1 p2

In my case, using Ubuntu 15.10, the card is detected as mmcblk0.

Now, we’re ready to copy the image into the microSD card.

$ gunzip FreeBSD-armv6-11.0-RPI2-290555.img.gz
$ sudo dd bs=1m if=FreeBSD-armv6-11.0-RPI2-290555.img of=/dev/mmcblk0
$ sudo sync

If you want to see the progress while running dd command, you can use dcfldd instead:

$ sudo dcfldd bs=1m if=FreeBSD-armv6-11.0-RPI2-290555.img of=/dev/mmcblk0
30464 blocks (952Mb) written.
30517+1 records in
30517+1 records out
$ sudo sync

I’m not sure if sudo sync is mandatory, but I ran it anyway. That’s it!

Copy hard disks or partitions using dd

Warning: The following is for personal note only, and is not meant to be a tutorial or guide.

On Debian server at work, we have /home reside on /dev/hda6 and I want to move to a new hard disk /dev/hdb.

First, I need to format /dev/hdb using fdisk. Then use dd to copy the content from /dev/hda6 to /dev/hdb1, the newly createdd ext3 partition.

# dd if=/dev/hda6 of=/dev/hdb1 bs=1024

The above commands instruct dd to read the content from /dev/hda6 and write it to /dev/hdb1. bs=1024 sets the block size to 1024 bytes.

dd takes a while depends on how big is your hard disk. Then, there is one final step to do — to re-size /dev/hdb1 to its maximum capacity.

# e2fsck -f /dev/hdb1

Now we can resize the file system in /dev/dhb1 partition. If we don’t specify the size, then resize2fs will assume the largest:

# resize2fs /dev/hdb1

# fsck -n /dev/hb1