First, when dealing with the spaces in a file name while using the terminal, you can use a back-slash before the space.
File name with spaces.txt
For the terminal:
File\ name\ with\ spaces.txt
Sometimes we run across a downloaded file online that was created by utilizing the winrar multiple-file feature to make a huge file downloadable. A good example would be an ISO image that is more than 1GB in size. The rar program can break up the file into smaller pieces. Example:
and so on
To unrar multiple files into one, first install the unrar program in linux. In this case, I’m assuming you are using Ubuntu or any Debian-based distribution (like Raspbian):
I have a hard drive-duplicator device. It works great if you two of the same drive. But I’ve had issues transferring from an SSD to a regular hard drive (and vice versa).
I looked into buying the EaseUS Disk Copy program (only works in Windows) but now they want a subscription? Hell no to that. So here we are, looking to Ubuntu for our solution!
EDIT: I used the following method to duplicate my Ubuntu Server backup and the copied disk booted into grub (no boot loader). All things considered, one of those duplicators found easily on ebay and Amazon are the best bet. They are much faster and more accurate. For the error I did get using the physical drive duplicator, it was easy to fix. I booted with an Ubuntu Desktop Live USB and used the Disks program to repair. No issues after that. The model I have is a Sabrent EC-HD2B and I have to say it’s pretty nice.
Once you run the Ubuntu Live disk, open a terminal.
Plug in your first drive (the one that you want to copy).
sudo fdisk –l
Take note of what fdisk reports for this drive. It is likely /dev/sda
Now, plug in your second drive (the one you want to overwrite).
Run ‘sudo fdisk –l’ again.
fdisk will likely report this drive as /dev/sda.
Do not confuse the two drives. Here’s a sample statement that will allow your computer to copy the first drive to the second. Replace the drive names as necessary. In this example, sda is the source and sdb is the target:
sudo dd if=/dev/sda of=/dev/sdb
This process can take several hours. Do not turn your machine off until you see a report in your terminal that the process is complete. In my case, it took over 24 hours to copy a 1TB drive with a Mac Mini (Mid 2012)!
Example output when done:
1953525167+0 records in
1953525167+0 records out
1000204885504 bytes (1.0 TB, 932 GiB) copied, 102499 s, 9.8 MB/s
First, if you have an exFat drive, you will need to install the Ubuntu exFat utility or you will get a “unknown filesystem type ‘exfat’” mount error.
To avoid that, in a console type:
sudo apt-get install exfat-fuse exfat-utils
Before we update anything, we will need to find out what your hard drive is called in the system before we mount it.
Any of these commands will tell you the drive name.
sudo fdisk -l
Look for something like this: /dev/sdb
You will need to create a mount point for the system.
>sudo mkdir /media/usb
You can replace “usb” with any name you like.
Now you will need to update your “fstab” file so Ubuntu can mount the drive at startup.
Important: find the Device and Filesystem with this command:
Look for “Filesystem” and “Type”.
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sda2 ext4 959862832 368219792 542814880 41% /
The “Filesystem” is /dev/sda2 and the “Type” is “ext4”.
sudo nano /etc/fstab
Copy this statement into the file, replacing the #Device (example: /dev/sdb1) and #fs-type (example: exfat or ext4)