You are not logged in.
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
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
Backup what from the root? Do I just recreate the filesystem?
Offline
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
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
Thanks DSpider, something like that is probably far more appropriate than my responses.
Offline
You can also use shake from the repos or defrag utilities from AUR.
Offline
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
If you have the info you need, don't forget to makr the thread as solved.
Offline