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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-27-2007, 02:12 AM
|
#1
|
LQ Newbie
Registered: Sep 2006
Location: south of France, Perpignan
Distribution: Mandriva 2010
Posts: 29
Rep:
|
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
|
|
|
10-27-2007, 06:23 AM
|
#2
|
Member
Registered: Sep 2007
Distribution: Puppy 5.2.8
Posts: 69
Rep:
|
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.
|
|
|
10-27-2007, 06:32 AM
|
#3
|
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908
|
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 06:38 AM.
|
|
|
10-28-2007, 01:31 AM
|
#4
|
LQ Newbie
Registered: Sep 2006
Location: south of France, Perpignan
Distribution: Mandriva 2010
Posts: 29
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 01:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|