LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-10-2006, 02:31 PM   #1
Hep
LQ Newbie
 
Registered: Dec 2005
Posts: 25

Rep: Reputation: 15
Increment Files System's size


Hi, Is there a way to increment the size of a file system with another hard disk? I am using a legacy ssytem, RH 7.1, so logic volume module is unavailable. Thanks in advance.
 
Old 07-10-2006, 03:00 PM   #2
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 638
Blog Entries: 1

Rep: Reputation: 52
This is how I would do it, using as an example /home (assuming that the new hard drive is larger than your existing /home partition): (1) backup all of the data in /home and the partition on the existing hard drive that is next to /home (typically /var); (2) delete the old /home partition and expand /var to include what was the old /home partition;(3) install the 2nd hard drive, fill that entire hard drive with one partition and make /home the mount point for that new partition; and (4) restore the data to /home and /var.
 
Old 07-10-2006, 04:22 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by Hep
Hi, Is there a way to increment the size of a file system with another hard disk? I am using a legacy ssytem, RH 7.1, so logic volume module is unavailable. Thanks in advance.
LVM is the best way, but you don't have that. Also, converting a non-LVM filesystem to LVM can be a bit of work (a second disk for temporary copies of data is most helpful).

But you don't/can't have LVM, so you might try unionfs. A bit messier, but it can get the job done.

For example, let's extend /usr/local which is just a subdirectory under /usr for this example. The steps could be modified slightly if /usr/local were a seperate mountpoint. You'll obviously need to be root, and might want to do this from single-user mode if people are likely to be using /usr/local while you're trying to mess with it.

(1) install unionfs
(2) mv /usr/local /usr/local.1
(3) mount /dev/whatever /usr/local.2 (where "/dev/whatever" is a partition on your new disk)
(4) mkdir /usr/local
(5) mount -f unionfs -o dirs=/usr/local.2:/usr/local.1=ro none /usr/local

Don't ever mess with the /usr/local.1 or /usr/local.2 directories directly. Always use /usr/local

This will get you your filesystem expansion, but it really would be better to go for LVM if at all possible. unionfs uses some "magic" that might be confusing later. For example, suppose you had an older file that physically exists at /usr/local.1/oldfile You later delete that file with "rm /usr/local/oldfile" The file appears gone when looking at /usr/local However, in fact it still exists on /usr/local.1 but has been "whited-out" on /usr/local.2, which is overlaid on top of the original /usr/local.1 Think of /usr/local as a "view" that encompasses the writeable layer /usr/local.2 "on top of" the readonly layer /usr/local.1 All file additions, changes, and deletions must happen on /usr/local.2 since that's the only writeable layer. Thus the "white-out" scenerio for file deletion.

Like I said, unionfs can get the job done, but LVM is better as a long term solution. Or you could just buy a new bigger disk and transfer all your existing stuff to it.

Last edited by haertig; 07-10-2006 at 04:23 PM.
 
Old 07-12-2006, 03:21 PM   #4
Hep
LQ Newbie
 
Registered: Dec 2005
Posts: 25

Original Poster
Rep: Reputation: 15
Thanks, it helps a lot.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash equivalent to C increment operator andrewb758 Linux - General 5 02-21-2009 12:25 PM
increment in hex snutz411 Linux - Newbie 2 11-01-2005 05:54 PM
Successful login from locked screen causes pam_tally to increment. Why? mzmyewski Linux - Security 2 03-03-2005 09:25 AM
PHP set of variables increment? Ctawp Programming 6 06-18-2004 01:03 PM
increase point size size when printing PDF files newlin Red Hat 0 09-27-2003 07:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:11 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