LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 01-10-2010, 06:26 PM   #1
wikopl
LQ Newbie
 
Registered: Jul 2007
Posts: 12

Rep: Reputation: 0
Convert ext3 to ext4 on Fedora 12


Hi
After I managed to upgrade flawlessly from FC11 to FC12 (using preupgrade command) I was trying to move my root file system from ext3 to ext4, mainly based on http://ext4.wiki.kernel.org/index.ph...running_Fedora but also using other sources.
1. First I have modified /etc/fstab and replaced ext3 to ext4 for '/' (not '/boot').
2. Then I run:
# tune2fs -O extents,uninit_bg,dir_index /dev/dm-0
After that I got a message advising to run e2fsck (I got a bit confused, why e2fsck, not fsck).
3. I was to run fsck -pDf when saw the warning that this needs to be run with unmounted volume. Then I read again some information, and indeed it is said, it must be unmounted. I did NOT proceed here with fsck!
4. Trying to search for unmounting '/' and being unable to do that I did press hard reset on my PC.
5. After rebooting, I got errors (don't know if because of the hard reset or that tune2fs command without fsck -df issued) and '/' was not mounted. I was advised by system to run fsck manually. I was happy that I got on a stage where '/' is unmounted so I can run missing fsck -df (or pDf). But the system explicitly said that -p option cannot be used.
So I run pure fsck and got back working system (I hope).

Now, this is the output of
#tune2fs -l /dev/dm-0
tune2fs 1.41.9 (22-Aug-2009)
Filesystem volume name: <none>
Last mounted on: /
Filesystem UUID: 9fc5140f-eeb8-47b7-be0a-b55ac7e49c4d
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent sparse_super large_file uninit_bg
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 12264000
Block count: 12263424
Reserved block count: 613171
Free blocks: 7661368
Free inodes: 11971124
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1021
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 32704
Inode blocks per group: 1022
Filesystem created: Sat Mar 8 09:44:05 2008
Last mount time: Sun Jan 10 09:34:28 2010
Last write time: Sun Jan 10 09:09:52 2010
Mount count: 6
Maximum mount count: -1
Last checked: Sun Jan 10 05:26:24 2010
Check interval: 0 (<none>)
Lifetime writes: 797 MB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
First orphan inode: 9320802
Default directory hash: tea
Directory Hash Seed: 1c0dd393-2296-4d49-94b6-e482c90c7a82
Journal backup: inode blocks


Also, is it normal, when I issue the same command as Non root, to get this?
$ tune2fs -l /dev/dm-0
tune2fs 1.41.9 (22-Aug-2009)
tune2fs: Permission denied while trying to open /dev/dm-0
Couldn't find valid filesystem superblock.


Now my Fedora seems to be working ok, but I am not sure if I have converted ext3 to ext4. The question is how can I verify that?


And yet. My latest DVD with Fedora is FC10. It fails, when trying to mount a file system in rescue mode. I was obsessed to get my '/' unmounted to run fsck -df. So then I downloaded and burned Fedora-12-i686-Live.iso but it also fails to mount my file system (it seems to be trying to mount it as ext3).
 
Old 01-10-2010, 07:07 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
you need to reformat /

the EASIEST way is to use the fedora 12 install dvd ( you did not use this ) and install fedora 12 from it .A FULL install and NOT an upgrade.

This is one of the reasons that the fedora deves RECOMMEND not using the upgrade option.


yes the / ( root fs ) MUST not be mounted for that . use a Live cd like gparted or "systemRescue cd , or the fedora 12 -- RECOMENDED-- install cd or dvd.

the os MUST not be running while reformatting /

and ALL data will be lost so BACK UP your important data.
 
Old 01-10-2010, 07:32 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I see no reason to throw away all that work. The filesystem seems a valid ext4 (the extents feature e.g.). The fsck requirement is expected as documented - and should be run from the liveCD against the ext4 f/s unmounted.
I wouldn't worry about it failing to mount automatically - fsck it then try to mount it manually as ext4.
 
Old 01-10-2010, 09:41 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Change your boot command to pass the forcefsck option to the boot process. That will cause the fsck program to run before the file systems are mounted, which is what you need to do. (If you're using the GRUB boot loader, press the <esc> (or "e" if that option is displayed) and follow the on-screen instructions to add the forcefsck to the kernel iine in the stanza you're using to boot.)

If you do this in the future, just do a touch /forcefsck before the tune2fs to force fsck to run on the next boot.

In any case, you will (hopefully) either get the ext4 fs running, or be switched to a "root" terminal where you can run the fsck withe the options you need.

Good luck.

Last edited by PTrenholme; 01-10-2010 at 09:46 PM. Reason: Intrupted while typing.
 
Old 01-11-2010, 12:10 PM   #5
wikopl
LQ Newbie
 
Registered: Jul 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for all your responses.

To clarify though,
after my step 4, when I powered off my Pc, I got errors when botting up (in step 5).
The root '/' was not mounted and I was given a root terminal and was able to run fsck.
The problem I had, I was not able to run it with -pf options. The system refused at least -p (as far as I can remeber).
After I run, what I call a pure fsck, ie. no parameters, I am using my FC12 without any problems (at least I can login to Gnome, open firefox ... did not try too much, oh yet I downloaded and burned Fedora-12-i686-Live.iso).
But somehow I had that impression, that 'fsck -pf' is needed, not only 'fsck'!

Now, my concerns are:
A. why Fedora-12-i686-Live.iso cannot mount my file system? I mean is it because of wrong ext4? How can I verify this is ok, as perhaps that iso file is wrong.

B. do you get the same error, when a non-root users issues?
$ tune2fs -l /dev/dm-0
as I get:
tune2fs 1.41.9 (22-Aug-2009)
tune2fs: Permission denied while trying to open /dev/dm-0
Couldn't find valid filesystem superblock.

C. Your answers here gives a birth to some other questions:
touch /forcefsck - can I somehow pass -pf, when using that method (perhaps editing that file and typing -pf)?

Last edited by wikopl; 01-11-2010 at 01:59 PM.
 
Old 01-11-2010, 02:08 PM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
The p (preen) and f (force) options are "file system specific" options, not fsck options. You could either run fsck.ext2 -pf or fsck -- -pf to have the fsck script pass the pf arguments to the fsck.ext2 program it will run for any ext file system. The options and how to pass them aredescribed in man fsck and man fsck.ext4.

I suspect that you did (implicitly) run the "preen" part when you ran the fsck, so you should be OK now. Anyhow, the "argument passing" thing is why the instructions told you to run e2fsck -pDf. Although they could have said fsck -- -pDf.

Last edited by PTrenholme; 01-11-2010 at 02:09 PM.
 
Old 01-13-2010, 08:18 AM   #7
AngTheo789
Member
 
Registered: Sep 2009
Posts: 110

Rep: Reputation: 24
Just for the sake of completeness: I have upgraded from FC10 to FC11 and then to FC12 - all of this without switching from ext3 to ext4. I have no problems with the file systems. I have no doubt, that some people might have encountered problems with ext3 on FC12, but it is certainly a default symptom.
 
Old 01-13-2010, 03:40 PM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
For what it's worth, I just converted my F11 ext3 partition on a logical volume to ext4 following the two steps listed by wkiopl in the first post to this thread. (Done from a F12 installation on a different drive, with the LV accessed but not mounted.

The only problem now is that the F11 system won't boot because the initial RAM file system nash script is trying to open the root file system as a ext3 one. It should be fairly easy to change that, but, since I can access the whole F11 file system from F12, I don't think I'll bother.

Last edited by PTrenholme; 01-19-2010 at 12:48 PM.
 
Old 01-18-2010, 09:53 AM   #9
wikopl
LQ Newbie
 
Registered: Jul 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Just to finalise this thread from my perspective and thank you all for your input.
A colleague of mine has bought a magazine with attached FC12 DVD. I did not want to download it and burn another DVD as I believed that my system was ok at the end, after all what was said here.

I gave that original DVD a try to boot in the rescue mode. No problems at all unlike Fedora-12-i686-Live.iso.
Then I unmounted /mnt/sysimage which was not that straight forward as I would expect.
I had to use lazy umount (umount -l) to do that. Otherwise the resource was busy.


After I run e2fsck -pDf on my device (you cannot run it on /mnt/sysimage which is just unmounted, you need to see prior un-mounting, where /mnt/sysimage was mounted to - it is obvious for people dealing with this command on everyday basis but was not for myself) and rebooted, Fedora enforced selinux re-labeling (which was a good omen I suppose).

And yet, I decided to go for ext4 just to take an advantage of that file system (I hear about de-fragmentation ability). prior that I had no problems with ext3 indeed (and still keep it on my /boot anyway).


Also my question:
$ tune2fs -l /dev/dm-0
run as non root user produces:
tune2fs 1.41.9 (22-Aug-2009)
tune2fs: Permission denied while trying to open /dev/dm-0

seems to be a normal behaviour (I must admit I did not verify this though).

Last edited by wikopl; 01-18-2010 at 09:55 AM.
 
Old 01-19-2010, 12:55 PM   #10
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Yes, that's quite normal. Permissions on the /dev directory restrict access to root.
Code:
$ ls -dl /dev
drwxr-xr-x. 20 root root 4000 2010-01-19 09:39 /dev
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert ext4 FS to ext3 without formatting HDD n03x3c Linux - General 3 12-04-2009 05:47 AM
Fedora 11 hanging after ext4 upgrade from ext3 recreating initrd for 2.6.29.6-217.2.7 masterDL Fedora 8 08-26-2009 09:26 PM
mounting ext3 FS as ext4 info1686 Linux - General 1 07-08-2009 07:16 AM
Ext3 to Ext4 in Fedora 9 vwtech Fedora 2 05-21-2009 11:03 AM
From ext3 to ext4 rengo.Java Linux - Software 6 12-27-2008 09:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 01:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration