stuck moving partitions

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
buteman
Level 4
Level 4
Posts: 331
Joined: Tue Nov 29, 2011 5:36 pm
Location: North Lincolnshire

stuck moving partitions

Post by buteman »

I have Mint 18.2 on my laptop and partitions were as follows:
sda1 / sda2 /home sda3 extended sda5 swap

Unfortunately I need to put Win 10 on the laptop to support a friend who lives too far away to visit much.
I decided I would move things about and put Win 10 on /dev/sda1
So I messed about with it and now have this

Code: Select all

 sudo fdisk -l
[sudo] password for buteman: 
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xf6a7b7cd

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1  *          2048  178190335  178188288    85G 83 Linux
/dev/sda2        178190336 1767235583 1589045248 757.7G 83 Linux
/dev/sda3       1767235584 3702228991 1934993408 922.7G 83 Linux
/dev/sda4       3702228992 3907028991  204800000  97.7G  5 Extended
/dev/sda5       3702231040 3886057471  183826432  87.7G 83 Linux
/dev/sda6       3886059520 3907028991   20969472    10G 82 Linux swap / Solaris
   
I used fsarchiver to clone sda1 and put it on sda5.
This has resulted in having 2 partitions with the same UUID.
At the moment it has booted and is using sda5 so I know it works.
What I intended to do is use fsarchiver to create a copy of sda2 which has /home on it, to an external drive and then clone it onto sda3.
After that I was going to delete sda2 resize sda1 to 100G and then resize sda3 to leave no room between it and sda1.
As I understand it at each boot it could pick sda1 or sda5 to boot and if I clone sda2 onto sda3 the same thing will happen.
I believe I could generate a new UUID for one partition but not sure what else I would need to do to make it work.
I also suspect that I could delete sda1 to cure that problem but not sure enough to risk it.
That means I am stuck.
Any help would be appreciated.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pierre
Level 21
Level 21
Posts: 13192
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: stuck moving partitions

Post by Pierre »

so, in all reality - - that's does mean moving those partitions, quite a bit
:?
and that's not such a good thing, though.
- yeah - - you can do that & it could just work A.ok,, but it's also risky, too.
maybe keep going, until it either works, or totally get's stuffed.

and if it does get totally borked, then you've both had some Fun & managed to play around, too.
- at this point, use Gparted to Totally Erase what you did, and then set-up a cleaner partition layout.

you'd most probably need 4 -5 partitions to cover any dual_boot scenario, like what you have in mind:
- 1 -2 for Win-10
- 2 -3 for LinuxMint
install the Win-10 first off, then follow with an LinuxMint installation.
8)

but, do have a go at achieving what you started out with.
:)
at least, that's what I'd be doing, if I've was yourself.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
buteman
Level 4
Level 4
Posts: 331
Joined: Tue Nov 29, 2011 5:36 pm
Location: North Lincolnshire

Re: stuck moving partitions

Post by buteman »

Okay so I thought I would try this bit by bit
I saw this link http://www.sudo-juice.com/how-to-change ... partition/
so did

Code: Select all

uuidgen
copied 6c4c4877-08b2-41b2-bf48-d9344e796ce2 which was the uuid generated then did

Code: Select all

sudo tune2fs /dev/sda1 - 6c4c4877-08b2-41b2-bf48-d9344e796ce2
sda1 was the partition I wanted to change the uuid of.
Rebooted and all was well.
So now I will use fsarchiver to copy what is on sda2 onto sda3 .
I will generate the copy onto my usb disc and then write it back out to sda3.
fsarchiver does do a compressed archive but the / archive was 5.3G from 18.7G of uncompressed data. I will then do the uuidgen bit for that.
I expect it will take some time to do that for 500G+ of data but I will post back here when it's done or screwed up :shock:
Just an update in case I forget later
Took 5 1/2 hours to create the compressed file it was 337.9GB and partition had 569.2GB on it. I'll leave the write to the other partition to run overnight
buteman
Level 4
Level 4
Posts: 331
Joined: Tue Nov 29, 2011 5:36 pm
Location: North Lincolnshire

Re: stuck moving partitions

Post by buteman »

Did the install of /home to /dev/sda3 and edited /etc/fstab to mount this instead of /dev/sda2
That worked without problems.
Deleted /dev/sda1
and then had to do the following from a live DVD

Code: Select all

mkdir mnt
sudo mount /dev/sda5 mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot mnt
grub-install /dev/sda
Rebooted all was fine again.
It would have been better to do the changes before deleting /dev/sda1 then I wouldn't have had to boot from a Live DVD.
Next will be to shrink /dev/sda2 , create sda1 again to 100G
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: stuck moving partitions

Post by fabien85 »

buteman wrote: Mon Mar 19, 2018 9:36 am so did

Code: Select all

uuidgen
copied 6c4c4877-08b2-41b2-bf48-d9344e796ce2 which was the uuid generated then did

Code: Select all

sudo tune2fs /dev/sda1 - 6c4c4877-08b2-41b2-bf48-d9344e796ce2
sda1 was the partition I wanted to change the uuid of.
If you just want to get a new random uuid, there is a much simpler solution : make sure the partition is unmounted (you may need to boot a live DVD for that), then open gparted, select the partition and Partition > New UUID and click the "apply all operations".
Otherwise, good job on getting everything working !
buteman
Level 4
Level 4
Posts: 331
Joined: Tue Nov 29, 2011 5:36 pm
Location: North Lincolnshire

Re: stuck moving partitions

Post by buteman »

Another update.
I now have about 150Gb of space for sda1
/home on sda2
sda3 has a copy of /home on it but isn't being mounted.
/ is on sda5.
Tried to install win10 on sda1 but it said it coudn't use it.
Deleted sda1 and tried again. Still would not use it as it needed efi gpt not mbr.
Had a look at various options and it looks like gdisk can do it.
Going on holiday so will leave it until I get back in 2 weeks.
Will try the conversion from mbr to gpt and see if that works then.
I have it all backed up so can start again if I have to.
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: stuck moving partitions

Post by fabien85 »

If you convert to GPT, you will need to reinstall everything from scratch.
You cannot dual-boot an OS in Legacy mode (your current Linux) and one in EFI mode (your planned windows).
Backup before anything indeed.
Locked

Return to “Installation & Boot”