Author Topic: moving /home? [Resolved]  (Read 911 times)

Offline Insamity

  • Jr. Member
  • **
  • Posts: 24
  • I fear no BSOD
moving /home? [Resolved]
« on: August 07, 2011, 03:45:10 PM »
I have a dual boot setup with 2 hard drives, the first hard drive has 4 partitions on it(windows, Linux, swap, and documents) The documents partition is for all my info for both systems (video, documents, downloads, etc) and my 2nd harddrive is just for backup. My home folder in Linux has the usual documents, downloads, videos, etc. How can I make those folders be the ones I want? For example I would want /home/downloads to become /media/documents/downloads. Any help is much appreaciated and if you need any setup details about my computer just let me know what you need. thanks
« Last Edit: August 09, 2011, 03:46:45 PM by Insamity »
If you don't take the time to do it right, When will you have the time to do it over?

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: moving /home?
« Reply #1 on: August 07, 2011, 04:31:19 PM »
I have a dual boot setup with 2 hard drives, the first hard drive has 4 partitions on it(windows, Linux, swap, and documents) The documents partition is for all my info for both systems (video, documents, downloads, etc) and my 2nd harddrive is just for backup. My home folder in Linux has the usual documents, downloads, videos, etc. How can I make those folders be the ones I want? For example I would want /home/downloads to become /media/documents/downloads. Any help is much appreaciated and if you need any setup details about my computer just let me know what you need. thanks

Hi,

if I understand correctly you want to share the same documents storage under /home of each installation,
you could create a symbolic link say /home/<username>/downloads that point to /media/documents/downloads.

Alternatively you may want to evaluate the possibility of mounting the whole documents partitions under /home/<username>/documents, this will result in a little difference, because you will find your downloads under /home/<username>/documents/downloads instead of /home/<username>/downloads

AS

Offline Insamity

  • Jr. Member
  • **
  • Posts: 24
  • I fear no BSOD
Re: moving /home?
« Reply #2 on: August 07, 2011, 05:22:48 PM »
yes the symbolic link is exactly what I am looking for so that when I click on my Linux downloads folder (/home/sam/downloads) for instance it sends me to the downloads folder in my documents partition (/media/documents/downloads) but I do not know how to create that link.
If you don't take the time to do it right, When will you have the time to do it over?

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: moving /home?
« Reply #3 on: August 07, 2011, 06:05:48 PM »
yes the symbolic link is exactly what I am looking for so that when I click on my Linux downloads folder (/home/sam/downloads) for instance it sends me to the downloads folder in my documents partition (/media/documents/downloads) but I do not know how to create that link.

Open a console window (as sam user) and type the following commands:

ln -s /media/documents/downloads /home/sam/downloads

(please note: ln = LN lowercase)
« Last Edit: August 07, 2011, 06:15:17 PM by as »

Offline Insamity

  • Jr. Member
  • **
  • Posts: 24
  • I fear no BSOD
Re: moving /home?
« Reply #4 on: August 07, 2011, 06:44:56 PM »
Ok I did that but I am not sure what it did.
(Edit)
Ok I should state I do know it created a symbolic link but I am not sure how it works or what to do now
« Last Edit: August 07, 2011, 06:48:43 PM by Insamity »
If you don't take the time to do it right, When will you have the time to do it over?

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5335
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: moving /home?
« Reply #5 on: August 07, 2011, 11:51:49 PM »
Ok I did that but I am not sure what it did.
(Edit)
Ok I should state I do know it created a symbolic link but I am not sure how it works or what to do now

A symbolic link is nothing more than a pointer file. In this case anytime you look at the directory located at /home/sam/downloads  the symbolic link is pointing that to the directory at /media/documents/downloads

You can see this if you open a console in your user directory and typing in the command

ls you might see something like this

website-work@
Documents@                  isos/                           Pictures@                    webtemplates/
Downloads@                  jacks-card.png               sams-music/                wiki-work/
Notice all the directories with the "@" after their names. Those are the symbolic links on my system

to see where that symbolic link is actually pointing to you can use the following command

ls -la

For example here is what I see on my system

lrwxrwxrwx  1 dwmoar dwmoar     26 May 27  2010 website-work -> /mnt/backups/website-work/
drwxr-xr-x  4 dwmoar dwmoar   4096 Jul 18  2010 webtemplates/
drwxrwxr-x  4 dwmoar dwmoar   4096 Aug  5 20:44 wiki-work/

The line in green is my symbolic link. Every time I look into my home directory, into the website-work directory, I am actually looking at /mnt/backups/website-work/

that is just part of the beauty of using symbolic links.
« Last Edit: August 07, 2011, 11:55:47 PM by YouCanToo »




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline Insamity

  • Jr. Member
  • **
  • Posts: 24
  • I fear no BSOD
Re: moving /home?
« Reply #6 on: August 08, 2011, 10:46:24 PM »
Thank you so much for your help.    ;D
[edit]This may be a dumb question but would it hurt anything if I for instance instead of putting a symbolic link to downloads inside of downloads, deleted /home/downloads and simply put a symbolic link to /media/documents/downloads inside of home? It seems to me that would be a cleaner way to do it but I dont want to mess my system up either.
« Last Edit: August 09, 2011, 12:00:30 AM by Insamity »
If you don't take the time to do it right, When will you have the time to do it over?

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: moving /home?
« Reply #7 on: August 09, 2011, 02:10:31 AM »
This may be a dumb question but would it hurt anything if I for instance instead of putting a symbolic link to downloads inside of downloads, deleted /home/downloads and simply put a symbolic link to /media/documents/downloads inside of home?

Yes, you can copy the files from /home/(you)/downloads to /media/documents/downloads. Then create a link to /media/documents/downloads in your home directory. However, the proper place to create your mount point is in /mnt instead of /media. The reason is that the /media directory is for removable devices and /mnt is for fixed devices that will be available every time you boot. When you insert a CD or portable USB device, the udev daemon automatically mounts that removable device in the /media directory. When you remove the CD or portable USB device, the mount point in the /media directory is automatically deleted.

So, right now you have a mount point for your data of:

/media/documents

That should actually be:

/mnt/documents
« Last Edit: August 09, 2011, 05:02:40 AM by djohnston »
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline Insamity

  • Jr. Member
  • **
  • Posts: 24
  • I fear no BSOD
Re: moving /home?
« Reply #8 on: August 09, 2011, 03:46:00 PM »
Awesome! Thanks to all! I now have my documents partition mounted in mnt with links to replace the empty folders in home with the ones in that partition. My computer is running flawlessly now. This has been an awesome forum with quick and informed answers. i hope to someday be good enough to contribute help in return. Cheers!
If you don't take the time to do it right, When will you have the time to do it over?