Jump to content











Photo
- - - - -

Contig like tool for linux?


  • Please log in to reply
12 replies to this topic

#1 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 10 February 2009 - 12:05 AM

Does anybody know if there exists a good contig like tool for linux to make a file continuous (for use with grub4dos emulation)? I know that there are only a very few defragment tools for linux, which don't work very well.

Offline ext2 defragmenter, e2defrag, exists but requires that the ext3 filesystem be converted back to ext2 first. But depending on the feature bits turned on in the filesystem, e2defrag may destroy data; it does not know how to treat many of the newer ext3 features.

There are userspace defragmentation tools like Shake and defrag. Shake works by allocating space for the whole file bolt upright and hoping that it will make the newly allocated file less fragmented. It also tries to write files used at the same time next to each other. Defrag works by copying each file over itself. However they only work if the filesystem is reasonably empty. A true defragmentation tool does not exist for ext3.
http://en.wikipedia....Defragmentation

The Ext4 filesystem will have an online defragmenter:
http://en.wikipedia.org/wiki/Ext4

#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 10 February 2009 - 08:25 AM

I guess that defrag:
http://fedorafastboo...orge.net/Defrag

never worked correctly and it seems like abandoned.

There was a beta from OO:
http://web.archive.o...inux/index.html
http://ubuntuforums....hp/t-50127.html

but it seems like it vanished form the scene. :poke:

Maybe, just maybe, this is a new start:
http://polishlinux.o...ux-filesystems/
though it seems not "low-level" as it should be needed :poke:

Then there is defragfs:
http://sourceforge.n...ojects/defragfs
seems as well stopped/no more developed, and however it seems like for ext2fs only as well.

jaclaz

#3 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 10 February 2009 - 01:16 PM

Just like I thought, no decent defragmenting tools for linux :poke: . I will have to wait for ext4 support in the next Ubuntu.

#4 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 10 February 2009 - 03:21 PM

By design Linux(I mean ext2/3/4) is not suitable for storing contiguous image files.

Even if you copy an image file to an empty ext2 partition, the file might be non-contiguous.

So if you need a filesystem to store images for grub4dos emulation, you may use FAT/NTFS, or you can simply use a whole raw partition.

#5 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 10 February 2009 - 03:54 PM

Will linux make, continuous files when writing to fat or NTFS?

What do you mean with a RAW partition? Do you mean write the image with the dd command to a partition without a filesystem?

#6 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 10 February 2009 - 07:11 PM

Will linux make, continuous files when writing to fat or NTFS?


It will make continuous files when MS filesystem has no holes; no matter whether the OS is Linux, Dos or Windows. What are holes here I mean? If you delete a file, then possibly there will be holes in the filesystem. If you write a file to an empty FAT or NTFS filesystem, then the file will be continuous. If you continue to write other files(sequently, one after another) without deleting any one, then all the files will be still continuous. But no luck for ext2fs.

What do you mean with a RAW partition? Do you mean write the image with the dd command to a partition without a filesystem?


Yes. So this is less useful than using FAT or NTFS.

#7 ScarySpons

ScarySpons

    Member

  • Members
  • 36 posts
  •  
    Zimbabwe

Posted 08 January 2014 - 03:11 PM

Dear tinybit.. or others.. sorry for reviving this topic.. but i have a question regarding this workaround of tinybit..

 

How do i write from Ubuntu an image (VHD) to a filesystemless partition?

If i get it right, i must delete a partition in GParted or so .. (right?) and then use this dd command to write the VHD to this (deleted) partition? (right?)

But.. What is the exact ubuntu/linux shell command for this to do it?

 

Maybe this is a solution to my problem... :)


Edited by ScarySpons, 08 January 2014 - 03:12 PM.

  • crashnburn likes this

#8 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 08 January 2014 - 11:36 PM

You know what a whole drive is, and what a partition is, surely.

 

A partition is a contiguous area. It has a starting sector and a length. The starting sector is usually the Volume Boot Record, or sometimes called Super Block. If you do not want to create a filesystem for this partition, then the VBR or SB is no use, and you can simply place your data on it.

 

A raw partition means a partition that (itself) is only created but not yet built any filesystem(on the partition). "raw" means "bare".

 

The whole partition (whether or not it is raw) can be considered(and accessed) as a file(and surely contiguous). In grub4dos, the "file name" for the partition can be "(hdM,N)XXXXXXXX+YYYYYYYY". In linux, the file name or device name for the partition is somewhat like "/dev/hda1".

 

"cat --hex Filename_for_your_partition" (in grub4dos) and "hexdump Filename_for_your_partition" (in linux), both will show the same data for you.



#9 ScarySpons

ScarySpons

    Member

  • Members
  • 36 posts
  •  
    Zimbabwe

Posted 12 January 2014 - 10:26 AM

i understand it now clearly. thank you tinybit.

but how do i write/place my vhd to this 'raw partition' ... what's the linux command for this?
i can't get to find that out... or can i do it via an XP live too? Some tips on this would be welcome... :)

#10 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 12 January 2014 - 04:24 PM

but how do i write/place my vhd to this 'raw partition' ... what's the linux command for this?
i can't get to find that out... or can i do it via an XP live too? Some tips on this would be welcome... :)

With DD on Linux and DD for Windows on Microsoft Windows.
dd if=/path/to/my.vhd of=/dev/sdXY
Where sdXY is the device-name of the destination partition (not the whole disk!).
  • ScarySpons likes this

#11 ScarySpons

ScarySpons

    Member

  • Members
  • 36 posts
  •  
    Zimbabwe

Posted 13 January 2014 - 02:08 AM

Thank you Sha0 .. something to play with for the next weekend then :)
Thanks alot for now guys!

#12 crashnburn

crashnburn

    Frequent Member

  • Advanced user
  • 136 posts

Posted 14 April 2017 - 05:44 AM

So any consensus on this for the Ext3 volumes? Which is best/ stable/ reliable? 



#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 April 2017 - 02:51 PM

I guess that BEFORE establishing which is best/stable/reliable wee need some consensus of what is the list of the "which".
The list made in 2009 (eight years ago) may need to be updated.

My guess is that for ext3 nothing has changed, whilst for ext4 something may have, check this thread here:
https://www.spinics....4/msg43074.html

:duff:
Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users