File location question

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
MurphCID
Level 5
Level 5
Posts: 639
Joined: Fri Sep 25, 2015 10:29 pm

File location question

Post by MurphCID » Mon Feb 19, 2018 6:31 pm

How do you in linux, change where a file is stored? For example, on my Windows box I have five drives, a boot drive, a game drive, a storage drive, and two backup drives. I have documents, music, videos, and pictures going to my "E" drive. Instead of loading on the "C" drive, I have them pointed to the "E" drive. It was really easy to do that in Windows, but I am not sure how to have a linux boot drive, and point it to my storage drive. I am still somewhat unsure of the linux drive conventions so I am afraid of zorching my file system. On my windows system, my boot drive is a single 512 gb Western Digital NVMe drive, and the storage drive is a 2 terabyte Western Digital 7200 rpm drive. The game drive is a 500 gb Samsung SSD and that is where I have all of my Steam games loaded. I want to be able to load games and such onto the other drives, and "point" to them so that linux can find them. Can anyone give me easy directions on how to do this?

User avatar
catweazel
Level 17
Level 17
Posts: 7770
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: File location question

Post by catweazel » Tue Feb 20, 2018 12:47 am

I move my trash locations like this:

Code: Select all

ln -s /media/boot/HWRAID10-0/Trash /home/boot/.local/share/Trash
So, move your files to where you want them then use this format to create a link:

Code: Select all

ln -s <dest> <source>
<dest> points to where you moved the directory to and <source> creates a link where you moved the directory from.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

jglen490
Level 4
Level 4
Posts: 255
Joined: Sat Jul 15, 2017 9:57 pm

Re: File location question

Post by jglen490 » Tue Feb 20, 2018 6:19 pm

MurphCID wrote:
Mon Feb 19, 2018 6:31 pm
How do you in linux, change where a file is stored? For example, on my Windows box I have five drives, a boot drive, a game drive, a storage drive, and two backup drives. I have documents, music, videos, and pictures going to my "E" drive. Instead of loading on the "C" drive, I have them pointed to the "E" drive. It was really easy to do that in Windows, but I am not sure how to have a linux boot drive, and point it to my storage drive. I am still somewhat unsure of the linux drive conventions so I am afraid of zorching my file system. On my windows system, my boot drive is a single 512 gb Western Digital NVMe drive, and the storage drive is a 2 terabyte Western Digital 7200 rpm drive. The game drive is a 500 gb Samsung SSD and that is where I have all of my Steam games loaded. I want to be able to load games and such onto the other drives, and "point" to them so that linux can find them. Can anyone give me easy directions on how to do this?
The easy way is through using partitioning to set up your Linux. You can partition a single physical drive, or you can have some of your partitions on one drive, and some on another. What I have on my system is two physical drives set up like this:
/ = /dev/sda1
/home = /dev/sda2
/SWAP = /dev/sda3
/home/multimedia = /dev/sdb1

So while /home is split over two physical drives, I can use my backup process to grab everything under "/home" in one command while keeping my interest areas in two places.

I have three external USB drives that I use for backups and connect each on a rotating basis to do my actual backups. No matter which physical drive I'm using at the time for the backup, it always shows up as being mounted as "/dev/sdc" but with the label of the drive showing in the GUI file explorer (i.e., Backup1, Backup2, or Backup3).

You can tell the application program exactly what subdirectory to put a document or an MP3 file in.
I feel more like I do than I did when I got here.
Toshiba A135-S2386, Intel T2080, ATI Radeon® Xpress 200M Chipset, 2GB RAM, 500GB

User avatar
MurphCID
Level 5
Level 5
Posts: 639
Joined: Fri Sep 25, 2015 10:29 pm

Re: File location question

Post by MurphCID » Thu Feb 22, 2018 8:02 am

Thanks I am still unsure on the concept, so please bear with me.

If I have a 512gb boot drive (sba?)which I want to keep "clean" for the most part and only have the o/s, and applications on, and a 2 TB regular hard drive (sdb?) where I want all the documents, music, videos, games, etc to be stored, how would I link those two so it happens? In Winders I just tell the file location to be E:\ rather than C, and voila! no problemo.

User avatar
shawnhcorey
Level 3
Level 3
Posts: 191
Joined: Thu Jun 17, 2010 11:23 am
Location: The Great White North
Contact:

Re: File location question

Post by shawnhcorey » Thu Feb 22, 2018 8:42 am

MurphCID wrote:
Mon Feb 19, 2018 6:31 pm
How do you in linux, change where a file is stored? For example, on my Windows box I have five drives, a boot drive, a game drive, a storage drive, and two backup drives. I have documents, music, videos, and pictures going to my "E" drive. Instead of loading on the "C" drive, I have them pointed to the "E" drive. It was really easy to do that in Windows, but I am not sure how to have a linux boot drive, and point it to my storage drive. I am still somewhat unsure of the linux drive conventions so I am afraid of zorching my file system. On my windows system, my boot drive is a single 512 gb Western Digital NVMe drive, and the storage drive is a 2 terabyte Western Digital 7200 rpm drive. The game drive is a 500 gb Samsung SSD and that is where I have all of my Steam games loaded. I want to be able to load games and such onto the other drives, and "point" to them so that linux can find them. Can anyone give me easy directions on how to do this?
When you install Linux, it will automatically look for all drives and place them on your desktop. They wouldn't be labelled 'C:' or 'E:'. Instead, the name will be taken from their firmware, that is, what the manufactured names them. There is no simple way to change their labels in Linux because doing so requires root (admin) privileges.
Don't stop where the ink does.

User avatar
MurphCID
Level 5
Level 5
Posts: 639
Joined: Fri Sep 25, 2015 10:29 pm

Re: File location question

Post by MurphCID » Fri Feb 23, 2018 11:14 pm

I understand, but if I want documents, music and photos to be on the 2 tb drive, and the 512 gb is my o/s drive, how do I do that in linux?

User avatar
smurphos
Level 8
Level 8
Posts: 2225
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: File location question

Post by smurphos » Sat Feb 24, 2018 2:58 am

To avoid messing to much you can move/copy the folders/files in question to the chosen location first, using the file manager and a simple cut or copy and paste or using the command line and a tool like mv, cp or rsync.

Then use the file manager (for Nemo right click on the folder in the new location and use the Make Link option then move and rename the new Link to folder) or the command line tool ln to create symlinks in your home that point to the new locations.

An example one liner terminal command that moves the folder ~/TEST and it's contents from home to my back-up external drive and creates a symlink in home to the new location.

mv ~/TEST /mnt/backup_drive/TEST && ln -s /mnt/backup_drive/TEST ~/

If you want to move the whole home folder to the other drive we need to see how your drives are mounted now? blkid && cat /etc/fstab
will tell us.

User avatar
shawnhcorey
Level 3
Level 3
Posts: 191
Joined: Thu Jun 17, 2010 11:23 am
Location: The Great White North
Contact:

Re: File location question

Post by shawnhcorey » Sat Feb 24, 2018 7:57 am

MurphCID wrote:
Fri Feb 23, 2018 11:14 pm
I understand, but if I want documents, music and photos to be on the 2 tb drive, and the 512 gb is my o/s drive, how do I do that in linux?
Most apps will remember where you open and saved during your last session. For example, if you open your music app and load a file from a directory on the 2 TB drive, the next time your start the app, it should remember where it was and set the open dialog to the same directory.

Of course, this is for most apps. Some do not do this. All I can say is to try it and if it doesn't behave as you expect, then ask for more help. :)
Don't stop where the ink does.

User avatar
MurphCID
Level 5
Level 5
Posts: 639
Joined: Fri Sep 25, 2015 10:29 pm

Re: File location question

Post by MurphCID » Sat Feb 24, 2018 12:24 pm

Thanks.

Post Reply

Return to “Software & Applications”