LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   ntfs->fat32 (https://www.linuxquestions.org/questions/slackware-14/ntfs-fat32-613955/)

ahmed gamal 01-16-2008 07:06 AM

ntfs->fat32
 
hi every body
i have a problem
i want to changa a windows drive (ntfs) to fat32 from my slackware
without losing the files on the ntfs drive
i know that i can make this with partion magic
but i want to make it on my little slack
any suggestions?

acid_kewpie 01-16-2008 07:16 AM

converting two proprietary file systems based on reversed engineernig of protocols, if you would trust that, you're nuts, and i'm pretty sure it's also totally impossible within linux anyway, as it should be.

pixellany 01-16-2008 07:27 AM

I am not sure it is possible from anywhere to change the filesystem while preserving all the data.

Please tell us why you want to do this. There might be a better way to get to the final goal. (In American slang: What swamp are you trying to drain?)

mcnalu 01-16-2008 07:58 AM

It is possible, but you need to do it from Windows using
an app like Partition Magic. I've done fat32->ntfs that way
on an empty, brand new USB drive.

If going the opposite way, remember that fat32 has various
restrictions that ntfs doesn't have. For example,
there's a file size limit on fat32 (2Gb or 4Gb, can't remember which?).

A better approach would be to create a fat32 partition and then copy
files from your existing ntfs partition. I don't know if that
can be done from linux.

Good luck!

Andrew

Dinithion 01-16-2008 08:12 AM

Another thing worth mentioning is the size limit of fat32 itself. One fat32 partition cant be larger then 32GB. And that isn't very much these days. So if your NTFS partition is larger then 32GB it will be impossible with linux, windows, <insert os/application here>.

drumz 01-16-2008 08:17 AM

Quote:

Originally Posted by Dinithion (Post 3024481)
Another thing worth mentioning is the size limit of fat32 itself. One fat32 partition cant be larger then 32GB.

That isn't true.

Quote:

Originally Posted by http://support.microsoft.com/kb/154997
FAT32 provides the following enhancements over previous implementations of the FAT file system:
• FAT32 supports drives up to 2 terabytes in size.

NOTE: Microsoft Windows 2000 only supports FAT32 partitions up to a size of 32 GB.

If you create the fat32 partition in linux, you won't have any problems. If you try to create it in Windows, then you might have problems (I've run into this before).

duryodhan 01-16-2008 08:28 AM

yeah, FAT32 limits the size of 1 FILE to 4gb .. so you can't keep all your 9gb dvd images in that drive.

Why do you want to convert ? Is space such a big issue? Copy it to a external drive (beg/borrow/steal from your friends) , and run mkfs.ntfs on that partition. That should be enough .

Dinithion 01-16-2008 09:03 AM

Quote:

Originally Posted by drumz (Post 3024487)
That isn't true.

Ops, my bad. I just remembered that is was a case back in the days when I used windows. That was before XP, and I used NT 4.0 until i changed, so I wasn't aware of that fix.

Thanks for pointing it out :)

Melkor 01-16-2008 09:39 AM

Quote:

Originally Posted by ahmed gamal (Post 3024410)
hi every body
i have a problem
i want to changa a windows drive (ntfs) to fat32 from my slackware
without losing the files on the ntfs drive
i know that i can make this with partion magic
but i want to make it on my little slack
any suggestions?

By far your best bet is to copy the stuff you want to save to a different drive or partition and format that NTFS drive and start fresh.

mattydee 01-18-2008 11:43 AM

My guess is that the op wants to setup a shared drive to be used with windows. If this is the case I would recommend using an ext3 partition and get the (open source) ext3 driver for windows.

shadowsnipes 01-18-2008 10:47 PM

Quote:

Originally Posted by mattydee (Post 3027272)
My guess is that the op wants to setup a shared drive to be used with windows. If this is the case I would recommend using an ext3 partition and get the (open source) ext3 driver for windows.

If the OP really just wants a shared drive I would instead recommend NTFS-3G. It works wonderfully. The only snag is that you need to make sure that Higher level folders on the partition have permissions set in Windows and that they will be inherited. This is because NTFS-3G doesn't do perms correctly. In Linux they are set as you set them for the partition, but in Windows new files and folders will by default be open for everyone. If you create a top level directory in Linux it is easy to fix the perms in [Edit] Windows later. If you use Linux mostly and care what Windows can access then this is the best way to go. If you use Windows mostly and don't care that it can touch your linux files then the ext3 driver would be the way to go.

Back to the original question, I don't think you can easily convert from NTFS to Fat32 directly in Linux. However, if you don't have partition magic and have a mostly empty NTFS partition you could use gparted (in Slackware if you want) to:

1) shrink the NTFS partition
2) create a fat32 partition with the new extra space (must be > size of data)
3) copy over the files from the NTFS partition to the fat32 partition
4) delete the NTFS partition
5) expand the FAT32 partition to reclaim the space you want

If I were to do this I would just use the gparted live cd, but you can use gparted in Slackware, so there you go.

mcnalu 01-19-2008 02:50 AM

Thanks shadowsnipes.

Now I have one less reason to have to reboot into windows :)

mattydee 01-19-2008 03:24 AM

Quote:

Originally Posted by shadowsnipes (Post 3027760)
If the OP really just wants a shared drive I would instead recommend NTFS-3G.

Closed source file system with a reverse engineered driver.

If you use ext3 you get an open FS with an open source driver.

Just something to think about... I'm assuming the OP was looking for a shared data drive, but who knows...

jay73 01-19-2008 04:15 AM

Using Linux file system drivers brings its own limitations. Good luck finding them for Windows XP64. Maybe ext2 but that's about it. I've been using ntfs-3g for over a year because it's the only option I have to access my xfs partitions. And it's not just XP64, similar limitations apply to Solaris and FreeBSD. FAT - and possibly ext2 - are the only failsafe options. I wish I had known that before as wiping and redoing several hundreds of gigabytes of data is not something that makes me go wild with enthusiasm.

ahmed gamal 01-19-2008 06:07 AM

i want to change the ntfs driver to fat32 so i make a share partition between my ntfs drivers of windows and linux
coz linux don't write to ntfs
:)

Alien_Hominid 01-19-2008 07:25 AM

linux writes to ntfs with ntfs-3g

brianL 01-19-2008 08:03 AM

Get the SlackBuilds for fuse and ntfs-3g:

http://slackbuilds.org/

shadowsnipes 01-19-2008 02:23 PM

Quote:

Originally Posted by brianL (Post 3028057)
Get the SlackBuilds for fuse and ntfs-3g:

http://slackbuilds.org/

That's exactly what I have been using for months and I can vouch that it works great. Not a single error and I've probably written/transfered at least a TB of data since I started using it.

mattydee 01-19-2008 03:09 PM

I feel like I should make the point again. Not to be stubborn, but I think it is important to Linux users in general. Do as you wish.

http://www.fs-driver.org/

I use this driver with a shared ext3 data partition with no problems. Since I am usually using Linux, this makes sense... why use ntfs (windows stuff) if you don't have to?

I only need ntfs-3g if for some reason I want to make changes to the windows root partition from Linux. This is probably what most people are essentially doing. They want to have their My Documents folder (or whatever) available rw in Linux, and is why everyone seems to be recommending this option.

Personally, I like to keep OS's seperate. Linux doesn't touch the windows partition (ro is ok) and vice versa, and the shared partition (ext3) is read-write to both Linux and windows.

Using an ext3 as a shared partition reduces the amount of windows stuff you have to use.

Alien_Hominid 01-19-2008 03:13 PM

mattydee, the problem is that you can't install windows in ext2/3, so you must use ntfs anyway, so why I shouldn't access it (e.g., scanning for viruses).

Quote:

Originally Posted by shadowsnipes
That's exactly what I have been using for months and I can vouch that it works great. Not a single error and I've probably written/transfered at least a TB of data since I started using it.

Did you check /var/log/messages. I get tons of skipping unrepresentable filename errors, still they don't corrupt the data, so no problem here.

mattydee 01-19-2008 03:20 PM

Quote:

Originally Posted by Alien_Hominid (Post 3028439)
mattydee, the problem is that you can't install windows in ext2/3, so you must use ntfs anyway, so why I shouldn't access it (e.g., scanning for viruses).

I didn't say you shouldn't access it. Only if you have to, in which case you will need ntfs-3g.

You're right, the root windows drive must be ntfs (or fat). However, there is no reason why you should set up a shared partition as ntfs. :)

mattydee 01-19-2008 03:25 PM

In fact, if you used ext3 as a shared partition, you could probably have triple acesss to it: win-linux-mac os. All using an open source file system.

shadowsnipes 01-19-2008 03:53 PM

Quote:

Originally Posted by Alien_Hominid (Post 3028439)
Did you check /var/log/messages. I get tons of skipping unrepresentable filename errors, still they don't corrupt the data, so no problem here.

I've honestly never had that. My root's screen session always tails messages and syslog so I'm always up to date. You could be having problems due to the mount options you are using or if you are using an old version of fuse or ntfs-3g. I'm currently using fuse-2.7.1 and ntfs-3g-1.1120.

@mattydee

as much as I like to promote the use of Linux and its file systems and open source software in general, I personally have a problem with giving Windows the ability to read Linux files. When you have programs or drivers on Windows that allow you to read Linux file systems there is pretty much nothing to stop Windows/Careless users/whatever from messing with your Linux files or even your boot partition for that matter. You have to be really careful how you set it up (perms, etc to the program/drivers). Otherwise, you open a big security hole in your system.

That being said, if you are really careful then using the ext3 driver can be great because then you can have correct finely grained permissions in Linux versus the scope offered by mount options.

However, the OP already has all his data in interest on a NTFS partition, so using NTFS-3G would be the easiest and (likely) safest option. On the Linux side care just needs to be taken to be sure that only users of a certain group can access the partition.

Alien_Hominid 01-19-2008 04:08 PM

When I think about it, the problem might be with non-English file names.

My ntfs-3g is 1.616 and fuse is 2.6.5.

mattydee 01-19-2008 04:43 PM

Quote:

Originally Posted by shadowsnipes (Post 3028486)
You have to be really careful how you set it up (perms, etc to the program/drivers). Otherwise, you open a big security hole in your system.

Just to be clear, I am advocating setting up the windows ext2 driver to access the shared partition, not the main Linux partition.

Despite this, being really careful is not a valid point in this case...

Say your root linux drive is ext3 (mine is not). Any windows user can dl the driver, double click to install and wreck havoc on your root linux partition no matter how you set it up... Or they can insert a live distro cd and do whatever they please.

Having windows (where users run as admin 99% of the time) on the machine is the weakness, not the ext2 driver. You shouldn't try to scare people away from that. Having a home desktop setting where users can control the boot process etc amounts to any user being able to do pretty much anything.

Allowing them windows access to a shared ext3 data partition is not a security problem. Allowing them access to your linux root part would be, but as stated above, they can pretty much allow themselves that access anyway, either as windows users with admin privileges or by messing around with the boot process.

If you want to be "really careful" you should start with much more fundamental security issues first, like locking down the boot process, and ensuring windows users don't run with admin privileges, but this is probably not worth the trouble for a home desktop.

I am assuming this is a home desktop, not a public computer where users get a choice of running either windows or Linux... ;)

PS: Sorry if I am distracting from the OP question, but I think it has already been answered, and I'm continuing this because I feel that this is turning into an interesting discussion (for me at least :) )

shadowsnipes 01-19-2008 06:08 PM

Quote:

Originally Posted by mattydee (Post 3028534)
Just to be clear, I am advocating setting up the windows ext2 driver to access the shared partition, not the main Linux partition.

Despite this, being really careful is not a valid point in this case...

Say your root linux drive is ext3 (mine is not). Any windows user can dl the driver, double click to install and wreck havoc on your root linux partition no matter how you set it up... Or they can insert a live distro cd and do whatever they please.

This depends on how your system is setup. Of course with physical access to the machine, you can always boot a live cd since resetting a BIOS is super easy. In windows, it is true that any user can download a driver program and access the files, but only if windows is setup to allow that (which sadly by default it is). I will give that ext3 software that you linked to credit for requiring admin privs to add drives. This is better than many driver programs which you just click to run (no installation needed). As I mentioned you would have to make sure your system prohibits such downloads.

Quote:

Originally Posted by mattydee (Post 3028534)
Having windows (where users run as admin 99% of the time) on the machine is the weakness, not the ext2 driver. You shouldn't try to scare people away from that. Having a home desktop setting where users can control the boot process etc amounts to any user being able to do pretty much anything.

Allowing them windows access to a shared ext3 data partition is not a security problem. Allowing them access to your linux root part would be, but as stated above, they can pretty much allow themselves that access anyway, either as windows users with admin privileges or by messing around with the boot process.

If you want to be "really careful" you should start with much more fundamental security issues first, like locking down the boot process, and ensuring windows users don't run with admin privileges, but this is probably not worth the trouble for a home desktop.

I am assuming this is a home desktop, not a public computer where users get a choice of running either windows or Linux... ;)

Yes, running Windows as admin all the time (without at least something like DropMyRights) is asking for trouble. However, just because the ext3 shared partition isn't the linux root doesn't mean it doesn't pose a risk to Linux. That really depends on what gets stored there and who uses it. I would definitely make sure no programs/config files that root uses, SUID programs, etc are allowed to run on there and I would make sure that any programs using those files didn't have any glaring security holes themselves.

Even if it is just some plain documents that you like to share there are problems on the Windows side. For instance, say it is a home computer and you have multiple users on Windows and Linux. If you use the ext3 driver permissions on the Linux side are great, of course, but on the Windows side there is no separation. Anybody, can access and modify any of the Linux partitions added to the drives with the Ext2 IFS program (or any partitions if allowed to download a different ext2 driver). This is true even if you had separate partitions to give each user their own shared space. The only thing you could really do is obscure which drives are available to the individual users by hacking the registry to hide drives they shouldn't access from explorer.

Now say, instead, you use the NTFS-3G driver in the same scenario. On the Windows side perms are great, of course, but on the Linux side you can pretty much only set perms for whole partitions. In this instance, however, you could at least set different perms for different partitions, thus allowing users to have their own personal shared space.

If this Ext2 IFS driver could be updated to allow settings perms on at least whole partitions like Linux does then it would be much more useful. However, in its current state it seems more useful for single user scenarios. As I mentioned before, what you choose depends largely on preference, which OS get used the most, and what setups you have for each.

In general, no matter what you do, security is always just a deterrent. If someone really wants to break in they will, though it just might take them longer and they might be more noticeable.

zux 01-21-2008 03:05 PM

I would never try to convert any filesystem to any if there was something worthy in it.
well at least not in windows. doing that a long time ago destroyed a lot of good data for me :)
windows box just hang up. since that time I always have been using at least 3 partitions one for linux and another for windows the third for all personal data.

I don't use windows alot so the data partition is ext3, and the driver works fine. it is always good to keep data on a separate partition anyway, that's not any OS root.

my data partition used to be fat32 a long time ago, but that was when i was mostly using windows, I made my life easier on linux by using ext3.

febriansasi 01-22-2008 12:43 PM

Quote:

Originally Posted by ahmed gamal (Post 3027977)
i want to change the ntfs driver to fat32 so i make a share partition between my ntfs drivers of windows and linux
coz linux don't write to ntfs
:)

You don't have to. Just install these packages :
1. ntfsprogs
2. FUSE
3. ntfs-3g
You can download the binary in linuxpackages.net, or the source in google.com (sorry :P I forgot)
For me it works. I can write in ntfs partition even as a normal user.

mattydee 01-22-2008 12:53 PM

@shadowsnipes

Makes sense. I hadn't thought of that approach.

Although you would only see added security if you locked down windows and created separate user partitions.

ahmed gamal 01-22-2008 01:08 PM

i found ntfs-3g 1.1 and 1.8 which one is more stable
and what is Fuse?

shadowsnipes 01-23-2008 09:50 AM

Quote:

Originally Posted by febriansasi (Post 3031580)
You don't have to. Just install these packages :
1. ntfsprogs
2. FUSE
3. ntfs-3g
You can download the binary in linuxpackages.net, or the source in google.com (sorry :P I forgot)
For me it works. I can write in ntfs partition even as a normal user.

I don't think ntfsprogs is required for ntfs-3g. It's a different project that does similar things. Besides, I think the main part of it is included in Slackware since it is a part of the kernel.

Quote:

Originally Posted by ahmed gamal (Post 3031613)
i found ntfs-3g 1.1 and 1.8 which one is more stable
and what is Fuse?

Currently, stable ntfs-3g is ntfs-3g-1.1120 and the latest test version is ntfs-3g-1.2121-RC. This is shown clearly on the ntfs-3g homepage. I don't know where you found 1.8.

"FUSE is a simple interface for userspace programs to export
a virtual filesystem to the Linux kernel." - exert from the FUSE slackBuild page. The page also links to the source and homepage for FUSE.

Similarly, here's the ntfs-3g slackBuild page that includes a link to the homepage and source.

Use the slackbuild to build and install fuse, and then do the same for ntfs-3g. You will then need to mount your ntfs drive as ntfs-3g type (versus vfat, ext3, etc).

If you are not sure how to use a Slackbuild please read the SlackBuild HowTo.

shadowsnipes 01-23-2008 10:08 AM

Quote:

Originally Posted by mattydee (Post 3031590)
@shadowsnipes

Makes sense. I hadn't thought of that approach.

Although you would only see added security if you locked down windows and created separate user partitions.

That's kind of a given isn't it? :)

For simplicity having separate user data partitions can be made transparent to the users using shortcuts and symlinks. I've done this before and people don't think anything about it. I don't generally recommend hacking Windows to point whole user profiles to a shared partition, however. Rather instead I share the "My Documents" and Desktop folders as that is what most users care about the most. Settings for most programs don't transfer over to Linux anyways, so it is pointless to share the rest of the profile. Programs like Firefox and Thunderbird are exceptions and I have developed methods to share those profiles successfully between Linux and Windows.

If you have a lot of users then you are talking about using a server that hands out your user profiles/data upon login (using LDAP and whatnot). This is what I've seen and used in University lab settings.

mattydee 01-23-2008 08:08 PM

Quote:

Originally Posted by shadowsnipes (Post 3032649)
That's kind of a given isn't it? :)

Not in the context of the ext2 driver... meaning if you don't lock down windows and create separate user partitions (which most don't in a home desktop environment) then there is no security difference between the 2 drivers.

So if you want to advocate the use of the ntfs-3g driver for a home user, then you need to stipulate that these steps must be taken in order to reap any of the security benefits.

I doubt Ahmed Gamal (or the average user) will bother with the extra steps, but I may be wrong. :)

shadowsnipes 01-23-2008 10:10 PM

@mattydee

no, I was just saying in general, for added security you need to lock down Windows. It's funny yet true.

mattydee 01-24-2008 10:12 AM

Quote:

Originally Posted by shadowsnipes (Post 3033308)
@mattydee

no, I was just saying in general, for added security you need to lock down Windows. It's funny yet true.

Oh ok, I see :)

I wonder if Vista is more secure... I think you need to enter your password for any admin operations, Ubuntu style, so I'm assuming ntfs perms would be respected.

(And like Windows, Ubuntu overwrites your mbr/boot-loader without permission when installing. But that's a whole other topic :) )

ahmed gamal 01-28-2008 12:57 AM

i tried it
it works very well
thanx for all
BUT.......
really i want to mount my drives so it can read and write automatically without typing
Quote:

mount -t ntfs-3g /dev/sda1 /mnt/windows

mattydee 01-28-2008 01:01 AM

Quote:

Originally Posted by ahmed gamal (Post 3037237)
i tried it
it works very well
thanx for all
BUT.......
really i want to mount my drives so it can read and write automatically without typing

Change or add the entry in /etc/fstab

ahmed gamal 01-28-2008 09:58 AM

i am sorry
i opened fstab
and see what is inside it
i don't know what to change ????????

shadowsnipes 01-28-2008 11:23 PM

Look at the other lines in fstab and use a similar format. Imagine columns of attributes are separated by spaces of some amount. man mount to learn more about the options.

Here is an example of one I use for an external drive.

Code:

/dev/sda1      /mnt/P_COMPBKUP        ntfs-3g    defaults,noauto,gid=102,umask=007      0      0
Since it is an external drive I don't want it to be mounted at boot up (thus, the 'noauto'. Otherwise use 'auto'). The gid sets the group to the group with id 102, which is a special group I created on my machine for this kind of purpose. Look in /etc/group to find out what numbers correspond to which group. The umask changes what the perms will be (in this case owner and group will have rw and execute perms).

For an ntfs drive you can safely use 0's for the last two groups. You can read more about these and other options (including the useful user option) under the man page for mount.

So, simply use a text editor (such as pico) to edit the file (as root, of course) and add a single line with the settings you want for your mount point and then you are all set! If you don't use the auto option then you can manually mount the partition without specifying the options such as

Code:

mount /mnt/windows
If you want a normal user to be able to mount the partition you either need to make the user the owner of the partition, use HAL with some ntfs type plugin (so you can mount it with Konqueror, for instance), or use pmount, which is very similar to the mount command.

febriansasi 02-08-2008 07:05 AM

I know this is out of topics but I want to know can I change my filesystem to another without lose the data on it?
I use ext3 and I want to change to ext2.

shadowsnipes 02-08-2008 03:29 PM

Quote:

Originally Posted by febriansasi (Post 3050146)
I know this is out of topics but I want to know can I change my filesystem to another without lose the data on it?
I use ext3 and I want to change to ext2.

Just mount it as ext2 instead.

If you really must make sure the journal is gone you can
Code:

tune2fs -O ^has_journal /dev/your_hdd_partition
Only do this if the partition is unmounted. You should also fsck (-f) the partition afterwards.

It is a little more involved to do this if the filesystem in question is / as you have to boot into a LiveCD to take away the journal from /.

I suggest reading this document about ext2/ext3 conversions that I found with a quick Google search. You can ignore the initrd stuff unless you don't have the filesystem drivers built in your kernel.

febriansasi 02-11-2008 12:14 AM

Thanks, I ask this because I have problem with my harddisk. It always print something about dma error, after I read some posts, there's something about the kernel.

I recompile the kernel and seems no more problems.


All times are GMT -5. The time now is 03:16 PM.