You are not logged in.

#1 2018-12-28 10:56:31

VicenteMMOS
Member
Registered: 2018-12-27
Posts: 19

[SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

Hello, everyone!

I'm new to Linux, even newer to Arch forum. I've installed Ubuntu a couple of weeks ago, and I'm going to install Arch for the very first time tonight. I have read the Installation Guide page, and many other pages in the ArchWiki, as well as followed 2 to 3 different videos of experienced users demonstrating how to do a full installation of the OS. I feel confident enough that I can install it, despite my little experience with Linux in general, and complete inexperience with Arch.

Anyway, my computer has 2 drives, an ssd which I use for the OS, programs and games, and a 1TB hdd for file storage. In order to do so in Ubuntu, I had to change the directory paths contained within /home/.config/user-dirs.dirs configuration file. The default values were:

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

and all I had to do was to substitute '$HOME' with '/hdd/<my_username>' (where /hdd was a previous mounting point created specifically for my hd drive). So it looks like this now:

XDG_DESKTOP_DIR="/hdd/<my_username>/Desktop"
XDG_TEMPLATES_DIR="/hdd/<my_username>/Templates"
XDG_DOWNLOAD_DIR="/hdd/<my_username>/Downloads"
XDG_PUBLICSHARE_DIR="/hdd/<my_username>/Public"
XDG_DOCUMENTS_DIR="/hdd/<my_username>/Documents"
XDG_MUSIC_DIR="/hdd/<my_username>/Music"
XDG_PICTURES_DIR="/hdd/<my_username>/Pictures"
XDG_VIDEOS_DIR="/hdd/<my_username>/Videos"

This works well for me, because all these folders contain files and documents, an no programs.

So, my question is, do I need to do all of this, namely reformatting my hdd as ext4, creating its dedicated mounting point, mounting it, then changing the configuration paths from the user-dirs.dirs file, from the start, before installing the OS itself? Or can I do it later? Would it be better to reformat, mount and change home folder paths before installing the OS, creating host, user, login screen and desktop environment, or perhaps doing it after has no bad implications? What would you recommend?

Thank you.

Last edited by VicenteMMOS (2018-12-30 14:31:30)

Offline

#2 2018-12-28 11:10:53

loqs
Member
Registered: 2014-03-06
Posts: 19,106

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

VicenteMMOS wrote:

So, my question is, do I need to do all of this, namely reformatting my hdd as ext4, creating its dedicated mounting point, mounting it, then changing the configuration paths from the user-dirs.dirs file, from the start, before installing the OS itself? Or can I do it later? Would it be better to reformat, mount and change home folder paths before installing the OS, creating host, user, login screen and desktop environment, or perhaps doing it after has no bad implications? What would you recommend?

Why do you want to reformat the hdd?
Before the OS installation you would need to create /home/user and set the correct ownership and permissions and within that .config/user-dirs.dirs then make the changes.
To me it would be simpler to make the changes after OS installation and the user has been created.

Offline

#3 2018-12-28 11:15:29

VicenteMMOS
Member
Registered: 2018-12-27
Posts: 19

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

loqs wrote:

Why do you want to reformat the hdd?
Before the OS installation you would need to create /home/user and set the correct ownership and permissions and within that .config/user-dirs.dirs then make the changes.
To me it would be simpler to make the changes after OS installation and the user has been created.

I don't *need* to reformat the hdd... it was more like a pondering on my part. smile If I can keep it as it is, even better.

If it's simpler to just do these changes after OS installation, and there is no downside to it, then ok, I'm going to do that smile

Thanks!

Last edited by VicenteMMOS (2018-12-28 11:17:18)

Offline

#4 2018-12-28 11:20:49

loqs
Member
Registered: 2014-03-06
Posts: 19,106

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

If you want to preserve the existing the existing HDD contents the only issue is making sure when you create the users on the new install you use the same uid:gid as the old installation.

Offline

#5 2018-12-28 11:38:33

VicenteMMOS
Member
Registered: 2018-12-27
Posts: 19

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

I only had one user, with my default username, and never created any groups... is this all there is to it? I'm looking at this page https://wiki.archlinux.org/index.php/De … D_Database to see if I find any other information with regards to uid:gid, but honestly, I don't really know what you're talking about. I can say I formatted my hdd as an ext4 type, and created the mounting point, and there was only my user in the machine, but I don't know if this is at all relevant. Can you please tell me where I can find more information about it? Maybe the command I should run in the terminal in order to chech the uid:gid currently installed there before I proceed with installing Arch?

Offline

#6 2018-12-28 11:45:21

loqs
Member
Registered: 2014-03-06
Posts: 19,106

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

On the old system login as your user and type id and the output should contain the uid and gid.  Users_and_groups#User_management
When creating the user on the new system you would use -u $UID -g $GID substituting for for $UID and $GID eg

# useradd --create-home archie -u 1000 -g 1000

Alternately create the new user without specifying the uid and gid.  Then chown -R username:groupname /hdd/username/ (if you did not specify a different primary group when creating the user it will have the same name as the username)

Last edited by loqs (2018-12-28 11:49:25)

Offline

#7 2018-12-28 11:49:40

VicenteMMOS
Member
Registered: 2018-12-27
Posts: 19

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

loqs wrote:

On the old system login as your user and type id and the output should contain the uid and gid.  Users_and_groups#User_management
When creating the user on the new system you would use -u $UID -g $GID substituting for for $UID and $GID eg

# useradd --create-home archie -u 1000 -g 1000

Thank you, will do! smile After tonight, I'll let you know what happens (is it just me, or does it sound like I'm going on a date?)

Offline

#8 2018-12-30 12:20:52

VicenteMMOS
Member
Registered: 2018-12-27
Posts: 19

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

So, just a recap in this topic. I finally managed to solve it by doing some research, this is what I did:

1) I ended up formatting the hdd as ext4, and wiping out all the data (not really a problem, I already had a backup)
2) I edited /etc/fstab in order to include a new entry, using the UUID of this hdd I have
3) the drive had been set as owned and managed by root, so I had changed the ownership to user, with 'chown'
4) I generated an XDG user directory file(~/.config/user-dirs.dirs), using the '$ xdg-user-dirs-update' which I then manually assigned my custom paths to the user folders

That was pretty much it! This of course is just a brief overview of the main points I had to go through in order to apply these changes, but I believe they’re well summarized.

It took me about a day or two of research of all the commands I had to learn and execute in order to get it all done, but now here it is, for posterity smile

I hope this might help someone else out there, in the future. The status to this topic can now be changed to SOLVED.

Thank you.

Offline

#9 2018-12-30 13:57:40

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,536

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

The status to this topic can now be changed to SOLVED.

Edit the first post, then add that to the title of the thread.



One comment :

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

Only applications that support XDG directory specification will use those settings.
Also some apps may have hardcoded those paths to something like /home/$USER/Documents .

There is a flexible way to achieve what you want that doesn't rely on xdg user specs : use symbolic links . (check man ln)

example :
You want everything in /home/$USER/Documents/Movies to be stored in /<storage-drive>/<your-username>/Documents/Movies  .

execute

ln --symbolic /<storage-drive>/$USER/Documents/Movies $HOME/Documents/Movies 

Every command writing to or reading from $/HOME/Documents/Movies folder will be redirected to /<storage-drive>/<your-username>/Documents/Movies by the filesystem.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#10 2018-12-30 14:33:32

VicenteMMOS
Member
Registered: 2018-12-27
Posts: 19

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

Lone_Wolf wrote:

...

Only applications that support XDG directory specification will use those settings.
Also some apps may have hardcoded those paths to something like /home/$USER/Documents .

There is a flexible way to achieve what you want that doesn't rely on xdg user specs : use symbolic links . (check man ln)

example :
You want everything in /home/$USER/Documents/Movies to be stored in /<storage-drive>/<your-username>/Documents/Movies  .

execute

ln --symbolic /<storage-drive>/$USER/Documents/Movies $HOME/Documents/Movies 

Every command writing to or reading from $/HOME/Documents/Movies folder will be redirected to /<storage-drive>/<your-username>/Documents/Movies by the filesystem.

Interesting! I'll sure try that too. In fact, I notice that although I changed the paths in the cofig file, after I downloaded a test file it went to my default Downloads folder. I'll try out your suggestion, thank you.

Offline

#11 2018-12-30 14:40:22

VicenteMMOS
Member
Registered: 2018-12-27
Posts: 19

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

One question, the man ln didn't mention, but what if I wanted to delete one of these links, because maybe I thought of another file path I want it to go to? How do I do that?

Offline

#12 2018-12-30 14:50:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,531
Website

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

rm $HOME/Documents/Movies


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#13 2018-12-30 14:52:12

VicenteMMOS
Member
Registered: 2018-12-27
Posts: 19

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

Trilby wrote:

rm $HOME/Documents/Movies

Wouldn't that delete the contents of my entire Movies folder?

Last edited by VicenteMMOS (2018-12-30 14:52:39)

Offline

#14 2018-12-30 14:54:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,531
Website

Re: [SOLVED] 1st Arch Linux installation - ssd (system) & hdd (storage)

No.

rm will only delete a file or files if you use a glob.  It will not remove a directory, even an empty one - this is what rmdir is for.  `rm -r` is much more of a blunt tool and can remove directories and their contents, but `rm` cannot.

Last edited by Trilby (2018-12-30 14:56:37)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB