Optware, flush EXT3 journal. EXT3 to EXT2 conversion

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
gatorback
DD-WRT User


Joined: 04 Feb 2007
Posts: 426
Location: Fountain of Youth

PostPosted: Thu Oct 13, 2011 16:21    Post subject: Optware, flush EXT3 journal. EXT3 to EXT2 conversion Reply with quote
I would like to disasble EXT3 journaling, but to do so I think I need to flush the journal by having it write to the card and setting the flags to permit disabling journaling (tune2fs).

Code:
tune2fs -O ^has_journal /dev/xdy


Attempts were met with:

"The needs_recovery flag is set. Please run e2fsck before clearing has_journal flag"

Is there a command to flush the journal and set the flags to enable tune2fs to do its job?

_________________
My Routers | RT-N16 Wiki | TMO Cellspot Wiki
Peacock Flashing | Wireless N Conf | Linking Routers |
DD-WRT Wiki | DD-WRT Builds | Broadcom FAQ| QoS| OTRW


Last edited by gatorback on Thu Oct 20, 2011 5:55; edited 1 time in total
Sponsor
nuke12
DD-WRT User


Joined: 10 Jul 2011
Posts: 90

PostPosted: Thu Oct 13, 2011 17:19    Post subject: Reply with quote
Why do you want to disable the journal? It's a really handy feature and could save your back end some time.

If you really don't want journaling then why not use ext2?

Sorry, I can't help with your current method. I've never tried to disable it but I have enabled a journal on a ext2 system.
gatorback
DD-WRT User


Joined: 04 Feb 2007
Posts: 426
Location: Fountain of Youth

PostPosted: Thu Oct 13, 2011 17:55    Post subject: Reply with quote
nuke12 wrote:
Why do you want to disable the journal? It's a really handy feature and could save your back end some time.

If you really don't want journaling then why not use ext2?

Sorry, I can't help with your current method. I've never tried to disable it but I have enabled a journal on a ext2 system.


I already have my system configured on EXT3 on a flash drive. Journaling add additional writes to the drive and wears it out sooner.

OK, so having explained the "why". Back to the "how". This is what I tried. I think I got it, but not sure how to verify that journaling is disabled.

Code:
root@sysresccd /root % cat /proc/partitions
major minor  #blocks  name

   7        0     294980 loop0
   8        0  312571224 sda
   8        1  297426944 sda1
   8        2   15139840 sda2
   8       16     992000 sdb
   8       17     987966 sdb1


root@sysresccd /root % e2fsck -y -v -f /dev/sdb1
e2fsck 1.41.14 (22-Dec-2010)
/dev/sdb1: recovering journal
Adding dirhash hint to filesystem.

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

/dev/sdb1: ***** FILE SYSTEM WAS MODIFIED *****

   12264 inodes used (9.92%)
      55 non-contiguous files (0.4%)
      14 non-contiguous directories (0.1%)
         # of inodes with ind/dind/tind blocks: 600/1/0
   65283 blocks used (26.43%)
       0 bad blocks
       1 large file

    9904 regular files
     762 directories
       0 character device files
       0 block device files
       0 fifos
      92 links
    1588 symbolic links (1588 fast symbolic links)
       1 socket
--------
   12347 files


root@sysresccd /root % tune2fs -l /dev/sdb1             
tune2fs 1.41.14 (22-Dec-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          31a4d86b-cc01-4029-828b-39991a767826
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal resize_inode dir_index filetype sparse_super large_file
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              123648
Block count:              246991
Reserved block count:     12349
Free blocks:              181708
Free inodes:              111384
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      60
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         15456
Inode blocks per group:   483
Filesystem created:       Tue Oct  4 12:32:25 2011
Last mount time:          Thu Jan  1 00:00:09 1970
Last write time:          Thu Oct 13 13:23:54 2011
Mount count:              0
Maximum mount count:      27
Last checked:             Thu Oct 13 13:23:54 2011
Check interval:           15552000 (6 months)
Next check after:         Tue Apr 10 13:23:54 2012
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:              128
Journal inode:            8
Default directory hash:   tea
Directory Hash Seed:      394f00e6-2d7b-4a2c-94b7-d74d075ca6b9
Journal backup:           inode blocks

root@sysresccd /root % tune2fs -O ^has_journal /dev/sdb1
tune2fs 1.41.14 (22-Dec-2010)


root@sysresccd /root % tune2fs -l /dev/sdb1             
tune2fs 1.41.14 (22-Dec-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          31a4d86b-cc01-4029-828b-39991a767826
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      resize_inode dir_index filetype sparse_super large_file
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              123648
Block count:              246991
Reserved block count:     12349
Free blocks:              185810
Free inodes:              111384
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      60
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         15456
Inode blocks per group:   483
Filesystem created:       Tue Oct  4 12:32:25 2011
Last mount time:          Thu Jan  1 00:00:09 1970
Last write time:          Thu Oct 13 13:24:42 2011
Mount count:              0
Maximum mount count:      27
Last checked:             Thu Oct 13 13:23:54 2011
Check interval:           15552000 (6 months)
Next check after:         Tue Apr 10 13:23:54 2012
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:              128
Default directory hash:   tea
Directory Hash Seed:      394f00e6-2d7b-4a2c-94b7-d74d075ca6b9
Journal backup:           inode blocks
root@sysresccd /root % tune2fs -l /dev/sdb1 | grep journal
root@sysresccd /root % tune2fs -l /dev/sdb1 | grep Journal
Journal backup:           inode blocks
root@sysresccd /root %

_________________
My Routers | RT-N16 Wiki | TMO Cellspot Wiki
Peacock Flashing | Wireless N Conf | Linking Routers |
DD-WRT Wiki | DD-WRT Builds | Broadcom FAQ| QoS| OTRW
nuke12
DD-WRT User


Joined: 10 Jul 2011
Posts: 90

PostPosted: Thu Oct 13, 2011 18:37    Post subject: Reply with quote
Ok, but if your only concerned about writes then just mount the partition as an ext2 filesystem and then the journal won't be used. Don't try using it as an ext3 filesystem at a later date.


The two filesystems are the same except ext3 has a journal. You can mount an ext3 filesystem as ext2 but the journal won't be used or updated with writes to the filesystem.
gatorback
DD-WRT User


Joined: 04 Feb 2007
Posts: 426
Location: Fountain of Youth

PostPosted: Thu Oct 13, 2011 20:08    Post subject: Reply with quote
I had to perform a 30-30-30 reset and reconfigure the settings. This leads me to wonder if there are any router settings that need to be performed by the optware_prep script.

I used another linux box to verify that the data was still on the SD card.


When I mounted the SD card it was mounted EXT2:



_________________
My Routers | RT-N16 Wiki | TMO Cellspot Wiki
Peacock Flashing | Wireless N Conf | Linking Routers |
DD-WRT Wiki | DD-WRT Builds | Broadcom FAQ| QoS| OTRW
gatorback
DD-WRT User


Joined: 04 Feb 2007
Posts: 426
Location: Fountain of Youth

PostPosted: Thu Oct 20, 2011 5:52    Post subject: Procedure to Remount newly EXT3 => EXT2 SD Card Reply with quote
Ok, so after some tinkering, I found a working process. The trick is to have the USB support webpage up and running, ready to post to the router to enable the USB support:



You can then insert the newly minted EXT2 card and push the apply settings button. Before doing this there are a few other details.

THESE STEPS MUST BE PERFORMED FIRST
===================================
After creating the web page shown above, I opened another brower tab and switched off the router's USB support. Here is what it looks like with USB support off:




After creating these two tabs in the browser, I took the SD card out of the router (powered on). Make sure that you can get into the router's web pages. You may need to go through port 88 instead of 80:



Now you may remove the SD card and put it into another linux box (I used a virtual machine with sysrescuecd) to

Code:
echo find the partion
cat /proc/partitons

echo flush the JFFS journal
e2fsck -y -v -f /dev/sdb1

echo List the partition's data before disable journaling
 tune2fs -l /dev/sdb1 | grep features
         

echo Disable journaling on EXT3 Device
tune2fs -O ^has_journal /dev/sdb1

echo List the partition's data after disable journaling
  tune2fs -l /dev/sdb1 | grep features


The code above provide before and after details of the has_journal flag (should not be present in EXT2).

Return the SD card to the USB port and push the apply settings button shown in the first screen shot.
If you are succesfully it will show the partion is EXT2:



I performed a power on cycle to verify that the SD card will automount and checked the /opt partition via putty.

_________________
My Routers | RT-N16 Wiki | TMO Cellspot Wiki
Peacock Flashing | Wireless N Conf | Linking Routers |
DD-WRT Wiki | DD-WRT Builds | Broadcom FAQ| QoS| OTRW
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum