LinuxQuestions.org
Visit Jeremy's Blog.
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 01-17-2008, 03:42 AM   #1
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Rep: Reputation: 30
Replacing harddisk with /home partition


Hi guys,

I have a simple FTP server running on 2 harddisk.
1 is holding the system kernel and such,
1 is holding the /home partition with all the users' files.

I have plans to upgrade the /home harddisk to a higher capacity.
Remounting is not an issue. I suppose copying existing files are not an issue.

But what is the fastest way to deploy the harddisk such that it will maintain the quota and user directories, with its respective permissions, set initially?

thanks!
 
Old 01-17-2008, 01:43 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
I'm no authority, so take this advice with a grain of salt. Here's how I made the transition on my desktop.

1) if you can connect the new drive along with the other two, partition and format the new drive using your favorite partition tool and the mkfs command.

2) make a mount point to mount the drive: mkdir /mnt/newdrive.

3) mount the new drive: mount /dev/sdXY /mnt/newdrive (where X and Y refer to the drive letter and partition number).

4) taking a quote from an example given by LQ member Saikee:
Quote:
If the source and target partitions are diffierent in size the tar command is the best and produces a 100% copy. Assuming the source is /mnt/hda6 and the target is sdb6, just cd to /mnt/hda6 and type

tar cf - . | (cd /mnt/sdb6; tar xf -)
Modify the disk and partition numbers to suit your situation.

Edit /etc/fstab to add a line for the new drive and partition to be mounted at /home, and comment out or delete the line for the existing /home partition.

Use whatever means you feel necessary to verify that you have a good copy of /home in /mnt/newdrive.

5) reboot.

If you intend to remove the old disk, your drive letter may change for the new drive, and you may need to edit /etc/fstab to account for that change.
 
Old 01-22-2008, 04:45 AM   #3
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
but will this port over quota management and folders/files permissioning?
 
Old 01-22-2008, 10:22 AM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Add the lowercase -p option to tar (tar -pcf ....) to preserve permissions.

As for quotas, that is setup in a config file in /etc, isn't it. If so, quotas should'nt be affected by the change of hard drive until you edit the applicable config file.
 
Old 01-22-2008, 08:42 PM   #5
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
ah ok... cos my quotas are set to /home...

i'll give this a try.. and let you guys know in due time the result. thanks!
 
  


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
Putting /home on a different harddisk? Swakoo Linux - Newbie 9 10-27-2005 04:35 AM
Harddisk fails. /home cannot be mounted bladehaze Linux - Hardware 1 10-08-2005 08:36 PM
harddisk partition trouble Thulemanden Linux - Hardware 9 09-08-2005 05:07 AM
how to partition a harddisk?? Sammy2ooo Linux - Newbie 7 05-14-2003 06:20 AM
harddisk partition chin Linux - Software 1 10-06-2000 01:43 PM

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

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