Maui Forums

Full Version: [Solved] - "Convert" internal hdd NTFS partition to ext4 without losing data?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I deliberately wrote "Convert" rather than just Convert because i know this is not literally true in one step. However i was wondering if the following procedure would be considered reliable & safe [albeit i know it will be very slow].

Btw, i do know that the "proper" way to do this would be to backup all the hdd data, reformat the target partition as ext4, then restore all the data from backup. I do not unfortunately have any portable media large enough to hold all this data for a backup, but... because this 2TB hdd is less than half-full, i conceived the following plan whereby the hdd itself would become its own "temporary backup".

Rather than immediately launch into this, i felt it safer to ask others' opinions first.

Current hdd status:
[attachment=1198]

Possible Procedure:
1. use gparted to shrink sdb2 in ~half
2. create a temporary ext4 partition sdb3 in the new space
3. move* all the sdb2 data to sdb3
4. reformat sdb2 to ext4
5. move* all the data back from sdb3 to sdb2
6. delete sdb3
7. resize sdb2 back to its original size with gparted

* For the actual moving back & forth, would Dolphin be sufficient, or should i use rsync [or my newly installed GRsync]? Either way, would all file dates, properties & permissions be preserved?


Background:
Looking back to when i first setup this Linux Tower in 2015, i think i was crazy in choosing NTFS not ext4 for this HDD partition [all my SSD partitions are ext4]. I know that Windows cannot access Linux file-systems, though of course Linux can happily access Windows'. The largest files on the HDD are the many VDIs for my VirtualBox VMs [the VB pgm itself is & runs on my SSD in Maui, but i store the VMs themselves on the large HDD]. Two of my VMs are Win10, & i think now that back then i stupidly thought that whatever partition held Windows VMs had to be NTFS otherwise Windows would not work. Somehow that crazy thinking completely overlooked that Windows is merely a Guest OS running in a Linux-hosted VirtualBox instance, & so VB itself of course takes care of the file communications. Doh. Now that i have belatedly realised my original setup error from 2015, it occurred to me now to see if i could now change this HDD partition to ext4, hence this thread now. 
You don't have to move the data twice. Do it like this:
1. shrink NTFS disk to 1/2 size and create ext4 partition
2. move the data from ntfs to ext4
3. delete the ntfs partition and extend the ext4 to full disk size
Thanks Rocky

Yes, that's almost what i was going to write, but decided not to given that would create a new UUID hence affect my boot, whereas my cumbersome way would preserve the current UUID hence not jeopardise boot process. However now having just written that, i feel like i need to give myself another metaphorical forehead slap, given presumably running blkid then editing fstab would be just a teensy bit faster than my dual-move way. Silly me.

Did you have a view on my "would all file dates, properties & permissions be preserved?"?
(1st March 2017, 5:25)kdemeoz Wrote: [ -> ]Thanks Rocky

Yes, that's almost what i was going to write, but decided not to given that would create a new UUID hence affect my boot, whereas my cumbersome way would preserve the current UUID hence not jeopardise boot process. However now having just written that, i feel like i need to give myself another metaphorical forehead slap, given presumably running blkid then editing fstab would be just a teensy bit faster than my dual-move way. Silly me.

Did you have a view on my "would all file dates, properties & permissions be preserved?"?

If you do a rsync, then yes.
Thanks to both rocky & ali_deda for your posts since i last wrote. I had had to stay away from this task for quite a while, due to serious problems per my https://forums.mauilinux.org/showthread.php?tid=24237. However, that all seems to be behaving itself again now, so i wondered about maybe me trying this HDD task.

I confess though a sense of dread about this. As i wrote in my original post, "Two of my VMs are Win10". I really intensely dislike Win10, but given i do already have these VMs, & doing the upgrade from Win7 for one & via Insiders for the other, then resolving their Activations [all this was a couple of years back], were not trivial exercises, i'm loathe to possibly break them [lose their Activation] when/if i move their VMs to another partition. I'm not saying this problem would occur, i'm only saying i don't understand if it would, & so am now wondering if i should just leave well enough alone [which would be a pity, as i do like the idea of my HDD becoming ext4 instead of ntfs].

Does anyone here happen to know what the likely Win10 VM hazards might be, if i did do this procedure?
There are absolutely NO possible hazards to this, from perspective of Win10 VM. Since it is a virtual machine, you can move it wherever you want, you can even change the complete hardware on which it runs, it will make no difference. Virtual machines are made to be flexible and most of all easily movable. That Win10 VM will have NO IDEA that you have changed the underlying filesystem or disk.
Thanks muchly. That's exactly what i have been telling myself too, given the whole concept of VMs. However, that "common sense" view was having a tough time battling my countervailing arch-cynicism about Microsoft's sneakiness & determination to gouge money out of users. Hearing now a voice outside my own head also stating this, i think now i shall proceed with the HDD procedure as earlier documented... when time permits. Ta again.
Am happy to report that my procedure, with Rocky's improvement, worked perfectly well, & now this HDD is ext4 not ntfs, with no loss of data, & no broken VMs. Thanks, yay, phew.