Dual Boot - Перенос пространства из одного раздела (Ubuntu) в другой (Windows) [дубликат]

У меня двойная загрузка. В настоящее время мне не хватает места в моем разделе Windows ( / dev / nvme0n1p3 ). Однако в моем разделе Ubuntu достаточно места ( / dev / nvme0n1p6 ). Поэтому я хотел бы переместить 70 ГБ с Ubuntu на Windows.

Image of Partitions

Как я могу это сделать, чтобы безопасно перенести свободное место в Windows? У меня уже есть Ubuntu на моем USB-накопителе, и я знаю, что мне следует использовать GParted с него. Но я не знаю, как бороться с GParted, перемещением вправо / влево по пробелам и так далее. Я не хочу запутывать это. Спасибо!

0
задан 22 July 2020 в 00:08

2 ответа

It is risky, Sometimes I take an extra precaution (depending on how bad I want to keep the OS).
1.) In ubuntu, comment out your swap line in /etc/fstab
.... или, если вы уже находитесь на живом диске, смонтируйте раздел ubuntu, перейдите в / etc / fstab и подкачку комментариев.

На живом диске - размонтируйте все смонтированные разделы
2.) Я удаляю своп.
3.) Щелкните правой кнопкой мыши, уменьшите размер раздела Ubuntu до нового размера
4.) мои дополнительные меры предосторожности ... если у меня достаточно места на каком-либо другом разделе или, может быть, перед запуском машины вставьте другой диск, чтобы сделать резервную копию раздела как .iso ... dd if = / dev / nv ** p6 из = / sparedisklocation / mypartition.iso bs = 4m status = progress
5.) Решите, какой объем свопа вы хотите воссоздать
6.) Right click, Move "most" the unallocated space (minus swap size) next to the partition to be increased and grow the partition. (Your partitions in your example are fairly close to each other, other people may have to step through this process with each partition in between the source and target partitions)
7.) make a new partition for swap with your leftover unallocated space.
8.) Try it out
9.) Add your new swap location/UUID to your /etc/fstab... delete the old entry\

if all went to hell... and I can't boot into ubuntu:
FIRST - I would try to shrink a partition down to create a small 10g space or so !!!TO THE RIGHT OF THE PARTITION!!!!. Create a small 10g partition and install a minimal installation (don't create swap) on that partition and reboot. (on one occasion, the new small install found the other ubuntu and fixed whatever broke and made it available in the new boot menu) Then I booted into my original ubuntu, deleted the small ubuntu partition and reclaimed the space by growing my current partition... i think the gnome-disks application did that pretty easy. Then update-grub so that you can remove the entry for the small-ubuntu you created. This applies if you created the little "emergency ubuntu" from space that came from a linux partition, I dont know the procedure to reclaim inside of windows. You could always grow it back easily with gparted...
Another note, this is also a surprisingly fast repair and may be easier than trying to use/follow the mount/bind/chroot/install-grub/update-grub method with a live disk if you're not experienced with it.

If that was not an option I go to the backup, boot back into the live disk:

  1. re-create the same-sized partition in old ubuntu partition (i do this out of fear, probably unnecessary)
  2. then dd if=/sparedisklocation/mypartition.iso of=/dev/nv**p6(in your case) bs=4M status=progress. This copies your backed-up partition back into the partition space.
  3. Try to boot again ..... the comfort in this for me, is no matter what is going wrong, you have a copy of your partition... I have made copies of desktop computers like this and taken them on travel with me on my laptop for use, so it is usually pretty portable and will be found by other linux systems(via update-grub) if worst comes to worst
0
ответ дан 30 July 2020 в 22:04

I would recommend making a backup of any important data on the Ubuntu partition, though all my experience with operations like this on partitions is more than 5 years old.

As you already mentioned this should be done while booting from a live disk. As far as I see GParted can move the start sector of a partition with the following steps: GParted - Moving Space Between Partitions.

As is mentioned over there, booting to the moved partition likely will stop working. They do however also have a section in the FAQ on fixing that: GParted Manual - Fixing GRUB boot problem.

1
ответ дан 30 July 2020 в 22:04

Другие вопросы по тегам:

Похожие вопросы: