You are not logged in.

#1 2017-10-21 20:05:00

slyr
Member
Registered: 2017-10-21
Posts: 22

[SOLVED] Migrate to a new partition on the same machine

Hello,
I installed arch linux months a go on dual boot with windows on a 60gb partition on my main HDD in my laptop, i really like arch linux and i used 100 % of the 60gb so i want to expand my partition. So i cloned my 60gb on a new free 120 gb partition that i made with gparted. How can i replace my old 60gb "Linux filesystem" 60 gb partition with the new clone 120gb parition. The two partitions have the same name,label and UUID except one is /dev/sda7 and the new one is dev/sda7
dev/sda7 is the partition that i want to replace with the new one /dev/sda8
Thank you

lsblk -f
NAME   FSTYPE LABEL      UUID                                 MOUNTPOINT
sda                                                           
├─sda1 vfat              D825-67C0                            /boot/efi
├─sda2                                                        
├─sda3 ntfs   OS_Install 9E367B62367B39FB                     
├─sda4 ntfs   Data       F878E81578E7D104                     
├─sda5 ntfs   BIOS_RVY   EEBE8118BE80DA8B                     
├─sda6 swap   Linux Swap bbb0d6de-67d1-4a3e-ba00-b3a1dc0c2b30 [SWAP]
├─sda7 ext4   Arch Linux 12a50063-776f-4350-9254-98cf42303874 /
└─sda8 ext4   Arch Linux 12a50063-776f-4350-9254-98cf42303874 
sr0      

Last edited by slyr (2017-10-22 15:32:08)

Offline

#2 2017-10-21 22:26:06

fuyuki
Member
Registered: 2017-10-20
Posts: 23

Re: [SOLVED] Migrate to a new partition on the same machine

Why did you not just use Gparted to expand sda7 by 60GB?

Alternatively, you could have chosen to copy (cp -ax) one of your larger directories (a common choice is /home or the equivalent on your system) to sda8, checked to make sure everything copied over correctly, then emptied the directory on sda7 and mounted sda8 in its place.

Last edited by fuyuki (2017-10-21 22:27:21)


Arch | amd64 | rEFInd | OpenRC | MATE | PulseAudio

Offline

#3 2017-10-22 00:25:18

slyr
Member
Registered: 2017-10-21
Posts: 22

Re: [SOLVED] Migrate to a new partition on the same machine

hi,
can you expand with gparted a mounted disk ? i tried the resize option but it had a maximum size.
Thanks for your solution but right now im trying to regenerate the fstab and reconfigure the grub so that it will boot my new partition,
I think i messed up because grub is not booting anymore, but windows even if i reinstalled grub and regenerated the grub.cfg with grub-mkconfig

Offline

#4 2017-10-22 00:42:12

fuyuki
Member
Registered: 2017-10-20
Posts: 23

Re: [SOLVED] Migrate to a new partition on the same machine

slyr wrote:

hi,
can you expand with gparted a mounted disk ?

Maybe not, but you can run Gparted on startup without booting Arch.

https://gparted.org/livecd.php

Though it's called a livecd, you can install it to the hard drive or make it bootable from the drive with uNetbootin as well. (Or simply run it from Windows.)

I would recommend erasing one of the two partitions (probably sda8) with Gparted (or any Windows-based partition manager) and trying to reinstall/configure grub after.

Last edited by fuyuki (2017-10-22 00:46:16)


Arch | amd64 | rEFInd | OpenRC | MATE | PulseAudio

Offline

#5 2017-10-22 00:48:08

slyr
Member
Registered: 2017-10-21
Posts: 22

Re: [SOLVED] Migrate to a new partition on the same machine

hi, thanks for your reply
yeah thats what i did for now, i deleted the my old 60gb partition
so now im left with the 120gb cloned /dev/sda8
i dont seem to find what i missed in the installation process for the grub not booting anymore
i created a new swap partition
i mounted /dev/sda8 on /mnt
i mounted my efi partition on /mnt/boot/efi
i generated the fstab, with genfstab -U /mnt >> /mnt/etc/fstab

then i ran mkinitcpio -p linux
and i did grub-mkconfig -o /boot/grub/grub.cgf while on chroot
and finally i did grub-install /dev/sda
i also reinstalled the base package in /mnt in case something was missing
am i doing something wrong, grub should boot from this, i cant understand
yeah i also removed os-prober cause it was giving an error while running grub-mkconfig

Offline

#6 2017-10-22 00:57:01

fuyuki
Member
Registered: 2017-10-20
Posts: 23

Re: [SOLVED] Migrate to a new partition on the same machine

It would be quicker to just look in your fstab and boot partition/config to see if there are any conflicts.

Such as having two or more references to the same UUID, for example. Or references to /dev/sda7 when your root is now /dev/sda8.

Last edited by fuyuki (2017-10-22 00:57:44)


Arch | amd64 | rEFInd | OpenRC | MATE | PulseAudio

Offline

#7 2017-10-22 01:11:33

fuyuki
Member
Registered: 2017-10-20
Posts: 23

Re: [SOLVED] Migrate to a new partition on the same machine

Sorry, just noticed this.

slyr wrote:

and finally i did grub-install /dev/sda

If you're using EFI (which I cannot imagine why you'd have a /boot/EFI partition otherwise) you are not installing grub to an MBR. Read this: https://wiki.archlinux.org/index.php/GR … allation_2.

Last edited by fuyuki (2017-10-22 01:35:03)


Arch | amd64 | rEFInd | OpenRC | MATE | PulseAudio

Offline

#8 2017-10-22 01:41:35

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] Migrate to a new partition on the same machine

Did you arch-chroot before creating the initrd and installing the boot loader?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2017-10-22 01:49:13

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Migrate to a new partition on the same machine

Not an installation issue. Moving to Newbie Corner.

FYI, the Arch ISO comes with tools which can resize filesystems and partitions.

As for Grub, what error do you see? You need to give us more information.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#10 2017-10-22 01:54:47

fuyuki
Member
Registered: 2017-10-20
Posts: 23

Re: [SOLVED] Migrate to a new partition on the same machine

fsckd wrote:

FYI, the Arch ISO comes with tools which can resize filesystems and partitions.

Though the bootstrap doesn't, if they used that instead.


Arch | amd64 | rEFInd | OpenRC | MATE | PulseAudio

Offline

#11 2017-10-22 04:03:11

slyr
Member
Registered: 2017-10-21
Posts: 22

Re: [SOLVED] Migrate to a new partition on the same machine

fuyuki wrote:

Sorry, just noticed this.

slyr wrote:

and finally i did grub-install /dev/sda

If you're using EFI (which I cannot imagine why you'd have a /boot/EFI partition otherwise) you are not installing grub to an MBR. Read this: https://wiki.archlinux.org/index.php/GR … allation_2.

Thank you very much everyone for your help, i managed to boot my new cloned partition. I firstly cleaned my efi partition that had like 3 grub installed in it lmao.
Yeah i finally figured out that i need to run the grub-install with the target x86_64 since im using EFI.
everything is working fine now, do i delete this thread or mark it as solved ?
thanks

Offline

#12 2017-10-22 04:06:18

slyr
Member
Registered: 2017-10-21
Posts: 22

Re: [SOLVED] Migrate to a new partition on the same machine

fsckd wrote:

FYI, the Arch ISO comes with tools which can resize filesystems and partitions.

So i was able to resize my partition without cloning it into a bigger one ? i searched how but couldnt find, can you tell me which tools can do that if you please ?

Offline

#13 2017-10-22 06:32:47

NuSkool
Member
Registered: 2015-03-23
Posts: 297

Re: [SOLVED] Migrate to a new partition on the same machine

I've used rsync. Not sure it's on the install iso though.       https://wiki.archlinux.org/index.php/rs … em_cloning


grep -m1 'model name' /proc/cpuinfo : AMD Ryzen 7 8745HS w/ Radeon 780M Graphics
grep -m1 'model name' /proc/cpuinfo : AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics grep -m1 'model
grep -m1 'model name' /proc/cpuinfo : AMD Ryzen 7 PRO 5850U with Radeon Graphics
grep -m1 cpu /proc/cpuinfo                 : MIPS 24Kc V7.4

Offline

#14 2017-10-22 13:28:44

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] Migrate to a new partition on the same machine

slyr wrote:

everything is working fine now, do i delete this thread or mark it as solved ?
thanks

Edit your first post and add '[solved]' to the subject line.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#15 2017-10-22 13:29:21

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Migrate to a new partition on the same machine

slyr wrote:
fsckd wrote:

FYI, the Arch ISO comes with tools which can resize filesystems and partitions.

So i was able to resize my partition without cloning it into a bigger one ? i searched how but couldnt find, can you tell me which tools can do that if you please ?

Cloning duplicates a filesystem. It does not resize anything.

To make your filesystem larger, first you resize the partition, using a tool like fdisk. (Remember to tell the kernel the partition size changed.) Then, resize the filesystem itself. The tool for this is specific to the type of filesystem used. For ext4, use resize2fs.

Last I checked, the ISO comes with parted which can do these things for you.

See the manuals for the specifics on how to use the tools I mentioned.

If you have the solution you seek, remember to mark this thread as solved.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#16 2017-10-22 13:57:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] Migrate to a new partition on the same machine

slyr wrote:
fsckd wrote:

FYI, the Arch ISO comes with tools which can resize filesystems and partitions.

So i was able to resize my partition without cloning it into a bigger one ? i searched how but couldnt find, can you tell me which tools can do that if you please ?

This used to be in the wiki, but if the information is still there, I can't find it either. I can only find the procedure for LVM and LVM-on-LUKS, which seems very odd. Especially weird since enlarging partitions is generally safe and straightforward, provided the file system supports it (as ext4 does). You just need some guidance for adjusting the partition table, if not using LVM, but that information seems no longer to be there (or no longer to be easily findable).


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#17 2017-10-22 18:29:57

fuyuki
Member
Registered: 2017-10-20
Posts: 23

Re: [SOLVED] Migrate to a new partition on the same machine

I think their problem was that the Arch partition was marked as "busy" and so Gparted didn't want to modify it, so they cloned it and modified that one instead.

It's technically a workable solution, but obviously overkill and not the best one besides. Better to boot into Gparted, into a live disc with parted, or start any partition manager from Windows.

Last edited by fuyuki (2017-10-22 18:31:10)


Arch | amd64 | rEFInd | OpenRC | MATE | PulseAudio

Offline

Board footer

Powered by FluxBB