08-07-2014, 04:28 AM
m654321,
Glad to here this was useful for you.
The process can definitely be a bit confusing. The most confusing part is what to do with the existing folders in your /home/username directory.
First, folders are created on the DATA partition to hold all of your files. Easiest thing is to just use same names you normally have in the /home/username directory -- Documents, Downloads, Music, etc. So the line that you referred to (mkdir Documents Downloads Music Pictures Videos) is doing that. It's making the folders on the DATA partition. (I'm sure you have done this step.)
The corresponding folders that already exist on /home/username will either need to be deleted, or not depending on which linking choice you pick.
When symlinking the existing folders in your home directory need to be deleted first. If you don't delete them, then what will happen is you will be attempting to create a symlink directory that has the same name as an already existing one. The system won't allow that. So in the example, you need to delete the existing Documents folder in /home/username; then create the symlink from the DATA partition to /home/username with ln -s /mnt/DATA/Documents /home/username. You'll then have a symlinked folder called "Documents" show back up in /home/username.
When using the bind method, what you're doing there can be thought of as re-mounting specific folders in the DATA partition to the /home/username location. When mounting something, there needs to be a mount point. Just like when you created the mount point of /mnt/DATA for the DATA partition, you need to have a mount point for the specific folders that you are binding (re-mounting) to /home/username. So, in this situation you need to keep the existing folders. They will now serve as mount points and the command would be: mount --bind /mnt/DATA/Documents /home/username/Documents
To Summarize difference between the two methods:
Symlinking
* Delete existing Documents folder from /home/username directory. (Do the same for any other folders that you want located on the DATA partition.)
* Then run command below to create a symlinked folder in /home/username that points back to /mnt/DATA/Documents.
* When you open your /home/username directory you will now see the Documents folder again, but it's really just a link pointing back to the folder of that name on the DATA partition.
* If you delete the Documents symlink, there will be no more listing for Documents in your home directory. The files will still exist, but to see them you need to go to /mnt/DATA/Documents.
Binding
* Keep the existing Documents folder in /home/username. It will serve as a mount point to bind to from the DATA partition.
* Run command below to bind the Documents folder on DATA partition to the folder located in /home/username.
* When you open your /home/username directory you will see the Documents folder. That folder is not a link. What you are seeing is the Documents folder on the DATA partition.
* If you unbind the Documents folder you bound, you will still see a listing for Documents in your home directory. If you then go into that /home/username/Documents folder, you will not see any of the files there. The directory is there (because it was used as a mount point), but your files reside on /mnt/DATA/Documents.
Don't worry if you're still a bit confused. It took me a while to wrap my head around it too.
Basically, it sounds like you had not deleted the existing folders in your home directory before trying to create the symlinks. Also, sounds like you need to change ownership of either /mnt/DATA or /home/username/DATA, or both so you don't need to access as Administrator.
I'm guessing that you have a Documents, Downloads, Music, etc. folder in /home/username and in /home/username/DATA. It you are saving things by navigating to /home/username/DATA, then picking the Documents (or other) folder in there to save to -- those DO end up on the DATA partition. If you are saving to /home/username/Documents -- those DO NOT end up on the DATA partition.
It won't be hard to fix ownership and/or location mix-ups if you want to do that.
Glad to here this was useful for you.
The process can definitely be a bit confusing. The most confusing part is what to do with the existing folders in your /home/username directory.
First, folders are created on the DATA partition to hold all of your files. Easiest thing is to just use same names you normally have in the /home/username directory -- Documents, Downloads, Music, etc. So the line that you referred to (mkdir Documents Downloads Music Pictures Videos) is doing that. It's making the folders on the DATA partition. (I'm sure you have done this step.)
The corresponding folders that already exist on /home/username will either need to be deleted, or not depending on which linking choice you pick.
When symlinking the existing folders in your home directory need to be deleted first. If you don't delete them, then what will happen is you will be attempting to create a symlink directory that has the same name as an already existing one. The system won't allow that. So in the example, you need to delete the existing Documents folder in /home/username; then create the symlink from the DATA partition to /home/username with ln -s /mnt/DATA/Documents /home/username. You'll then have a symlinked folder called "Documents" show back up in /home/username.
When using the bind method, what you're doing there can be thought of as re-mounting specific folders in the DATA partition to the /home/username location. When mounting something, there needs to be a mount point. Just like when you created the mount point of /mnt/DATA for the DATA partition, you need to have a mount point for the specific folders that you are binding (re-mounting) to /home/username. So, in this situation you need to keep the existing folders. They will now serve as mount points and the command would be: mount --bind /mnt/DATA/Documents /home/username/Documents
To Summarize difference between the two methods:
Symlinking
* Delete existing Documents folder from /home/username directory. (Do the same for any other folders that you want located on the DATA partition.)
* Then run command below to create a symlinked folder in /home/username that points back to /mnt/DATA/Documents.
Code:
ln -s /mnt/DATA/Documents /home/username
* If you delete the Documents symlink, there will be no more listing for Documents in your home directory. The files will still exist, but to see them you need to go to /mnt/DATA/Documents.
Binding
* Keep the existing Documents folder in /home/username. It will serve as a mount point to bind to from the DATA partition.
* Run command below to bind the Documents folder on DATA partition to the folder located in /home/username.
Code:
mount --bind /mnt/DATA/Documents /home/username/Documents
* If you unbind the Documents folder you bound, you will still see a listing for Documents in your home directory. If you then go into that /home/username/Documents folder, you will not see any of the files there. The directory is there (because it was used as a mount point), but your files reside on /mnt/DATA/Documents.
Don't worry if you're still a bit confused. It took me a while to wrap my head around it too.
Basically, it sounds like you had not deleted the existing folders in your home directory before trying to create the symlinks. Also, sounds like you need to change ownership of either /mnt/DATA or /home/username/DATA, or both so you don't need to access as Administrator.
I'm guessing that you have a Documents, Downloads, Music, etc. folder in /home/username and in /home/username/DATA. It you are saving things by navigating to /home/username/DATA, then picking the Documents (or other) folder in there to save to -- those DO end up on the DATA partition. If you are saving to /home/username/Documents -- those DO NOT end up on the DATA partition.
It won't be hard to fix ownership and/or location mix-ups if you want to do that.
Try Linux Beginner Search Engine for answers to Linux questions.