Fragmentation of modules on NTFS hard drive
-
- Shogun
- Posts: 238
- Joined: 12 Jun 2021, 21:59
- Distribution: Xfce 4.12 - 5.rc3 - x86_64
- Location: France
Fragmentation of modules on NTFS hard drive
Not a question but an observation
Be careful if you share an NTFS* hard drive with MS Windows and Porteus as it can fragment your files from Linux
My disk is very full [70% - 80%] and I have to defragment regularly. Because I notice that my modules saved from Porteus split into small pieces
I use Defragler on Windows, which allows me to choose the files I want to defragment (the biggest or the most fragmented), decrease the number of free spaces etc...
*I think the problem is the same on the small USB keys formatted in Fat32
Be careful if you share an NTFS* hard drive with MS Windows and Porteus as it can fragment your files from Linux
My disk is very full [70% - 80%] and I have to defragment regularly. Because I notice that my modules saved from Porteus split into small pieces
I use Defragler on Windows, which allows me to choose the files I want to defragment (the biggest or the most fragmented), decrease the number of free spaces etc...
*I think the problem is the same on the small USB keys formatted in Fat32
- Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Fragmentation of modules on NTFS hard drive
And probably on larger USB keys formatted in exFAT.
Are you saying ext2-4 formatted drives don't fragment files?
Are there any Linux apps that defrag drives?
I use DiskDefrag 8.0.23 in Windows, which defrags files on hard drives and SSD drives.
-Update-
Be sure to do a Windows Disk Cleanup.
Code: Select all
echo Do Start ^> All apps ^> Windows Administrative Tools ^> Disk Cleanup ^> OK
echo ^> Clean up system files ^> OK
echo ^> More Options ^> System Restore and Shadow Copies ^> Clean up ^> Delete ^> OK
echo ^> Delete files
echo.
echo * A Windows Update Cleanup can take an **HOUR**!!
And delete .tmp files as Admin.
Code: Select all
:: Check for Run as Admin
:: https://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights
net sessions >nul 2>&1
if %errorLevel% == 0 (
echo Running as Admin. Yeah!!
) else (
echo.
echo Deleting .tmp files more effective when run as Admin.
pause > nul
)
Code: Select all
echo Deleting AppData Temp files
::for /d %%d in (dir %_drv1%\"Users\%_user%\AppData\Local"\{*. /b) do if "%%d" neq "dir" if "%%d" neq "/b" rmdir "%%d" /q /s > nul
for /d %%d in (dir %_drv1%\"Users\%_user%\AppData\Local\Temp"\*.*. /b) do if "%%d" neq "dir" if "%%d" neq "/b" rmdir "%%d" /q /s > nul
del %_drv1%\"Users\%_user%\AppData\Local\Temp"\*.tmp /q /f > nul
del %_drv1%\"Users\%_user%\AppData\Roaming\U3"\*.* /q /f /s > nul
::del %_drv1%\"Users\%_user%\AppData\Local\Edge\User Data\Default\JumpListIcons\RecentClosed"\*.tmp /q /f > nul
del %_drv1%\"Users\%_user%\AppData\Local\Packages\Microsoft.MicrosoftEdge*"\*.tmp /q /s > nul
del %_drv1%\"Users\%_user%\AppData\Local\Packages\*"\*.tmp /q /s > nul
echo Deleting %_drv1%\*.tmp files
del %_drv1%\*.tmp
del %systemroot%\*.tmp
del %systemroot%\system32\*.tmp
del %systemroot%\temp\*.tmp
Ed
Fragmentation of modules on NTFS hard drive
Is fragmentation an issue on non-disc units? I don't think so. Even on discs, the performance hit should be really minimal.
- babam
- Warlord
- Posts: 528
- Joined: 16 Nov 2016, 10:30
- Distribution: Porteus 5.0rc3 Xfce K6.1.1
- Location: Rainy city
Fragmentation of modules on NTFS hard drive
In my case, grub4dos/grub4uefi could not boot if the Iso file was not-contiguous/fragmented.
Sorry, my English is bad.
-
- Shogun
- Posts: 238
- Joined: 12 Jun 2021, 21:59
- Distribution: Xfce 4.12 - 5.rc3 - x86_64
- Location: France
Fragmentation of modules on NTFS hard drive
From what I understand, in linux partitions (ext2/3/4) there is much less fragmentation because it is better managed: the files are saved in priority in a contiguous way, separated with space from the others and distributed on the whole disk.
I read that you shouldn't do it too much because it wears out the memory device (SSD)
I use BleachBit (Portable) who do a good job. Softwares and data (on 2 différents partitions)
- Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Fragmentation of modules on NTFS hard drive
After you run BleachBit Rapha_ try running the Windows Disk Cleanup's Windows Update Cleanup and see how much space it projects. Let me know what it shows.
Ed
- Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Fragmentation of modules on NTFS hard drive
Cheers!
Yours Rava
Yours Rava
-
- Shogun
- Posts: 238
- Joined: 12 Jun 2021, 21:59
- Distribution: Xfce 4.12 - 5.rc3 - x86_64
- Location: France
Fragmentation of modules on NTFS hard drive
I use Win XP, the only thing it offers me is to compress files that I haven't used for a while...but I don't want that !
I've been doing some cleanup myself by deleting the big files I don't use, then defragmented the files and very importantly, I've reduced the free space between them
Yes, I have tried on my laptop computer e4defrag (defragmenter for ext4 file system) :
https://man7.org/linux/man-pages/man8/e4defrag.8.html
Although practically empty, with only Porteus installed, I had some modules divided into two parts...
- Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Fragmentation of modules on NTFS hard drive
I hope you never go online with that OS? Due to no security fixes available for years now.
I have even several XP professional original CDs with the original Windoze Certificates and Windoze ID… but usually if I would use Windoze any software I could be interested in would demand at least W7 if not W10…
But having no Windoze at all and only Linux is a bliss.
Added in 6 minutes 7 seconds:
At least in Porteus 5.0rc3 we have it:Rapha_ wrote: ↑20 Nov 2021, 01:26Yes, I have tried on my laptop computer e4defrag (defragmenter for ext4 file system) :
https://man7.org/linux/man-pages/man8/e4defrag.8.html
Code: Select all
root@porteus:~# e4defrag
e4defrag 1.46.4 (18-Aug-2021)
Usage : e4defrag [-v] file...| directory...| device...
: e4defrag -c file...| directory...| device...
Info here:
https://askubuntu.com/questions/221079/ ... tem#620966
Added in 3 minutes 5 seconds:
Question: why does e4defrag print its version info but e.g. fsck.ext2 aka e2fsck refuses doing so:
Code: Select all
root@porteus:~# fsck.ext2
Usage: /sbin/e2fsck [-panyrcdfktvDFV] [-b superblock] [-B blocksize]
[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
[-E extended-options] [-z undo_file] device
Emergency help:
-p Automatic repair (no questions)
-n Make no changes to the filesystem
-y Assume "yes" to all questions
-c Check for bad blocks and add them to the badblock list
-f Force checking even if filesystem is marked clean
-v Be verbose
-b superblock Use alternative superblock
-B blocksize Force blocksize when looking for superblock
-j external_journal Set location of the external journal
-l bad_blocks_file Add to badblocks list
-L bad_blocks_file Set badblocks list
-z undo_file Create an undo file
Code: Select all
root@porteus:~# fsck.ext2 -version
/sbin/e2fsck: invalid option -- 'e'
root@porteus:~# fsck.ext2 --version
/sbin/e2fsck: invalid option -- '-'
Cheers!
Yours Rava
Yours Rava
- Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Fragmentation of modules on NTFS hard drive
All this Windows XP talk reminds me of the Bart PE and 911 CD days. A good forum and good memories.
Did not expect that.
Ed
-
- Full of knowledge
- Posts: 2071
- Joined: 17 Jun 2013, 13:17
- Distribution: Porteus 3.2.2 XFCE 32bit
- Location: Germany
Fragmentation of modules on NTFS hard drive
Code: Select all
root@porteus:/# fsck.ext2 -V
e2fsck 1.43.1 (08-Jun-2016)
Using EXT2FS Library version 1.43.1, 08-Jun-2016
- Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Fragmentation of modules on NTFS hard drive
Okay, now I jump behind a train, or into a very warm and shallow creek on a hot summer day, or out of the window of the basement.donald wrote: ↑20 Nov 2021, 16:18Code: Select all
root@porteus:/# fsck.ext2 -V e2fsck 1.43.1 (08-Jun-2016) Using EXT2FS Library version 1.43.1, 08-Jun-2016
Added in 3 minutes 54 seconds:
Anyhow, this page
https://askubuntu.com/questions/221079/ ... tem#620966
also has this info:
Sounds quite complex, I never did a defragmentation like that.Use Gparted to defrag your file system
If you have enough space on your hard drive, you can use Gparted to defrag your file system (ext2, ext 4, nfts, etc.). You have to boot from a CD/DVD/USB boot disc because the drive you're working on has to be unmounted. You also have to have more unused space available than used space for this to work and it may take a while.
● Boot from a boot disc.
● Run gparted and shrink the partition that contains the data you want to defrag to just over the amount of your data.
● Make sure the partition you want to defrag is the last partition on the drive by moving it to the end (you may have to create another blank partition in front of it if there's only one partition on the drive).
With the partition you want to defrag as the last partition on the drive:
● grow the partition to the left of it to maximum size. This will move your partitions data to the end of the drive.
● Once it's done, shrink that partition back to it's previous size.
● If you created a blank partition to have more than one on the disc, you can now delete it.
● Move your partitions back into the original order and regrow the partition you wanted defragged back to it's full size.
It's now defragged.
What do you folks think of this approach?
Cheers!
Yours Rava
Yours Rava
- Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Fragmentation of modules on NTFS hard drive
This sounds quicker:
1. Copy all files on the drive to be defrag to another drive.
2. Format the drive to be defraged.
3. Copy all files back to the original drive.
Ed
- Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Fragmentation of modules on NTFS hard drive
Indeed it does. Especially when you can connect a eSATA or USB3 external drive for doing your approach.
Then there is this:
(highlighting by me)You also have to have more unused space available than used space for this to work
Who has that on his internal drive?
Added in 57 minutes 13 seconds:
And then we have this:
https://www.ghacks.net/2010/08/11/conve ... 3-to-ext4/
I think closing your browser tab with the above Convert ext2/3 to ext4 link in it is sufficient, no need to close the whole browser.Convert ext2/3 to ext4
Let's say you're a little bit behind the times. You've wanted to do some upgrading of your Linux machines but you've just not really had the time. Or let's say you did do some upgrading of your Linux system but you didn't make any changes to your file system and you're still running a machine with either ext2 or ext3. Now that's not necessarily a bad thing as both file systems work and work well. But let's say you do want to take advantage of some of the features of ext4.
In this article I am going to show you how to migrate your ext2 or ext3 partition to ext4. I will use a Ubuntu machine as an example. I want to warn you that you could lose data by doing this so, following good administrative practices, back up your data! Once you are certain you have that backup of your data, it's time to begin.
Kernel pre-requisite
You must be certain you have a kernel that is at least 2.6.28-11-generic or higher. If not, do NOT continue on with this. To find out what kernel you are running issue the command uname -r. If your kernel is lower than 2.6.28-11 stop where you are and close your browser.
Cheers!
Yours Rava
Yours Rava