SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need to enlarge the root file system on a Slackware 13.0 32-bit system; it's in a simple logical partition (/dev/sda6) -- no LVM, mirroring etc. This might be a good opportunity to change from ext4 to jfs, too.
Routine procedure, no? No!
First off I booted Knoppix 5.31 but found it doesn't have ext4 support (no efs2ck and running fsck results in "fsck.ext4: not found").
So I booted Slackware 13.0 32-bit CD-1 only to get the same as with Knoppix.
I do have a GParted-liveCD 0.3.4-11 but have had mixed experiences with it so am reluctant, despite having backups.
What to do for best, ideally including changing from ext4 to jfs, too?
If you want to change from ext4 to jfs, you need to create a new filesystem. Given that's the case, you will need to backup your data first to copy it over to the new filesystem when you're done, so nothing prevents you from destroying and re-creating the partition too, while you're at it.
Without filesystem change, yes, I'd use the gparted live-cd. I usually download the latest [EDIT: STABLE] available version before doing this kind of operations.
Slackware's 1st installation CD should offer enough tools to resize ext4 partition. Enlarging a partition is even easier then shrinking. See manual for resize2fs tool for instructions and parameters. I did successfuly resized ext3 partitions only so I cann't backup with practical experience on ext4. (Forced) fsck, resizing partition with fdisk, resizing filesystem with resize2fs, checking resized partition with fsck again. Don't forget to backup first ! I did warned you.
If you don't have some special well-founded reason to replace ext4 with JFS I wouldn't do it.
If you want to change from ext4 to jfs, you need to create a new filesystem. Given that's the case, you will need to backup your data first to copy it over to the new filesystem when you're done, so nothing prevents you from destroying and re-creating the partition too, while you're at it.
Without filesystem change, yes, I'd use the gparted live-cd. I usually download the latest [EDIT: STABLE] available version before doing this kind of operations.
I've got a dar backup on another partition and on DVD and a dd backup on a partition on another HDD (belt, braces and suspenders!) but am planning on copying the files using cp.
Quote:
Originally Posted by David1357
If you are having problems with the GParted LiveCD, try System Rescue CD.
SystemRescueCd looks like a useful tool for the armoury.
Quote:
Originally Posted by dunric
Slackware's 1st installation CD should offer enough tools to resize ext4 partition. Enlarging a partition is even easier then shrinking. See manual for resize2fs tool for instructions and parameters. I did successfuly resized ext3 partitions only so I cann't backup with practical experience on ext4. (Forced) fsck, resizing partition with fdisk, resizing filesystem with resize2fs, checking resized partition with fsck again. Don't forget to backup first ! I did warned you.
If you don't have some special well-founded reason to replace ext4 with JFS I wouldn't do it.
Ah! I thought Slackware's 1st installation CD would have the tools. Will try resizefs soon.
Why wouldn't you use JFS? There have been problems with ext4, well explained here and Linus Torvalds has written strongly on the issue as linked by H_TeXMeX_H in this post in a relevant LQ thread. I am not aware of any similar concerns about JFS and netsearching suggests it offers a good combination of speed and reliability.
I've got a dar backup on another partition and on DVD and a dd backup on a partition on another HDD (belt, braces and suspenders!) but am planning on copying the files using cp.
SystemRescueCd looks like a useful tool for the armoury.
Ah! I thought Slackware's 1st installation CD would have the tools. Will try resizefs soon.
Why wouldn't you use JFS? There have been problems with ext4, well explained here and Linus Torvalds has written strongly on the issue as linked by H_TeXMeX_H in this post in a relevant LQ thread. I am not aware of any similar concerns about JFS and netsearching suggests it offers a good combination of speed and reliability.
The "bug" (rather feature) is about a year old and mentioned possibla data loss on ext4 was fixed soon with patches which came to the upstream and are now officialy included in kernel release 2.6.30 .
The "bug" (rather feature) is about a year old and mentioned possibla data loss on ext4 was fixed soon with patches which came to the upstream and are now officialy included in kernel release 2.6.30 .
Thanks for the info (the kernel on the system is 2.6.29)
Ah! I thought Slackware's 1st installation CD would have the tools. Will try resizefs soon.
Except that it doesn't have an fsck for ext4 (as far as I can make out) and I understand it is good practice to run fsck before and after resizing ... ?
Meanwhile, I'm fixing Vuze (this LQ thread) to download the latest Knoppix and Gparted.
e2fsck can be used to check all ext2/ext3/ext4 filesystems. You'd have to read manpages to know what you'll be doing or end up with a broken system.
Thanks dunric
Maybe I missed something but there was no e2fsck on either Knoppix or Slackware 13.0 CD 1. Using Slackware 13.0 CD 1, I tried simply fsck and got error message "fsck.ext4: not found".
I've resized a few file systems in my time but still spent ~30 minutes netsearching the technique and am well backed up ... which makes it all the sillier that I'm making such a pigs ear of it
Am just about to burn gparted-live-0.5.1-1.iso to CD ...
Am just about to burn gparted-live-0.5.1-1.iso to CD ...
Oh dear! This is turning into one of those simple tasks that become major projects
After booting Gparted Live 0.5.1, on trying to resize /dev/sda6 soon got "An error ocurred while applying the operations. See the details for more information" but there were no details. Tried to create a partiton (jfs) and got same message. On shutting down Gparted's Linux, got something like (kept scrolling off screen) "kernel unable to read the partition table ... device busy".
Happily Slackware booted OK. /dev/sda6 has the new size and the new partition (/dev/sda11) exists. Root file system same size. Nothing obviously untoward in /var/log/{dmesg|syslog|messages}.
Solved, in that there is now a 15 GB partition formatted with JFS and containing all the files from the original root partition. Not solved in that the system will not boot from it but I've started another thread for that.
In case it matters to anyone, here's how it went.
Booted Knoppix 6.2.1 ...
Ran e2fsck on the existing ext4 root file system. OK (unlike on Knoppix 5.31).
Deleted the unused 15 GB partition created by Gparted. Unexpectedly Gparted had created it as /dev/sda11, contrary to the convention that logical partitions are numbered sequentially from 5 in position-on-disk order in which case, being the 3rd logical it would be sda7.
Used cfdisk to create new 15 GB partition in same place. This was given name /dev/sda7 in the conventional way. On writing the changes, cfdisk was unable to re-read the partition table so ...
Rebooted Knoppix 6.2.1 ...
Ran mkfs -t jfs /dev/sda7 but got "mkfs.jfs: no such file"
Booted Slackware using the old root ...
Ran mkfs -t jfs /dev/sda7 (in retrospect it would have been easier to re-create the new partition and mkfs it on Slackware before booting Knoppix).
Booted Knoppix 6.2.1 ...
Mounted /dev/sda6 (old root) and /dev/sda7 (new root) at /media/sda6 and 7 respectively then ran
Code:
cd /dev/sda6
tar -c -f- . | (cd /media/sda7 && tar -xv)
(This root migration is definitely those simple tasks that challenge the notion of "simple task". While waiting for the file copy, I went to tighten a loose screw on the office chair. It turned out much of the chair back had disintegrated and captive nuts had disappeared inside ).
Modified /boot/grub/menu.lst, adding stanzas for /dev/sda7 as root.
Modified the root line in /etc/fstab on new root.
And that was it, done at last -- except the new root won't boot as per the other thread.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.