WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: e2fsprogs miss e2defrag  (Read 785 times)

Offline julcar

  • WikiUser
  • *
  • Posts: 44
e2fsprogs miss e2defrag
« on: February 20, 2019, 05:29:32 PM »
My file system on the tiny core partition is ext2, becase the version of grub4dos available on the extensions repository is a bit old and can't boot from ext3/ext4 partitions (btw if anyone found a fix for this could help me a lot)

Now I am needing to defrag my ext2 partition but e2fsprogs lacks of e2defrag, instead it has e4defrag, which in my case is useless because complains about the filesystem is not ext4.

I don't know if older versions of the extension could have e2defrag, but would be great if it can be added to the extension aside e4defrag.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 2857
Re: e2fsprogs miss e2defrag
« Reply #1 on: February 20, 2019, 07:48:56 PM »
My file system on the tiny core partition is ext2, because the version of grub4dos available on the extensions repository is a bit old and can't boot from ext3/ext4 partitions (btw if anyone found a fix for this could help me a lot)
Hello julcar
AIUI they stopped development of grub4dos long before ext4 came to be.  Apparently there's a patch (I read somewhere) for grub legacy which is also depreciated,  However..
Grub2 supports ext2, ext3 and ext4, all from it's "ext2.mod"  module

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6422
Re: e2fsprogs miss e2defrag
« Reply #2 on: February 20, 2019, 08:06:08 PM »
Hi coreplayer2
I just checked and I have machines with ext3 and ext4 file systems and they both boot using  grub legacy.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 2857
e2fsprogs miss e2defrag
« Reply #3 on: February 20, 2019, 08:45:13 PM »
Hi Rich
That’s good to know.  I only know of an unofficial patch which must have been applied to grub legacy at some point??



Sent from my iPhone using Tapatalk

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6422
Re: e2fsprogs miss e2defrag
« Reply #4 on: February 20, 2019, 08:53:38 PM »
Hi coreplayer2
This is from the  grub-0.97-splash.tcz  info file:
Quote
Current:   2010/03/07 Updated with ext4 and Xen support.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 10702
Re: e2fsprogs miss e2defrag
« Reply #5 on: February 20, 2019, 09:28:57 PM »
I don't know if older versions of the extension could have e2defrag, but would be great if it can be added to the extension aside e4defrag.

Looking all the way back to tc-2.x, there is no app named e2defrag provided by e2fsprogs - there is an e2freefrag, but that does not look to be the same thing.

There is this, but the last update seems to be 2012:

https://launchpad.net/e2defrag

Offline julcar

  • WikiUser
  • *
  • Posts: 44
Re: e2fsprogs miss e2defrag
« Reply #6 on: February 20, 2019, 10:14:08 PM »
Hello julcar
AIUI they stopped development of grub4dos long before ext4 came to be.  Apparently there's a patch (I read somewhere) for grub legacy which is also depreciated,  However..
Grub2 supports ext2, ext3 and ext4, all from it's "ext2.mod"  module

Grub 0.97 splash neither Grub 2 has the map command for iso files, which is what I am using for my setup (booting multiple linux live iso's from harddisk, and because the iso files are fragmented, I need a defrag for ext2)
« Last Edit: February 20, 2019, 10:34:23 PM by julcar »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 10702
Re: e2fsprogs miss e2defrag
« Reply #7 on: February 21, 2019, 12:09:15 AM »
compiling e2defrag fails with:
Code: [Select]
$ gcc -march=i486 -mtune=i686 -Os -pipe -pipe -Wall -W -Wunused -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wno-sign-compare -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wnested-externs   -o e2defrag libext2.a -lncursesw
/usr/local/bin/ld: libext2.a(defrag.ext2.o): in function `walk_zone':
defrag.c:(.text+0xf3): undefined reference to `HOLE_BLKADDR'

..since libext2.a contains HOLE_BLKADDR I don't know why this is.

Offline julcar

  • WikiUser
  • *
  • Posts: 44
Re: e2fsprogs miss e2defrag
« Reply #8 on: February 21, 2019, 01:21:03 AM »

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6422
Re: e2fsprogs miss e2defrag
« Reply #9 on: February 21, 2019, 07:24:33 AM »
Hi julcar
what about this? https://github.com/ennoruijters/e2defrag
That's even older, last modification in 2010.

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6422
Re: e2fsprogs miss e2defrag
« Reply #10 on: February 21, 2019, 08:16:35 AM »
Hi Juanito
In TC4  /usr/include/ext2fs/ext2fs.h  had the following line:
Code: [Select]
#define HOLE_BLKADDR(_b) ((_b) == 0 || (_b) == EXT2FS_COMPRESSED_BLKADDR)The TC9 version no longer includes it. Googling  HOLE_BLKADDR  turn up this:
https://android.googlesource.com/platform/external/e2fsprogs/+/4a05268%5E%21/
Granted it refers to Android, but it is the most recent reference by a long shot and it shows how  HOLE_BLKADDR  gets removed.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 10702
Re: e2fsprogs miss e2defrag
« Reply #11 on: February 21, 2019, 08:35:53 PM »
thanks  :)

Offline julcar

  • WikiUser
  • *
  • Posts: 44
Re: e2fsprogs miss e2defrag
« Reply #12 on: February 24, 2019, 01:17:08 AM »
So, in TCL 4.x is possible to compile the e2defrag? Thanks

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 10702
Re: e2fsprogs miss e2defrag
« Reply #13 on: February 24, 2019, 01:18:35 AM »
Please feel free to go ahead and try  :)

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6422
Re: e2fsprogs miss e2defrag
« Reply #14 on: February 24, 2019, 06:03:19 AM »
Hi Juanito
So, in TCL 4.x is possible to compile the e2defrag? Thanks
Please feel free to go ahead and try  :)
When I read that I thought you meant julcar should try compiling it under TC4 (you usually write "posted"). Then I noticed it's
now available in TC4.