• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Downgrade ext3 to ext2  (Read 3486 times)
mhtsaras
Newbie
*

Karma: 0
Posts: 42


View Profile
« on: February 05, 2010, 03:44:15 PM »

I boot debian from sd card with two partitions (used the installer) one with the kernel uImage ext2 formated, and the second with rootfs ext3 formated.
Now I want to mount the second partition as ext2 and maybe latter, kill the journal,
do I have to give some extra bootargs to u-boot or a permanent entry in the sd card's fstab will do the job?
By the way how can I see which partition is ext2 or ext3 from sd card or a usb drive with 2 partitions axt2 and ext3?
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #1 on: February 05, 2010, 07:25:04 PM »

By the way how can I see which partition is ext2 or ext3 from sd card or a usb drive with 2 partitions axt2 and ext3?
For instance, for an SDcard:
Code:
# file -s /dev/mmcblk0p?
Logged

tbm
Full Member
***

Karma: 7
Posts: 121



View Profile WWW
« Reply #2 on: February 06, 2010, 04:05:41 AM »

Remove the journal:
tune2fs -O ^has_journal /dev/XXXX

Edit /etc/fstab and change ext3 to ext2
Logged

mhtsaras
Newbie
*

Karma: 0
Posts: 42


View Profile
« Reply #3 on: February 11, 2010, 02:22:04 PM »

Remove the journal:
tune2fs -O ^has_journal /dev/XXXX

Edit /etc/fstab and change ext3 to ext2

and: fsck -f /dev/XXXX
afterwards to be sure.
I want to mount the mmcblk0p2 (rootfs sdcard partition) as ext2 first to check things out on the safe side, and latter  kill the journal.
Has anybody done it sucessfully on the plug, I mean to downgrade fromext3 to ext2?
I'm asking that because I saw an old article -->http://www.troubleshooters.com/linux/ext2toext3.htm#_three2two
has a very complicated procedure Back-Converting the root directory
Are all those valid or this is an obsolete information?
Meanwhile I was thinking of staying with ext3 and just tweak/reduce the writes on the sd card with some tricks described here--> http://www.earth.org.uk/note-on-SheevaPlug-setup.html#storage

Logged

cjm
Jr. Member
**

Karma: 6
Posts: 69


View Profile
« Reply #4 on: February 11, 2010, 03:17:27 PM »

I understood the instructions in the link you provided as a method to convert a root file system, not the root directory. The problem with the root file system is that you can't run tune2fs while it's mounted so you have to boot from a CD, or use an initramfs if it contains the required tools. Might be wrong, though -- I only glanced at the page for a few seconds.
Logged

mhtsaras
Newbie
*

Karma: 0
Posts: 42


View Profile
« Reply #5 on: February 12, 2010, 06:58:24 AM »

So has anybody done it?
Convert sucessfully the rootfs partition of an sdcard from ext3 to ext2?

I understood the instructions in the link you provided as a method to convert a root file system, not the root directory. The problem with the root file system is that you can't run tune2fs while it's mounted so you have to boot from a CD, or use an initramfs if it contains the required tools. Might be wrong, though -- I only glanced at the page for a few seconds.
Actually the case that the article gives as an example is exactly the same as with the plug booting from an sdcard with two partitions, one with the kernel uImage and another partition with the rootfs.

"Back-Converting the root directory
The root directory is a challenge for a number of reasons. First, it must be mounted for the system to run, but it must be unmounted to run the e2fsck command. Also, different distros behave different ways. The mkinitrd command varies widely between distros. ...
We'll assume that /dev/hda1 is /boot, while /dev/hda2 is the root directory (/)."


I'm little confused with the procedure involving the use of initrd, do I have to use initrid with debian on the plug to change from ext3 to ext2?

« Last Edit: February 12, 2010, 07:01:12 AM by mhtsaras » Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #6 on: February 12, 2010, 09:01:33 AM »

May I suggest just copy your rootfs to a newly create ext2 file system?

Do you really want to leave a doubt in your mind that have I done it correctly?  Grin


Good luck Smiley
Logged

Good Luck Smiley

birdman
Sr. Member
****

Karma: 4
Posts: 429


View Profile WWW
« Reply #7 on: February 12, 2010, 06:51:50 PM »

So has anybody done it?
Convert sucessfully the rootfs partition of an sdcard from ext3 to ext2?
Since it's an SD card you could plug it into another Linux system and make the change there.
Logged

mhtsaras
Newbie
*

Karma: 0
Posts: 42


View Profile
« Reply #8 on: February 13, 2010, 04:15:16 AM »

Fortune favors the brave so I decided to proceed with the sd card conversion from ext3 to ext2.
I have a multiboot setup on my plug so I've got the backup nand boot to mess up with the sdcard.
So I removed the sdcard and booted from internal nand and inserted again the sdcard in th slot.
Mounted the 2nd partition (mmcblk0p2 with the rootfs "/" ) and check it out
Code:
user@debian:~$ sudo mount /dev/mmcblk0p2 /mnt/sdp2
user@debian:~$ df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
tmpfs        tmpfs      256740         0    256740   0% /lib/init/rw
udev         tmpfs       10240       144     10096   2% /dev
tmpfs        tmpfs      256740         4    256736   1% /dev/shm
rootfs      rootfs      471664    147828    318996  32% /
/dev/mmcblk0p2
              ext3     7732856    479552   6860492   7% /mnt/sdp2

it's ext3!
unmounted it and run " sudo tune2fs -O ^has_journal /dev/mmcblk0p2" to get rid of the journal
and after that "sudo fsck -f /dev/mmcblk0p2" to check things out,
mounted again to check the fstype = ext2
and rebooted from the sdcard...cross fingers...
Code:
user@debian:~$ sudo fdisk -l

Disk /dev/mmcblk0: 8048 MB, 8048869376 bytes
4 heads, 16 sectors/track, 245632 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0xf3bf8b45

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1               1         123        3928   83  Linux
/dev/mmcblk0p2             124      245632     7856288   83  Linux
user@debian:~$ sudo tune2fs -O ^has_journal /dev/mmcblk0p2
tune2fs 1.41.9 (22-Aug-2009)
user@debian:~$ sudo fsck -f /dev/mmcblk0p2
fsck from util-linux-ng 2.16.2
e2fsck 1.41.9 (22-Aug-2009)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
sheevaplug-rootf: 11749/491520 files (0.6% non-contiguous), 117945/1964072 blocks
user@debian:~$ sudo mount /dev/mmcblk0p2 /mnt/sdp2
user@debian:~$ df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
tmpfs        tmpfs      256740         0    256740   0% /lib/init/rw
udev         tmpfs       10240       144     10096   2% /dev
tmpfs        tmpfs      256740         4    256736   1% /dev/shm
rootfs      rootfs      471664    157716    309112  34% /
/dev/mmcblk0p2
              ext2     7732856    348348   6991696   5% /mnt/sdp2
user@debian:~$ sudo shutdown -r now
The plug is working fine booting from the ext2 converted sdcard.
Edit: My"dmesg" gives me "VFS: Mounted root (ext2 filesystem) on device 179:2."
« Last Edit: February 13, 2010, 04:48:48 AM by mhtsaras » Logged

Pages: [1]
Print
Jump to: