Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

"Convert" NTFS partitions to ext4?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Storsnusarn^
Posts: 15
Joined: 2015-10-29 00:39

"Convert" NTFS partitions to ext4?

#1 Post by Storsnusarn^ »

I'm about to make a pretty big change in my lab-enviroment and are about to replace one of my long-going Windows Server installations with Debian. I have had so many reasons to switch to Linux 5 years ago, but now things really gonna happen. The only thing that has hold me back for such a long time is.the same reason i still woundering if the switch is possible today - i have a lots of NTFS-formatted partitions in this server, over 20 drives in various sizes from 160 GB up to 4 TB. Today i store about 25 TB across these drives and i don't have more than a few spare disks over (2 TB the biggest) and my wallet doesn't let me buy 30 TB new disks to just make things incredible easy so i've started to look for the next best solution.

I know that there is no way of direct converting between this two filesystems, but i look for a way to somehow automate or simplicify the process of creating an ext4 partition at the free space for each drive, move content of that size from the ntfs-partition, extend the ext4 partition a bit more and so on...
I'm aware that this process will be kinda time-consuming and many of the drives are really full. Some of my 4 TB drives only have a couple of MB left. I can ofc move stuff around a bit before the "convertion" but i will never have more than 20% free space on each drive, othervise i think doing everything in just 2 passes manually would have worked just fine, it doesn't matter if the server is offline for a week or two, i have a backup server already running so please don't hesitate to give me a tip even if it's gonna take a long time.

I have tried to just leave everything as NTFS and let ntfs-3g handle it but it feels much slower somehow than native ntfs when moving large files between the server and clients. Does anybody have specifikations on this? I'm only guessing that read and writespeeds impacts at least by 1/3 but thats just my personal experience, however - i will get a huge benefit of using ext4 instead of ntfs according to r/w speeds and (correct me if i'm wrong) be able to use chmod that's unsupported in ntfs.

Also as always, sorry for non-perfect grammar, english is not my first language.
Thank you!

andre@home
Posts: 398
Joined: 2011-10-02 08:00

Re: "Convert" NTFS partitions to ext4?

#2 Post by andre@home »

Borrowing one large TB disk would make your life more easy to move data, convert NTFS-> ext4 and then move data back...

Google around and you find several suggestions... like:
http://superuser.com/questions/399822/h ... in-windows
Actually there IS a way to do this. But unfortunately, only in Linux.

You could easily convert NTFS to ext2 or ext3 with the software anyconvertfs from anyfs-tools

Then you could convert it to ext4 using tune2fs
Other suggestions look at:
https://www.google.nl/search?client=ope ... ns+to+ext4

Storsnusarn^
Posts: 15
Joined: 2015-10-29 00:39

Re: "Convert" NTFS partitions to ext4?

#3 Post by Storsnusarn^ »

andre@home wrote:Borrowing one large TB disk would make your life more easy to move data, convert NTFS-> ext4 and then move data back...

Google around and you find several suggestions... like:
http://superuser.com/questions/399822/h ... in-windows
Actually there IS a way to do this. But unfortunately, only in Linux.

You could easily convert NTFS to ext2 or ext3 with the software anyconvertfs from anyfs-tools

Then you could convert it to ext4 using tune2fs
Other suggestions look at:
https://www.google.nl/search?client=ope ... ns+to+ext4
Thanks for your answer. I have found the above solution too but it seems difficult to direct convert from ntfs to ext2 without corrupting files. If i could borrow a 5TB or bigger drive it would be great, but it is hard to find anyone with that amount of (unused) space :). I found this after a bit more googling: http://askubuntu.com/questions/63022/co ... -ntfs-ext4 and the first answer seems to be exactly what i'm looking for:
askubuntu wrote:Just for the record, there is a software (actually, a mini-distro) that does exactly the procedure arrange said in enzotib's answer:

Parted Magic

It looks like a direct conversion from NTFS to ext4, but internally the procedures are:

Shrink the NTFS partition
Create an ext4 partition in the empty space
Move data from NTFS to ext4 until ext4 is full
If NTFS is empty (all data was moved), go to step 8
Shrink NTFS
Enlarge ext4
Repeat steps 3 to 6 until done
Delete NTFS partition
Move ext4 partition to NTFS' orignal place
Trim ext4 partition to NTFS' original size
So the more occupied your NTFS partition is, the longer it will take. If it is less than 50%, it will convert in one pass, in a single shrink-copy-enlarge iteration.

Although Parted Magic conveniently automates all of this, it is still essentially the same procedures described by arrange, so it is very risky and very time consuming. Backup-format-restore is much safer and much faster.
, the thing is - i have parted magic and i have worked a.lot with it, and there is nothing in the distro that comes even close to what's described so i have no idea what he's talking about. But the answer is the kind of answer i'm looking for, i guess this must be doable with some scripting but since i'm a newbie in scripting i'm not comfortable to try things on my own on such important files.

andre@home
Posts: 398
Joined: 2011-10-02 08:00

Re: "Convert" NTFS partitions to ext4?

#4 Post by andre@home »

Storsnusarn^ wrote:...Just for the record, there is a software (actually, a mini-distro) that does exactly the procedure arrange said in enzotib's answer:
............
Parted Magic
.......................
Although Parted Magic conveniently automates all of this, it is still essentially the same procedures described by arrange, so it is very risky and very time consuming. Backup-format-restore is much safer and much faster....

The thing is - i have parted magic and i have worked a.lot with it, and there is nothing in the distro that comes even close to what's described so i have no idea what he's talking about. But the answer is the kind of answer i'm looking for, i guess this must be doable with some scripting but since i'm a newbie in scripting i'm not comfortable to try things on my own on such important files.
So a clear conclusion seems to me... there is no other way to go sure than using another disk for backup while you convert the disk from the files you've backupped from NTFS to ext-type.

I guess not all disks are 5 TB.... so try to get a 2TB disk and do first all the disks that are max 2TB,
Ready? There will be some room left on all the disks that are done, so spread the data of the <2TB disk on the spare 2TB disk and on several others that are already ext3.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: "Convert" NTFS partitions to ext4?

#5 Post by dilberts_left_nut »

If they are not already backed up, then they really aren't that important to you, eh?
AdrianTM wrote:There's no hacker in my grandma...

Storsnusarn^
Posts: 15
Joined: 2015-10-29 00:39

Re: "Convert" NTFS partitions to ext4?

#6 Post by Storsnusarn^ »

andre@home wrote:
Storsnusarn^ wrote:...Just for the record, there is a software (actually, a mini-distro) that does exactly the procedure arrange said in enzotib's answer:
............
Parted Magic
.......................
Although Parted Magic conveniently automates all of this, it is still essentially the same procedures described by arrange, so it is very risky and very time consuming. Backup-format-restore is much safer and much faster....

The thing is - i have parted magic and i have worked a.lot with it, and there is nothing in the distro that comes even close to what's described so i have no idea what he's talking about. But the answer is the kind of answer i'm looking for, i guess this must be doable with some scripting but since i'm a newbie in scripting i'm not comfortable to try things on my own on such important files.
So a clear conclusion seems to me... there is no other way to go sure than using another disk for backup while you convert the disk from the files you've backupped from NTFS to ext-type.

I guess not all disks are 5 TB.... so try to get a 2TB disk and do first all the disks that are max 2TB,
Ready? There will be some room left on all the disks that are done, so spread the data of the <2TB disk on the spare 2TB disk and on several others that are already ext3.
Yes i guess you're right about that, i was just hopeful that some automated magic would do the trick :) i guess i will take the long and boring way after all, thx for your reply.
dilberts_left_nut wrote:If they are not already backed up, then they really aren't that important to you, eh?
I never said my files are not already backed up? I have tons of dvd's and usb-sticks all over the basement containing about 80% of all storage on my drives, but that's an even more painful way of restoring things from. The reason i went this way from the beginning was that software-raid on windows server is just a big mess, and raid-card with 10 or more sata/sas ports are really expencive. I plan to replace everything with larger disks in the future, then i will go with RAID-6. So yes - my files are pretty important.

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: "Convert" NTFS partitions to ext4?

#7 Post by dasein »

It would still require a "staging" drive, but you can use fsarchiver to both back up your NTFS data and then convert to ext when you restore it.

andre@home
Posts: 398
Joined: 2011-10-02 08:00

Re: "Convert" NTFS partitions to ext4?

#8 Post by andre@home »

Storsnusarn^ wrote:I never said my files are not already backed up? I have tons of dvd's and usb-sticks all over the basement containing about 80% of all storage on my drives, but that's an even more painful way of restoring things from. The reason i went this way from the beginning was that software-raid on windows server is just a big mess, and raid-card with 10 or more sata/sas ports are really expencive. I plan to replace everything with larger disks in the future, then i will go with RAID-6. So yes - my files are pretty important.
And RAID is not a backup solution... I've seen people loosing all data as a second disk in the RAID setup broke too very soon after the 1st one... so there was not enough time to rebuild the data coming from the RAID setup....

10 x SATA.... well thats a lot...
Well we've got 6 SATA and I can connect at least 4 SATA-> USB convertors in the free USB slots....so also 10... but much less expensive...
Works now since nov-2011. Have still 2-3 usb slots free (use 1 for the DVD station, but that is coming less important nowadays as most can also be doen by usb stick).

I use normal hard disks, most are 2TB some are 3TB working under Debian8.
Why not RAID?
Indeed generally more expensive... software RAID is not always reliable and for the reason above.
And... what ever happens to our server.. . we can hang and read our disks in any (Linux) system.... no worries about RAID and incompatibility on another motherboard...
We have duplicated the server complete, the 2nd server is on another location.
We use the spare disks to make a 3rd copy....

So we hope to minimize data loss in this comprehensive way...
Servers can be approached worldwide through webdav under https/443.

tomazzi
Posts: 730
Joined: 2013-08-02 21:33

Re: "Convert" NTFS partitions to ext4?

#9 Post by tomazzi »

andre@home wrote:Indeed generally more expensive... software RAID is not always reliable and for the reason above.
Since the hardware Raid does not exist in the reality (the HW Raid controllers are just small embedded systems with a software RAID, HW-accelerated for RAID levels 5-6/50-60), there's simply no difference in reliability. Usually, the only difference is in speed, but not in all cases.

Regards.
Odi profanum vulgus

Post Reply