0

I have 10 partition. My root (/) partition located on /dev/sda9 and my home (/home) partition located on /dev/sda2.

I want to move my root partition (/dev/sda9) to /dev/sda5. So I copy my root partition to /dev/sda5 use command

sudo dd bs=4M if=/dev/sda9 of=/dev/sda5 status=progress

After I run this command I got:

$ lsblk -f

sda                                                                                          
├─sda1  ext4     1.0   EXT4sannRoot      a75c6f17-64e9-45c4-9147-7902dfe976af                
├─sda2  ext4     1.0   EXT4sannHome      8b402a67-e51d-46fd-866c-e974c9fbcb5b  124,8G    37% /home
├─sda3  swap     1                       3deea589-4946-47b4-8a62-fe9297dcf447                [SWAP]
├─sda4  vfat     FAT32                   B960-8CA5                             234,4M     7% /boot/efi
├─sda5  btrfs                            3f8da5ce-c652-41b6-b7a2-9dae87c1a637                
├─sda7  ext4     1.0   PrimeOS           e5d445e4-f59f-5158-b9c7-465f7009bc23                
├─sda8  btrfs          BTRFSsannExternal f77bddfe-f013-4629-9929-bf589a1591a5                
├─sda9  btrfs                            3f8da5ce-c652-41b6-b7a2-9dae87c1a637   12,6G    63% /
└─sda10 ext4     1.0   Dokumen           6fc80ec7-f9f9-43ff-ae69-8895d0f1a3a4    7,3G    20% /home/sann/Dokumen

I got the same partition UUID between sda9 and sda5.

The Question. How to get boot from /dev/sda5 instead of /dev/sda9 in the next boot.

1
  • You need to update your bootloader configuration file, whatever you use (lilo / grub) and change the references to the old root partition (device / label / UUID) for adequate references of the new. (you could also add them and offer the choice in a menu)
    – MC68020
    Commented Jun 29, 2022 at 9:53

1 Answer 1

1

I solved this after:

  1. Change my btrfs UUID to random by running btrfstune -u /dev/sdaX. Example: btrfstune -u /dev/sda5

  2. Then edit the fstab on /dev/sda5 in /etc/fstab

  3. And because I enable os-prober. I can easily run sudo update-grub

  4. Edit the root UUID on /boot/grub/grub.cfg. Then copy it and paste on /dev/sda5 grub.cfg

  5. Boot to /dev/sda5. Then run sudo update-grub

Because I want to use /dev/sda5 as grub host instead of /dev/sda9, I do:

$ sudo grub-install /dev/sda5
$ sudo update-grub

BTW, I am use UEFI/GPT

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .