You are not logged in.

#1 2012-09-19 14:59:48

MrRoberts
Member
Registered: 2012-07-05
Posts: 47

[Solved] Questions about defragging JFS filesystem

Hi all,

Just want to understand defrag JFS filesystem correctly before doing it on my computer.

I'm using the latest Arch Linux with KDE and have 4 partitions.

sda1 = boot = ext2 = 500MB
sda2 = root = jfs = 15GB
sda3 = swap = 6GB
sda4 = home = jfs = 50GB

How do I correctly and safely defrag root/home partitons?

Last edited by MrRoberts (2012-09-23 10:39:02)

Offline

#2 2012-09-19 15:11:34

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Questions about defragging JFS filesystem

I am pretty sure that since JFS is ported from OS/2, the defrag feature has not yet made it.  But with any filesystem of any kind, you can always use the backup/restore method.  Simply use your favorite tool to make a backup, recreate the filesystem, and then move everything back.  I personally use rsync to backup some of my stuff already, so it makes sense that I simply reverse it.

This will also allow switching filesystems.  I know you are not using btrfs, but here is an example of how to use rsync or tar to do this.  I think the jfs arch wiki page shows how you might do it with dd.  I like to do rsync or tar because with *nix everything is a file, so you can simply move all the files, and you have a restored working filesystem.

BTW, if your disk is an SSD, jfs is not the best option.  Only ext4 and btrfs support TRIM at this time.  Also, if you actually depend on that swap space for more than just hibernation, the further from the center (beginning) of the disc you go, the more degraded the poerformance becomes.  If you are only using swap for hibernation, it may be better to just use a swap file.

Offline

#3 2012-09-19 19:48:22

MrRoberts
Member
Registered: 2012-07-05
Posts: 47

Re: [Solved] Questions about defragging JFS filesystem

Backup what from the root? Do I just recreate the filesystem?

Offline

#4 2012-09-20 03:05:06

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Questions about defragging JFS filesystem

Backup the filesystem of a given partition.  For instance, to backup root I would rsync recursively while preserving permissions from / making sure to exclude /var, /home, /mnt, /sys, etc.  I have a separate partition for /var as well as /home, while I usually personally prefer to mount stuff on /mnt (avoid an endless loop).  Also, you probably want to not backup directories populated by the system on boot.  Then recreate the filesystem, either the same jfs or something new if I prefer, and then reverse the rsync process.  Is that clear enough?

Offline

#5 2012-09-20 06:10:36

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [Solved] Questions about defragging JFS filesystem


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#6 2012-09-20 14:47:37

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Questions about defragging JFS filesystem

Thanks DSpider, something like that is probably far more appropriate than my responses.

Offline

#7 2012-09-20 16:12:14

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [Solved] Questions about defragging JFS filesystem

You can also use shake from the repos or defrag utilities from AUR.

Offline

#8 2012-09-22 06:12:15

MrRoberts
Member
Registered: 2012-07-05
Posts: 47

Re: [Solved] Questions about defragging JFS filesystem

Thanks all for your responses and I'll continue to learn about the inside/out of jfs filesystem before I do anything that I might regret.

Found a useful tool called Defragfs and it is quite good.

Last edited by MrRoberts (2012-09-22 06:36:35)

Offline

#9 2012-09-22 13:15:28

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Questions about defragging JFS filesystem

If you have the info you need, don't forget to makr the thread as solved.

Offline

Board footer

Powered by FluxBB