LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-27-2007, 03:12 AM   #1
geoff3
LQ Newbie
 
Registered: Sep 2006
Location: south of France, Perpignan
Distribution: Mandriva 2010
Posts: 29

Rep: Reputation: 15
pbs adding second disk


I've seen losts of posts and tutorials on this subject but maybe I've spent too much time with windows and file structures where I can see where the copied files are going when I move them.
Under Madriva 2007 I recently added 320GB sdb to my PC created a 200GB sdb1 partition wanting to keep 100GB for Windows files.
My big mistake was to accept Mandrivas suggestion of using /usr as a mount point and letting it copy files to sdb1.
I realised later that a better move would have been copying /home to sdb1.
I did this:
mkdir /mnt/home
mount -t ext3 /dev/sdb1 /mnt/home
cd home
cp -ax * /mnt/home
and now I find that I have the following:
sda6 /home-geoff,lost+found
sdb1 /usr-bin,etc,games,geoff,include,java,lib,local,
lost+found,sbin,share,src,tmp,X11R6
looks like I've got a copy of /home inside the /ust directory.
My fstab looks like this:
/dev/sda1 / ext3 defaults 1 1
/dev/sda6 /home ext3 defaults 1 2
/dev/hdb /mnt/cdrom auto umask=0,users,iocharset=utf8,noauto,ro,exec 0 0
/dev/hda1 /mnt/win_c ntfs umask=0,nls=utf8,ro 0 0
/dev/hdc1 /mnt/win_c2 vfat umask=0,iocharset=utf8 0 0
none /proc proc defaults 0 0
/dev/sdb1 /usr ext3 defaults 1 2
/dev/sda5 swap swap defaults 0 0

I guess I'm not understanding the mounting points!
what I want is /home on sdb1 and the rest on sdax
can anyone help
 
Old 10-27-2007, 07:23 AM   #2
larkl
Member
 
Registered: Sep 2007
Distribution: Puppy 5.2.8
Posts: 69

Rep: Reputation: 15
Looking through my notes from when I did this a few years back, here's what I did:

>install new drive - using your name sdb
>create partition /sdb1
>mv /home /home.old
>mount /dev/sdb1 /home
>cp -a /home.old/* /home
>echo "/dev/sdb1 /home auto defaults 0 1 ">>/etc/fstab
>rm -rf /home.old

This was on an old redhat 6 box. Seems that I should have removed the old /home reference in the fstab? Maybe I didn't have a separate /home partition? Been too long.
 
Old 10-27-2007, 07:32 AM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,877

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
Since you copied /home to /usr on sdb1, /home is still safe and sound under the root of the file system.

So, start by deleting /geoff from /usr. Now /usr is clean.

mkdir /mnt/usr to create a directory into which to copy or move /usr.

'cp -Rax /usr/* /mnt/usr' to copy /usr to sda1, or 'mv /usr/* /mnt/usr' to move /usr to sda1.

If you used the mv command, sdb1 should now be empty.

Edit /etc/fstab to change '/dev/sdb1 /usr' to '/dev/sdb1 /home'.

mkdir /mnt/home

Unmount /dev/sdb1 and remount it with: mount /dev/sdb1 /mnt/home.

Copy (or move) the contents of /home to sdb1.
cp -Rax /home/* /mnt/home

Reboot. /usr should be under the root of the filesystem on sda1, and /home should be on sdb1.

All that's left to do is clean up.

rmdir /mnt/usr
rmdir /mnt/home

Your most safe method would be to do it all from a liveCD instead of the running system. The mount points and commands given above would have to be changed slightly if working from a liveCD.

Last edited by bigrigdriver; 10-27-2007 at 07:38 AM.
 
Old 10-28-2007, 02:31 AM   #4
geoff3
LQ Newbie
 
Registered: Sep 2006
Location: south of France, Perpignan
Distribution: Mandriva 2010
Posts: 29

Original Poster
Rep: Reputation: 15
Thanks a lot Larkl and bigrigdriver, my system is as I want it and at last I've understood the logic behind the steps.
I even dared to use Gparted to increase the size of my root directory (now 15gb) and swap file (6gb) seing as I've got lots of space to spare. Gparted worked perfectly.
Thanks again
Geoff
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
RAID 1: adding a new SCSI disk to existing disk.... help mgy Linux - Enterprise 4 04-17-2006 04:56 AM
PBS name changing mijohnst Linux - Software 2 07-18-2005 12:06 PM
[HP VECTRA VL400 Desktop Phoenix BIOS] HD Speed pbs sshd Linux - Hardware 0 07-20-2004 06:15 AM
does anyone remember that pbs physics/science show? Muddy General 8 05-11-2004 03:04 PM
Red hat 9 linksys wireless router pci card pbs cant recognze adp pmasser1 Linux - Hardware 0 01-05-2004 09:57 PM


All times are GMT -5. The time now is 01:29 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration