LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-19-2003, 12:10 PM   #1
Breezwell
Member
 
Registered: Apr 2001
Location: Chicago
Distribution: Gentoo 1.4
Posts: 214

Rep: Reputation: 30
Partition Expansion Idea


Hi Everyone,

I have been toying with trying something and I am not sure if it is possible ( or wise ).
Here we go .....

I am currently running Gentoo 1.4
My partitioning scheme is very simple:
/dev/hda1 /boot 34MB
/dev/hda2 /swap 128MB
/dev/had3 / 4GB

The remainder of the disk houses LFS, Mandrake 9.2 and Slackware distros.
Well, it didn't take long to fill root on /dev/hda3.

What I am thinking of doing is installing a second 20GB hard disk: /dev/hdb.
I would like to create a partition, say /dev/hdb1 with 10GB of disk space.

Can I safely copy the contents of my /usr directory on /dev/hda3 to this new partition, rename the /usr directory on /dev/hda3 to something like usr.bak and mount this new partition on /dev/hda3 as /usr with the new space and old files while not messing up such things as symlinks?

I figure that if the new partition doesn't work, I can always fall back on my saved copy of /usr.bak by renaming it /usr.


This sounds like a simple solution to a (common?) space problem but I don't want to risk hosing my current installation.

Thanks everyone.
 
Old 12-19-2003, 12:59 PM   #2
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
Quote:
Can I safely copy the contents of my /usr directory on /dev/hda3 to this new partition, rename the /usr directory on /dev/hda3 to something like usr.bak and mount this new partition on /dev/hda3 as /usr with the new space and old files while not messing up such things as symlinks?
Yes, you can. Do it while in runlevel 1, so the stuff in /usr won't be needed. Edit fstab and add an entry for the /usr partition. Example:
$mke2fs /dev/hdb1
$vi /etc/fstab
#*Stuff added to fstab*
/dev/hdb1 /usr ext2 defaults 0 0

$mv /usr /usr.bak
$mkdir /usr
$mount /dev/hdb1
$cp -a /usr.bak/* /usr
*long wait*
$init 5
You're all set! If it works okay, you can delete /usr.bak.
 
Old 12-19-2003, 04:06 PM   #3
Breezwell
Member
 
Registered: Apr 2001
Location: Chicago
Distribution: Gentoo 1.4
Posts: 214

Original Poster
Rep: Reputation: 30
aaa,

I figured that as long as I backed up /usr I would be okay if something went wrong during the copy. Good point about staying in runlevel 1.

Thanks for the input.
 
  


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
Does anyone have the expansion pack for 5.2? solid7 AIX 14 04-26-2005 12:18 PM
a complete idea of partition and installation bruse Mandriva 2 02-24-2005 08:22 AM
Resize ext3 with Partition Magic... good idea or not? TheOneAndOnlySM Linux - General 2 12-19-2003 08:32 PM
Scripting help -- pathname expansion player_2 Programming 3 08-25-2003 05:03 PM
Raid 5 Expansion Ruckuss Linux - General 3 01-05-2002 05:04 PM

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

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