Merging two linux partitions
Ralf Mardorf
silver.bullet at zoho.com
Tue May 14 11:14:15 UTC 2019
On Tue, 2019-05-14 at 12:17 +0200, Liam Proven wrote:
> > sudo -i
> > cp -ai /mount_point_of_old_SSD_linux_partition_1/* /mount_point_of_new_SSD_linux_partition_1/
>
> Um. I hesitate to criticise but that is a _really_ failure-prone,
> complex and difficult way of doing it
Apart from the asterisk it's idiot-proof. I decided to post a copy
command using an asterisk, since apart from some unwanted .trash/ folder
root directories very seldom contain hidden files.
However, you could verify after coping:
[rocketmouse at archlinux computer]$ ls -lA new_SSD_partition/ old_SSD_partition/{.,}parent_?
new_SSD_partition/:
total 0
old_SSD_partition/parent_1:
total 0
drwxr-xr-x 2 rocketmouse rocketmouse 40 May 14 12:42 sub_1
drwxr-xr-x 2 rocketmouse rocketmouse 40 May 14 12:42 .sub_2
old_SSD_partition/.parent_2:
total 0
drwxr-xr-x 2 rocketmouse rocketmouse 40 May 14 12:42 sub_1.2
drwxr-xr-x 2 rocketmouse rocketmouse 40 May 14 12:42 .sub_2.2
[rocketmouse at archlinux computer]$ cp -ai old_SSD_partition/* new_SSD_partition/; echo $?
0
[rocketmouse at archlinux computer]$ diff -r old_SSD_partition/ new_SSD_partition/
Only in old_SSD_partition/: .parent_2
The output of "echo $?" confirms that the exit status is "0", IOW no error happened.
The recursive diff command informs about a forgotten .hidden item.
> and it doesn't address other OSes on the disk, either.
Yes, but the OP only wants to resize the Linux partition.
Gparted will open two dialogs, one that recommends to backup the
install, since resizing a partition could cause data loss and another
that informs that resizing a root partition could break the bootloader.
So why not doing it less risky all in one in the first place by a copy,
rsync, tar archive or something similar? Only the bootloader needs to be
installed, too, but copying from an existing drive to a partition of the
wanted size, is way more secure, than resizing a partition after using a
clone tool.
More information about the ubuntu-users
mailing list