Switching drive from NTFS to ext4 (or something else)
Switching drive from NTFS to ext4 (or something else)
Hi, I was recently backing up some files in MX Linux and encountered some strange errors from my backup software.
I have several external 'source' drives using NTFS, these are then backed up to other various drives, also using NTFS.
I generally don't store files on the same drive as my OS.
I suspected the error with the backup software was related to the NTFS file system.
To check these errors I had to connect the drive to a Windows PC to run chkdsk; sure enough it found the errors and repaired them.
I don't want to connect the drive to Windows to repair it, and I am now ready to switch these drives to a Linux friendly format anyway.
I have read about a few file systems and have decided ext4 should be suitable.
I don't care about compatibility with Windows or Mac OS etc. I will have a separate drive for anything specific to those.
As I understand ext4 is quite similar to NTFS in some regards (journaling etc.) so I am wondering if anyone has any advice or anything I should worry about regarding the moving of the files?
Also, I am used to running chkdsk on NTFS drives on occasion. Is there an equivalent for ext4?
I vaguely remember using fsck in Mac OS X, but trying to find a definitive explanation of the commands available is quite difficult with the internet in the state that it is currently in.
I am open to any advice :-)
I have several external 'source' drives using NTFS, these are then backed up to other various drives, also using NTFS.
I generally don't store files on the same drive as my OS.
I suspected the error with the backup software was related to the NTFS file system.
To check these errors I had to connect the drive to a Windows PC to run chkdsk; sure enough it found the errors and repaired them.
I don't want to connect the drive to Windows to repair it, and I am now ready to switch these drives to a Linux friendly format anyway.
I have read about a few file systems and have decided ext4 should be suitable.
I don't care about compatibility with Windows or Mac OS etc. I will have a separate drive for anything specific to those.
As I understand ext4 is quite similar to NTFS in some regards (journaling etc.) so I am wondering if anyone has any advice or anything I should worry about regarding the moving of the files?
Also, I am used to running chkdsk on NTFS drives on occasion. Is there an equivalent for ext4?
I vaguely remember using fsck in Mac OS X, but trying to find a definitive explanation of the commands available is quite difficult with the internet in the state that it is currently in.
I am open to any advice :-)
Re: Switching drive from NTFS to ext4 (or something else)
Hello tobyo,
You can use fsck on most any linux system, but the partition must be un mounted first here is a tutorial that will guide you in it's usage.
https://phoenixnap.com/kb/fsck-command-linux
I think in your use case Ext4 would be the best format. Since it's been around awhile and is stable. Good luck and enjoy!
You can use fsck on most any linux system, but the partition must be un mounted first here is a tutorial that will guide you in it's usage.
https://phoenixnap.com/kb/fsck-command-linux
I think in your use case Ext4 would be the best format. Since it's been around awhile and is stable. Good luck and enjoy!
Re: Switching drive from NTFS to ext4 (or something else)
Thank you kc1di that link is great.
Assuming you are using ext4, do you scan your drives often?
Assuming you are using ext4, do you scan your drives often?
Re: Switching drive from NTFS to ext4 (or something else)
Not too often hardly ever find an error. As I said ext4 is very stable. Of course drives can wear out. Especially spinners.(0ld ones) All my drives are now SSD's .They give me very little trouble. They also all have auto trim enabled also so that keeps them somewhat in line also.
Re: Switching drive from NTFS to ext4 (or something else)
Thanks, as long as I have backups I have piece of mind :-)
Interesting you mentioned auto trim, do you know if MX Linux does this by default?
Is it something you have to enable per drive?
Interesting you mentioned auto trim, do you know if MX Linux does this by default?
Is it something you have to enable per drive?
Re: Switching drive from NTFS to ext4 (or something else)
Only if your booting in systemd. If not you can run it manually with this command.
if that one does not work use this one
on the second command replace the / with /dev/sdxxx (deriver desigantor)
Code: Select all
sudo fstrim -av
Code: Select all
sudo fstrim -v /
on the second command replace the / with /dev/sdxxx (deriver desigantor)
Re: Switching drive from NTFS to ext4 (or something else)
Thank you again kc1di!
I am starting the process today.
I am keeping some specific drives as exFAT for compatibility.
I have been using F2FS with some USB sticks etc. which seems to be quite efficient.
I am starting the process today.
I am keeping some specific drives as exFAT for compatibility.
I have been using F2FS with some USB sticks etc. which seems to be quite efficient.
Re: Switching drive from NTFS to ext4 (or something else)
Let us know how it works out.tobyo wrote: Wed Oct 23, 2024 6:28 am Thank you again kc1di!
I am starting the process today.
I am keeping some specific drives as exFAT for compatibility.
I have been using F2FS with some USB sticks etc. which seems to be quite efficient.
Re: Switching drive from NTFS to ext4 (or something else)
Thanks kc1di
Phew, just finished backing my drives.
First I formatted my first ext4 drive using GParted; except once completed I realised the owner is then set to root.
I found this article: 'Format ext4 filesystem to be owned by regular user'
https://mxlinux.org/wiki/system/format- ... ular-user/
I ran the command but it complained that the drive was mounted so first I added: umount /dev/sda1
Then I ran the command again, this appeared to work but the drive was not being read by the OS and it couldn't determine the size.
So then I discovered the Format USB Drives tool and ran this; it failed with an unknown error.
I ran GParted again and wiped the drive again; with the owner as root (as expected).
Then I ran Format USB Drives again, this time it worked! But then I noticed it defaulted the partition type to msdos (not gpt).
So I ran it again, this time changing the partition style from default to gpt, and success!
However I now have a question: is the drive owner now specifically associated with my particular user, or is it to a group e.g. any admin?
In other words if I connect the drive to a different computer with a different user or even a different distro like Fedora etc. can I still copy files to the drive without some messing about?
I am currently copying my files from my NTFS backup to the ext4 drive.
Phew, just finished backing my drives.
First I formatted my first ext4 drive using GParted; except once completed I realised the owner is then set to root.
I found this article: 'Format ext4 filesystem to be owned by regular user'
https://mxlinux.org/wiki/system/format- ... ular-user/
I ran the command but it complained that the drive was mounted so first I added: umount /dev/sda1
Then I ran the command again, this appeared to work but the drive was not being read by the OS and it couldn't determine the size.
So then I discovered the Format USB Drives tool and ran this; it failed with an unknown error.
I ran GParted again and wiped the drive again; with the owner as root (as expected).
Then I ran Format USB Drives again, this time it worked! But then I noticed it defaulted the partition type to msdos (not gpt).
So I ran it again, this time changing the partition style from default to gpt, and success!
However I now have a question: is the drive owner now specifically associated with my particular user, or is it to a group e.g. any admin?
In other words if I connect the drive to a different computer with a different user or even a different distro like Fedora etc. can I still copy files to the drive without some messing about?
I am currently copying my files from my NTFS backup to the ext4 drive.
- DukeComposed
- Posts: 1400
- Joined: Thu Mar 16, 2023 1:57 pm
Re: Switching drive from NTFS to ext4 (or something else)
Disk drives don't have a concept of ownership. Some file systems, including ext4, preserve permissions as a combination of user ID, group ID, and mode.tobyo wrote: Wed Oct 23, 2024 11:38 am However I now have a question: is the drive owner now specifically associated with my particular user, or is it to a group e.g. any admin?
In other words if I connect the drive to a different computer with a different user or even a different distro like Fedora etc. can I still copy files to the drive without some messing about?
On Linux the first user account is usually given UID 1000. So if I create a whole file tree on an external USB drive formatted with an ext4 partition, those files will have my default UID of 1000 unless I specifically change it.
When I export that drive and attach it to a different machine, I will typically need root permissions to mount it. Let's say I mount it under /mnt. That machine can now read the files on that ext4 partition, including the UIDs, GIDs, and modes of those files.
The UIDs and GIDs will all still be the same. So if my UID on the first machine was 1000, the user with UID 1000 will be the owner of those files on the second machine whether that's me or not. This isn't a problem if and only if my user account has UID 1000 on both machines. If my UID on one machine is 1234 and on the other it's 5678, the machines will enforce standard UNIX user and file mode permissions, even though I'm the only individual creating or reading those files.