Author Topic: Ext2/Ext3  (Read 1270 times)

badkarma

  • VIP
  • Member
  • ***
  • Posts: 497
  • Kudos: 0
Ext2/Ext3
« on: 21 March 2002, 15:38 »
Do you (or anybody else for that matter) know if I can change from a ext2 filesystem to a journaling file system (ext3/reiserfs) while keeping the data from my ext2 partition in a way which doesn't take  too long? (i.e. putting another HD in and making a copy of the partition is not an option, doing a reinstall neither)

I'm asking this because right now I'm writing a program (which plays an mpeg movie on a opengl texture) which has a nasty bug which keeps locking up my computer totally, and the filesystem check is driving me nuts    

I apologize in advance for not taking the time out to do a search on google and finding the information myself but this is for my work computer and seeing I'm a programmer and not a sysadmin it's not quite fair for me to take the time to find this out.

Thanks in advance  

[ March 22, 2002: Message edited by: BadKarma ]

If you can't learn to do something well, learn to enjoy doing it poorly.

iancom

  • Member
  • **
  • Posts: 103
  • Kudos: 0
Ext2/Ext3
« Reply #1 on: 22 March 2002, 03:17 »
From what you've said, it sounds like you've not got a convenient way of backing up your data (otherwise you'd just back it up, reformat your data partion as ext3 and then restore it..!). The following should work without corrupting your data, but it is *always* advisable to back up your data before doing anything with your filesystem. In fact it's advisable to back up your data regularly no matter what!

I must add that I've never actually tried this method, my ext3 filesystems have all been created either from the installation process or with mke2fs -j on a blank partition...

It would probably be a good idea to create a small test ext2 partition, put some data on it, convert it to ext3 and then verify that the data is intact before proceeding with your proper partition!


From the Linux ext3 FAQ (http://people.spoiled.org/jha/ext3-faq.html):

Q: How do I convert my ext2 partition to ext3? (was: How do I use ext3?)
Before you can mount a partition as ext3 you have to create a journal on it. The easiest way to do it is to type:

tune2fs -j /dev/hdaX

This can be done on an unmounted or on a mounted filesystem. If you create the journal on a mounted filesystem you will see a .journal file. Don't try to delete this and don't back this up or restore it from backup! If you run tune2fs -j on an unmounted partition an invisible journal file will be created.
Now you can mount the filesystem as ext3 using:

mount -t ext3 /dev/hdaX /mnt/somewhere

With mke2fs -j /dev/hdaX you can format a partition as ext3 (as always it will be also usable as ext2 partion).

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Ext2/Ext3
« Reply #2 on: 22 March 2002, 07:09 »
Sounds like IanC already answered the question. I was about to make a short answer of "yes, you can on the fly upgrade to ext3".  I know it can be done and I actually have done it many times, but only on an "upgrade" from pre RedHat 7.2 to RedHat 7.2. It had no problem converting the FS.  In fact ext3 is the same format as ext2, the only difference is a journal (/.journal file) as IanC stated, and a kernel module called "journald".  I haven't tried it but I think you can even mount an ext3 filesystem using "ext2" filesystem type but don't quote me on that.  Best to follow the FAQs that IanC pointed out.  And let us know if any of the stuff I speculated on is accurate or inaccurate.

If your system is already capable of ext3 (compiled into the kernel and you have all of the fs tools with ext3 support) it should be really easy. But follow the documents as there is a special way you have to go about converting a root file system (/).  Here's a RedHat DOC stating so: http://www.redhat.com/support/wpapers/redhat/ext3/

If your system is not currently ext3 ready you will probably have to get an updated kernel and recompile with ext3 support.  And get a newer version of the file system utilities that support ext3. It looks like you really can't go wrong as if you do the conversion and still don't have all the pieces to actually mount it as ext3 you can still mount it as ext2. IanC had a good suggestion of trying it on a small non root filesystem first so you know you have all of the pieces.

And here's the mini-HOWTO: http://www.symonds.net/~rajesh/howto/ext3/index.html

[ March 21, 2002: Message edited by: VoidMain ]

Someone please remove this account. Thanks...

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Ext2/Ext3
« Reply #3 on: 22 March 2002, 17:10 »
those documents are ace, and now i think i'll change from ext2 to ext3. i had the idea before that it would be as bad as FAT16 => NTFS...

whilst on the subject, have a look at this article here, anybody who's interested, which is more about physical placement of filesystems on the hard drive than the actual nature of the FS itself.

PS why isn't this topic called "filesystems in linux" or "ext2/ext3"? it would make it easier to find in the menu!  ;)
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

badkarma

  • VIP
  • Member
  • ***
  • Posts: 497
  • Kudos: 0
Ext2/Ext3
« Reply #4 on: 22 March 2002, 18:00 »
quote:
Originally posted by Calum:


PS why isn't this topic called "filesystems in linux" or "ext2/ext3"? it would make it easier to find in the menu!   ;)  



done

and thanks for the help guys  
If you can't learn to do something well, learn to enjoy doing it poorly.

lost

  • Member
  • **
  • Posts: 48
  • Kudos: 0
    • http://www.23.org/
Ext2/Ext3
« Reply #5 on: 23 March 2002, 04:58 »
quick and easy ext3 update:

compile ext3 support into your kernel, debugging is adivised.  Check out the the kernel-HOWTO is you dont know what you are doing.  To see if ext3 is already supported just run 'cat /proc/filesystems' and check for ext3.  If you have it run 'tune2fs -j /dev/[disk][partition]'

now go into your fstab and change your [disk][partition] from ext2 to ext3.  if you reboot and forget to change this dont worry, ext2 will still work and run, you just dont get the journal support.  just make sure to change it at some time.  Every 20 reboots fsck will still run, you can disable it with one of the tune2fs flags.

Have fun.   Make sure to break shit and then install slackware.  
If ignorance is bliss, why aren't there more happy people?

[email protected]