LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change file system, no dataloss? (https://www.linuxquestions.org/questions/linux-newbie-8/change-file-system-no-dataloss-297158/)

Moist 03-03-2005 09:30 AM

Change file system, no dataloss?
 
Is there a way for me to change the file system of my linux partition without data loss? I want to change my file system from reiserfs to fat32 and I really don't feel like re-installing. If not i guess i'll just copy all my necessary files to my window partition and re-install with fat32 in the first place.

pcardout 03-03-2005 09:50 AM

Opinion
 
I hope someone else comes along and tells you a way to do this without data loss. I don't think you can. When you touch the file system in such a major way, I think you'll lose everything.

The rest of my ramblings are really just to convey that if you want to mess with file systems a lot, make a lot of partitions so you only mess up one at a time!! Low level file system stuff is the trickiest, because you simply can't hold onto your data if you're going to trash the file system. However you
can do anything you want to one partition without messing up another. One thing you may be able to do is to repartition your drive right now (cfdisk) and make the partition you already installed Linux on (reiser) smaller while protecting the Linux install. Then you can make the rest of the drive (shudder) FAT32.
OK ... read on.

FAT32 is a terrible file system for reliability. I'm not just bashing Microsoft. NTFS is much better than FAT32. Why don't you at least change to NTFS, since it sounds like you need Windows to see your drive. I'd also recommend a few partitions just for Linux. At the very least, your 5 GBytes of Linux boot partition and /home could be reiser or ext2. It will do Windows no good
to look at your Linux system files anyway. (Ext2 and Ext3 -- journaling file systems, are much more protected against unexpected shut-downs and power outages.) On the assumption that you have a nice large hard drive, I'd reserve out 20-40 GBytes or so in an extra partition "for later". You don't need to format it now, or if you do, you can change your mind about the file system on it later (so long as you can lose what you wrote!). As your Linux skills improve, you'll be able to install one, or even multiple different distros in that reserved partition, and Windows won't get hosed when you do it. ALSO, Linux is more than happy to mount a Windows drive, so you can have your NTFS partition for Windows and then you can mount it onto your LinuxFS and poke around in it, even though all your other partitions are reiser or some such.

Moist 03-03-2005 10:07 AM

I'm not really concerned about windows being able to read my linux partition, but the thing is, when i installed linux I didn't give it much space, only around 3 gb thinking that i would never really do much with big files, needless to say, i was wrong.

So i unallocated about 5gb from my windows partition using partition magic, and i was planning on adding it to my main Linux partition so i could actually add more of the packages that came with suse The problem being that partition magic doesn't appear to be capable of modifying a reiserfs partition (This is why i wanted to change my file system, probably a bad reason) and i don't know how to add my unallocated space to the linux partition, which i suppose would be the best solution.

I'd really rather not have another drive to use as my "file" drive, that's just a concept that's always bothered me.

Edit:: I was going to go with fat32 because i've heard bad things about linux compatability with ntfs, but if it's fine that would be my choice.

pcardout 03-03-2005 01:54 PM

WIN NTFS Support
 
You've done your homework, sir. I poked around after your reply and your concerns about NTFS are worthy (I'd forgotten about that). I just cfdisked my brand new Gentoo system and cfdisk definitely supports NTFS ... however I found a disturbing post from 2003 as follows:

" ntfs write is not supported yet. if you can read it then you can copy it. you should check your linux permissions."

I think this has been fixed, but I wouldn't bet YOUR system on it. I generally do all Linux or all Windows machines, and when I did a dual boot machine about 18 months ago, I used WinME and FAT32 for reasons similar to yours.

As far as your problems w/ partition magic, you need a Linux boot CD (Gentoo live disk, Knoppix Live disk, Debian ... most distros have them). Once you have booted from CD, you can
use Linux CFDisk and change your partitions (I can't imagine it would conflict w/ system commander, because you are rewriting the MBR so system C. should be completely gone once you do
Linux cfdisk). In this way, you can change your 5 GBytes to Reiser.

I assume this isn't your first Linux system, but if it is and you are dual booting just to get a feel for Linux, you might try Knopppix. It's a live CD that's loaded up w/ all the goodies (open office, image editing, browsers some games). You can
run Knoppix all you want w/o touching your Windows drive or
getting involved w/ partitioning at all. (Of course, Knoppix does run kind of slow because of all
that CD accessing, so you will get impatient and want a hard
drive install at some point.)

Moist 03-03-2005 05:19 PM

Well, I figured out that i can change the size of a current partition from Yast, however, it's probably not a good idea to change the size of a currently mounted partition, So if i can find a way to run YAST while not having my main partition mounted my problem would be simple to fix, however i'm not sure if this is possible.

Is CFdisk capable of modifying the size of currently existing partitions? I booted using the suse rescue system, but it only had fdisk which, as far as i can tell, can't modify currently existing partitions. however, it is capable of creating new ones out of my unused space, which is not exactly what I want.

Also, This is actually my first Linux system, and i'm running it because, quite simply, it runs better then windows (I've already "Got a feel for it"), however i still prefer to run my windows applications in their native environment.

pcardout 03-03-2005 05:47 PM

fdisk / cfdisk
 
Well you're doing really well for your first system!

cfdisk is just a different interface to fdisk, as I recall. Capabilities are identical. You are right that it can't "resize" existing partition, but what it can do
is delete it and create a new one that uses the original space + more. This action by itself will not erase your existing data. because rewriting the master
boot record does not affect any other data. Unfortunately that fact is mostly of academic interest, because, trying to format the new larger
space with reiser or ext2 or ext3 WILL erase your data.

So you are back to ... "resize w/o data loss?" ... and the answer is "no" ... except, I suppose, if you were going to do it all w/ partition magic ... but even then
you are changing from reiser to FAT32 ... that will for sure cost you access to all your data.

So there is one more hope.

I expect you haven't installed much that you care about. Delete what you don't care about and then use "df" to see how much data you actually have.
If it's only a few hundred megs or 1 GByte, you could create and format a temporary partition, copy all of your data to that, then go ahead and wipe
your current partition, grow it, format it, and then copy the old data back to it. (Sounds like a lot of work!) Or ... if you have gotten CD's or USB working you
can back up onto those media and then use ALL the remaining space for a new partition.

Moist 03-03-2005 06:37 PM

Well, I saw that it's possible to run Yast from the Suse install disks, so i attempted to increase the size from there. It didn't work. So I ended up with a corrupt partition, now i'm doing a fresh install and chalking it up to experience ;) you're right that i didn't have much of importance on there, otherwise i'd be pretty upset about this whole situation. Thanks for the (attempted) help:D hopefully i won't run into this kind of trouble in the future, but judging from my way of dealing with computers, this is the first in a very long line of re-installs :P

pcardout 03-04-2005 08:00 PM

You are welcome. It seems to me like you are really taking to Linux. I think you'll do very well.
I'm pretty busy right now, but I recreationally dip into LQ from time to time and I always learn
something myself.

A long line of reinstalls ... you bet, but if your drive is partitioned right and you reserve some
"play space" for yourself and keep your /home partition separate from /boot, you can reinstall to
your heart's content as you learn more w/o losing your /home data again..

If you ever rewrite your MBR accidentally, or even wipe out a partition w/ fdisk, so long as you
fix it in short order and do not recreate the filesystem after you do, your data will still be there.

One of the nice things about fdisk also is that you can mess with your partition table all you want
conceptually, but until you hit "Write changes to disk" your MBR is safe.

wpn146 03-07-2005 12:21 PM

Re: Change file system, no dataloss?
 
Quote:

Originally posted by Moist
Is there a way for me to change the file system of my linux partition without data loss? I want to change my file system from reiserfs to fat32 and I really don't feel like re-installing. If not i guess i'll just copy all my necessary files to my window partition and re-install with fat32 in the first place.
What do you consider to be "data loss"? Any Unix based file system will lose ownership and permission related attributes when stored to a windows file system. Some files will have to have their names modified to meet the rules of the new file system. For example, the file name "z:abc" is a file "z:abc" on Unix but a file "abc" on drive "z:" on windows.

IsaacKuo 03-07-2005 12:37 PM

Skimming this thread, I have a few notes:

1. Do NOT convert your Linux partition to FAT32. Do NOT convert it to NTFS. Don't do it! It won't work! For Linux to run, it needs to be run on a file system capable of handling Unix style file permissions. Neither FAT32 nor NTFS support them.

2. Try using QTParted instead of Partition Magic to resize your partitions. Your real problem seems to be that you're wanting to resize your Linux partition.

Download a Knoppix style liveCD like Knoppix of Mepis. Those both include QTParted, which is an open source Partition Magic clone. With a liveCD, you can boot the entire OS straight from CD, so you don't need to mount any hard drive partitions. This gives you full freedom to manipulate the drive partitions.


All times are GMT -5. The time now is 11:03 AM.