Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After adding a new drive... 3

Status
Not open for further replies.

telcomwork

Technical User
Mar 2, 2002
1,625
US
I'm going to add a new HDD and I need to move the mount and contents from the old drive to the new drive.

For example lets say I'm goign to add /dev/sda6 and need to move contents from /dev/sda2 (/var) to /dev/sda6 and moving the /var



What is the best way and could you provide details if possible?

Thank you!
 
If you google for "add new drive linux" you'll find plenty
of excelent howto's on adding new drives, so I shall
not go into details on that matter.
But here are a step-by-step list of what needs to be done:

1. Make a backup of ALL data on the computer!
2. Connect the drive.
3. Partition the drive.
4. Create filesystem(s) on the partition(s)
5. Copy from old partition(s) to new. With rsync or cp (e.g.)
6. Mount the partition in the desired location (/var)
7. Test new configuration.

 
Let's clarify something for your planning (as I look at your example.)

If you have one drive (SATA) today, your example would show it as drive /dev/sda with partitions /dev/sda1/, dev/sda2 and so on.

If you add another drive (SATA) to your system you will have another drive shown as /dev/sdb or /dev/sdc. Then you begin partitioning that drive to accomodate your needs.

Therefore if you added /dev/sdc and wanted to move /var from its current assignment of /dev/sda6, you would move it to something like /dev/sdc5

OK?

D.E.R. Management - IT Project Management Consulting
 
Thank you.

Here my current drives. So S is Sata. I thought serial but you guys would know best.


Filesystem
/dev/sda3 77% /
/dev/sda1 16% /boot
/dev/sda5 82% /cc
none 0% /dev/shm
/dev/sda2 92% /var
 
Well both SCSI and SATA-disks are referd to as sdx in Linux.
Your list showes that you have 1 drive, sda.
With 3 primary partitions, sda1, sda2 and sda3.
Then you have one extenden partition witch contain
1 logical partition, sda5.
So if you add another sata-drive this will become sdb, and when
you create partitions on it those will be called
sdb1, sdb2 etc.
So to sum it up short:
/dev/sdb refers to the whole drive, and you can do only one thing with a drive, create partitions on it.

/dev/sdb1 /dev/sdb2 etc. refers to these partitions you create.
Here you can create filesystems where data can be stored.

Hope this helps :)
 
Hi telcomwork,

Just an added bit of info... You may want to look at keeping all of your OS related partitions on a single drive. /var is used by the OS.

I see in your initial post you mentioned a scenario where you'd move /var to the new drive.

For maintenance and potential recovery scenarios, possibly look at moving /cc to the new drive... and resizing /var from part of the "former" /cc.


Good Luck
DrD
 
Bootable linux distros are exceptionally handy for this issue.

And yes, sorry, I didn't mean to overlook the detail that the /dev/sdx the "s" is for scsi, and SATA is operated like a SCSI drive.

D.E.R. Management - IT Project Management Consulting
 
Thank you all for answering my questions and dealing with my limited knowledge on this subject. I greatly appreciate it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top