UNR 1.0.1 convert to ext2 *SOLVED*

Discussion in 'Linux' started by kgorilla, Dec 9, 2008.

  1. kgorilla

    kgorilla

    Joined:
    Dec 9, 2008
    Messages:
    8
    Likes Received:
    0
    Not sure everyone was aware this is a problem, but it certainly was for me.

    When i loaded UNR and changed the fstab to ext2, fine everything is OK, but that is because the filesystem was actually ext3 but being mounted as ext2 by the OS. Not sure what future problems this could cause, but it was annoying me very much. After following some instructions to use tune2fs and remove the journal, UNR wouldn't boot and complained about being unable to mount /dev/sda1 to /root. sleeping for 2 seconds... over and over again...

    After investigation of my [extracted] initrd i found the problem to be in the "disk" script which explicitly specified ext3. So here is how I fixed it:

    Step 1. Modify your /etc/fstab from UNR
    Code:
    /dev/sda1	    /	            ext2 defaults,noatime,nodiratime,errors=remount-ro	0 0
    /dev/mmcblk0p1	/home		    ext2 defaults,noatime,nodiratime,errors=remount-ro  0 0
    proc			/proc			proc	defaults	0 0
    none		/tmp 	tmpfs	defaults	0 0
    Side note, if you mount /tmp with tmpfs make sure to add "chmod a+w /tmp" to /etc/rc.local above "exit 0"

    Step 2. Reboot to a live CD/USB of your choice, I used Fedora 10.

    Step 3. From a root console remove the journal on the existing filesystem and check it
    Code:
    # tune2fs -O ^has_journal /dev/sda1
    # e2fsck /dev/sda1
    Step 4. Mount your [ext2] FS somewhere and chroot to it
    Code:
     # mount /dev/sda1 /mnt
    # chroot /mnt /bin/bash
    
    Step 5. Edit "disk" script
    Code:
     # vi /etc/initramfs-tools/disk 
    Here's the modified section, 3 entries in total, simply changing ext3 to ext2
    Code:
    	# We are NOT using squashfs
    	echo "mounting root partition, NOT using squashfs"   
    	mount -t ext2 -o rw,noatime,nodiratime /dev/${device}${root_partition} ${rootmnt}
    	while [ ! -e "${rootmnt}/bin" ]
    	do
    	    echo "Did not find ${rootmnt}/bin"
    	    echo "sleeping for 2 seconds..."
    	    /bin/sleep 2
    	    echo "Mounting: mount -o rw,noatime,nodiratime /dev/${device}${root_partition} ${rootmnt}"
    	    mount -t ext2 -o rw,noatime,nodiratime /dev/${device}${root_partition} ${rootmnt}
    	done
    	if [ "${boot_partition}" -ne 0 ]
    	then
    	    mount -t ext2 -o rw,noatime,nodiratime /dev/${device}${boot_partition} ${rootmnt}/boot 
    	fi
        fi
    
    Step 6. Update initramfs (update initrd image)
    Code:
     # update-initramfs -u 
    Done!
    Not bad for a first post, wanted to have something valid to contribute other than it doesn't work/i don't know how to use linux. [/rant]

    And now that I look at it again, that last modification for ${boot_partition} is probably unneeded, oh well.
    -kg
     
    kgorilla, Dec 9, 2008
    #1
  2. kgorilla

    RockDoctor

    Joined:
    Aug 21, 2008
    Messages:
    963
    Likes Received:
    0
    Location:
    Minnesota, USA
    Good post. I just found it amusing that you used a Fedora live CD to edit an Ubuntu installation.
     
    RockDoctor, Dec 9, 2008
    #2
  3. kgorilla

    irishhhhh

    Joined:
    Sep 11, 2008
    Messages:
    24
    Likes Received:
    0
    the speed isnt improved is it? this only makes the ssd last longer right?
     
    irishhhhh, Dec 11, 2008
    #3
  4. kgorilla

    mh-

    Joined:
    Sep 22, 2008
    Messages:
    39
    Likes Received:
    0
    Speed should be improved since you'll do less writing without the journal (and writing is slow). Not looked into it tho.
     
    mh-, Dec 11, 2008
    #4
  5. kgorilla

    slap

    Joined:
    Aug 8, 2008
    Messages:
    2
    Likes Received:
    0
    Since ext3 is backward compatible with ext2, I modified my fstab by writing ext2 instead of ext3. It mounts properly as ext2. It is very simple and you don't need to convert anything.

    Am I missing something? Is there a true benefit to convert to ext2 instead of just mounting as ext2?
     
    slap, Dec 11, 2008
    #5
  6. kgorilla

    kgorilla

    Joined:
    Dec 9, 2008
    Messages:
    8
    Likes Received:
    0
    I'm not sure there is really any "true benefit" as opposed to simply fully completing the job. As you've noted, ext3 volumes can be mounted as ext2, but you are doing exactly that, mounting an ext3 volume as ext2 as opposed to mounting an ext2 volume as an ext2 volume.

    So if filesystem errors occur and you say reboot to a live CD to run an fsck, you will potentially be replaying journals that are never written as you're mounting it ext2.

    I dunno, maybe a guru could explain exactly what if it's a risk, or not worth the time?
     
    kgorilla, Dec 13, 2008
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.