LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-16-2010, 11:14 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Options for enlarging root file system?


Hello :-)

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?

Best

Charles
 
Old 02-16-2010, 12:06 PM   #2
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
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.

Last edited by rg3; 02-16-2010 at 12:09 PM.
 
Old 02-16-2010, 12:08 PM   #3
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by catkin View Post
What to do for best, ideally including changing from ext4 to jfs, too?
If you are having problems with the GParted LiveCD, try System Rescue CD.

If you really want to switch from EXT4 to JFS, I think most people on this forum would agree that the safest procedure would be
  1. Backup all files on the EXT4 partition (e.g. create a tarball)
  2. Delete the EXT4 partition
  3. Create a new JFS partition
  4. Restore the files from the backup (e.g. extract the tarball)
 
Old 02-16-2010, 12:15 PM   #4
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
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.
 
Old 02-16-2010, 01:01 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks all
Quote:
Originally Posted by rg3 View Post
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 View Post
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 View Post
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.
 
Old 02-16-2010, 05:53 PM   #6
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
Quote:
Originally Posted by catkin View Post
Thanks all

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 .

Last edited by dunric; 02-16-2010 at 05:59 PM.
 
Old 02-16-2010, 09:56 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by dunric View Post
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)
 
Old 02-17-2010, 04:21 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by catkin View Post
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.
 
Old 02-17-2010, 09:04 AM   #9
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
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.
 
Old 02-17-2010, 10:40 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by dunric View Post
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 ...
 
Old 02-17-2010, 11:47 AM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by catkin View Post
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}.

Back to fixing Vuze so can get latest Knoppix ...
 
Old 02-21-2010, 05:25 AM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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.
 
  


Reply

Tags
ext4, filesystem, gparted, jfs, knoppix, root, slackware



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
best file system type and formatting/mount options for virtual machines mrtwice Linux - Virtualization and Cloud 1 12-17-2009 01:08 PM
i cannot copy a file to a folder in file system with my root account realbezo Linux - Newbie 4 03-03-2009 10:45 PM
File System Encryption Options carlosinfl Linux - Security 1 09-10-2008 10:12 AM
LXer: Linux File System Security Options LXer Syndicated Linux News 0 03-22-2007 01:16 PM
Boot Error: Root file system /dev/root adtomar Linux - Networking 0 12-27-2004 10:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration