Best Approach for Creating and Copying EXT4 Partitions (No Restoration Needed)

Abstract: Resolve EXT4 partition creation and data migration on Linux using fdisk, mkfs.ext4, dd for bit-for-bit cloning, and rsync for safe file synchronization.

Created: 2026-08-12 by
To create and copy EXT4 partitions on a dual-SSD Linux system, use fdisk or parted to define the partition table, then format with mkfs.ext4. For cloning, dd provides a bit-for-bit copy of raw devices, while rsync is superior for copying mounted filesystems because it preserves permissions and handles active files safely. This approach ensures data integrity without needing restoration tools.

Partitioning Strategy and Creation

Before copying data, you must establish the target structure. Since your second SSD contains four Linux partitions, including two large EXT4 volumes, consistency in naming and sizing is critical. Use lsblk to identify device names like /dev/sda or /dev/nvme0n1. Avoid using generic names; always verify the correct disk to prevent overwriting your Windows NTFS partition on the first SSD. For creating new partitions, fdisk is the standard tool. Run sudo fdisk /dev/sdX replacing X with your target drive letter. Inside the interactive menu, press n to add a new partition, select p for primary, and accept default values for most cases unless specific alignment is required. Change the system type to 83 (Linux filesystem) if necessary, though modern kernels often auto-detect. Write changes with w. Once the partition exists, format it with the EXT4 file system. The command sudo mkfs.ext4 /dev/sdXN where N is the partition number initializes the superblock and inode tables. You can add labels using the -L flag, such as sudo mkfs.ext4 -L Data /dev/sdb2, which makes mounting easier later. Always check the partition table with sudo fdisk -l after creation to ensure no errors occurred during the write process.

Cloning Partitions with DD

The dd utility creates an exact binary image of a source partition onto a destination. This method is ideal when you need an identical replica, including boot sectors and hidden metadata. However, it requires that the destination partition be at least as large as the source. If the target is smaller, data will be truncated, leading to corruption. To clone a partition, unmount it first to prevent data inconsistency. Use sudo umount /dev/sdb2. Then execute:
sudo dd if=/dev/sdb2 of=/dev/sdc2 bs=4M status=progress
Here, if specifies the input file (source), and of specifies the output file (destination). The bs=4M option sets the block size to 4 megabytes, significantly speeding up the transfer compared to the default 512-byte blocks. The status=progress flag allows you to monitor the copy rate in real-time. Be cautious with dd. A typo in the of parameter can wipe an entire drive instantly. Double-check device names using lsblk before running the command. After completion, verify the clone by comparing checksums if possible, or simply mount both partitions and compare directory structures.

Synchronizing Data with Rsync

While dd clones raw blocks, rsync copies files within the mounted file system. This is often safer for daily backups or migrating data between differently sized partitions. It only transfers changed blocks, making subsequent syncs faster. First, mount both the source and target partitions to known directories, such as /mnt/source and /mnt/dest. Use the following command to synchronize:
sudo rsync -avHAX --delete /mnt/source/ /mnt/dest/
The flags -a enables archive mode, preserving permissions, ownership, and timestamps. -v provides verbose output. -H preserves hard links, -A preserves ACLs, and -X preserves extended attributes. The --delete flag ensures that files deleted from the source are also removed from the destination, keeping them in perfect sync. Note the trailing slash on the source path; it means "copy the contents of," whereas omitting it would create a nested folder. This method respects the EXT4 journaling features and avoids the risks associated with writing directly to block devices. It is particularly useful when moving data between SSDs with different wear levels or capacities, provided the target has enough free space.

Maintaining System Integrity

After creating or copying partitions, update your /etc/fstab file if you plan to mount these drives automatically at boot. Use sudo blkid to get the UUID of the new partition. Edit /etc/fstab with a text editor and add an entry mapping the UUID to a mount point. Incorrect entries here can prevent the system from booting. Additionally, consider the performance implications of having multiple partitions on the same SSD. While EXT4 handles fragmentation well, spreading heavy I/O operations across separate partitions on the same physical NAND flash can sometimes impact endurance due to parallel write amplification. Monitor disk usage with df -h and du -sh regularly to ensure balanced storage utilization. If you encounter issues with file permissions after copying, refer to our guide on Primary User Group for Linux Desktop Applications to understand how group memberships affect access rights. For users managing complex scripts that handle these paths, ensure proper quoting to avoid errors with special characters, as discussed in Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting.

Frequently Asked Questions

Can I clone an EXT4 partition while it is mounted?

No, you should never use dd on a mounted partition because open files may change during the copy, resulting in a corrupted image. For live systems, use rsync instead, which handles concurrent reads safely, or use LVM snapshots to freeze the state temporarily.

What happens if the destination partition is smaller than the source?

dd will fail or truncate data if the destination is too small, potentially destroying the file system structure. Always ensure the target partition is equal to or larger than the source. If using rsync, the operation will simply stop when space runs out, leaving the destination partially copied but not necessarily corrupted.

How do I preserve symbolic links when copying?

By default, rsync follows symbolic links unless specified otherwise. To preserve symlinks as links rather than copying the target content, use the -l flag. Combined with -a, this is included in archive mode, ensuring your link structure remains intact during migration.

Is it safe to delete old partitions after cloning?

Yes, but only after verifying that all data on the new partition is accessible and complete. Mount the new partition, check file counts, and run application-specific tests. Once confirmed, you can remove the old entries from /etc/fstab and delete the old partition using fdisk or gparted.

Why does my cloned partition have a different UUID?

dd copies the exact UUID from the source, which can cause conflicts if both partitions are mounted simultaneously. rsync creates a new file system with a unique UUID. If you need a unique ID for a dd clone, use tune2fs -U random /dev/sdXN to generate a new UUID after the copy.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More