LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 06-19-2021, 04:43 AM   #1
tek3195
Member
 
Registered: Jul 2020
Posts: 30

Rep: Reputation: Disabled
Question Set up to have build environment on NVMe ?


I have 3 drives in PC, m.2 nvme 500GB, 2.5" SSD 1TB AND 2.5" HDD 2TB. I want to set up build environment to build on the m.2 as well as using it for boot drive. The 1TB SSD is where I want to have /home and don't really care what goes on the HDD. I'm trying to utilize fastest disk space to build on to cut time as much as possible. Right now I have / on m.2 and /home on ssd and don't know if or how I can build in / partition. Building Android is such an error-prone red-headed fatherless step-child that I don't want to sync sources for half a day to a directory that isn't going to work because of a legit reason or a stupid quirk. If it will be easier to start with a fresh install of Ubuntu to set partitions with my particular goal in mind, I'm all for it. Just however it needs to be done to have a working directory to build in on m.2 but it can't have /home on m.2 because it's not big enough. I have a full system installed and only using 6% of the m.2 and 20% of ssd, if I leave 25% of m.2 unused there is still a lot of wasted high speed space sitting there while a build takes 2 hours to complete. There's got to be a better way. So, my question is how can I have /boot/efi and / on m.2, plus area for working directory for building android with make, while having /home on separate SSD ?
 
Old 06-19-2021, 07:39 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,617

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Select the Manual or Expert option in the installer. Install to the place you want root, but define /home as on the SSD and data in the HDD just as you would if you wanted to use three drives of ANY kind to segragate your operation.

For development, create a work folder to set up build directories in /work. If you do not make it a separate mount, it is in / which is on your fast storage.

I suggest you do an automated base install just to the nvme a time or two to look at the defaults and setup and familiarize with the options before doing a manual or expert install, as you will want mostly similar settings.

In fact, from a full install onto the nvme you can then prep the ssd and MOVE /home onto that mount, and free space up on / in the process. That is the way I would do it, but I am not sure I would recommend that to a newbie.

It really depends upon how comfortable would you be doing manual partitioning and formatting without the help of the installer.

Last edited by wpeckham; 06-19-2021 at 07:49 AM.
 
Old 06-19-2021, 02:03 PM   #3
tek3195
Member
 
Registered: Jul 2020
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
Select the Manual or Expert option in the installer. Install to the place you want root, but define /home as on the SSD and data in the HDD just as you would if you wanted to use three drives of ANY kind to segragate your operation.

For development, create a work folder to set up build directories in /work. If you do not make it a separate mount, it is in / which is on your fast storage.

I suggest you do an automated base install just to the nvme a time or two to look at the defaults and setup and familiarize with the options before doing a manual or expert install, as you will want mostly similar settings.

In fact, from a full install onto the nvme you can then prep the ssd and MOVE /home onto that mount, and free space up on / in the process. That is the way I would do it, but I am not sure I would recommend that to a newbie.

It really depends upon how comfortable would you be doing manual partitioning and formatting without the help of the installer.

Don't know how I would set up to use three drives of any kind may be the biggest issue.

I'm fine with manual partitioning but not clear on how to set this up. I install with / and /boot/efi on the m.2 and /home on ssd, no problem. When you say data in the HDD you lose me. Is that data or /data ? because I haven't seen a /data partition, ever that I recall. When you say create a work folder to set up build directories in /work you confuse me again. Are we talking a separate partition or a directory ? I'm not familiar with creating directories in the installer and we are talking about the installer, right ?

If I create a folder to put working directories in, that is after install and belongs to me and goes in /home on the ssd, which is what I have now. The only partition created at install that I have write access to is /home. I am still lost on how to do this.
 
Old 06-19-2021, 03:09 PM   #4
obobskivich
Member
 
Registered: Jun 2020
Posts: 596

Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
In fact, from a full install onto the nvme you can then prep the ssd and MOVE /home onto that mount, and free space up on / in the process. That is the way I would do it, but I am not sure I would recommend that to a newbie.
Or take it a 'step further' and 'move' /home via symlinks and have the SSD mounted somewhere arbitrary (but out of the way) like /mnt/ssd1tb. So you'd install Ubuntu 'as usual' letting the installer take 'the whole disk' on the NVMe, and then mount the other two devices wherever, create your folders there, and symlink that back to places within /home to expand capacity. Unless this machine is very RAM starved, I'd also probably consider moving swap off of the solid state and onto the mecha-drive (to save writes on the SSDs and to free up capacity on the NVMe).

To tek3195: I think what wpeckham meant about 'data' was just to use the HDD for whatever other data you need to store - not to create a /data mount. I'd probably do that with symlinks too - so for example if you have a large music library, symlink your /home/tek3195/music folder to some location on the HDD.

Also note that 'partition' and 'directory' are sort of arbitrary here - this isn't Windows. You can (in theory) attach a block device anywhere, and use symlinks to tidy up further if you want everything to 'look normal' (or whatever your vision of normal is).
 
Old 06-20-2021, 10:38 AM   #5
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,617

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Quote:
Originally Posted by obobskivich View Post
Or take it a 'step further' and 'move' /home via symlinks and have the SSD mounted somewhere arbitrary (but out of the way) like /mnt/ssd1tb. So you'd install Ubuntu 'as usual' letting the installer take 'the whole disk' on the NVMe, and then mount the other two devices wherever, create your folders there, and symlink that back to places within /home to expand capacity. Unless this machine is very RAM starved, I'd also probably consider moving swap off of the solid state and onto the mecha-drive (to save writes on the SSDs and to free up capacity on the NVMe).

To tek3195: I think what wpeckham meant about 'data' was just to use the HDD for whatever other data you need to store - not to create a /data mount. I'd probably do that with symlinks too - so for example if you have a large music library, symlink your /home/tek3195/music folder to some location on the HDD.

Also note that 'partition' and 'directory' are sort of arbitrary here - this isn't Windows. You can (in theory) attach a block device anywhere, and use symlinks to tidy up further if you want everything to 'look normal' (or whatever your vision of normal is).

Exactly. Your real Linux OS install is really only to the nvme. The rest is how to use the other two drives. Clearly there is an advantage in using the ssd as home for speed and space advantage. Telling the installer (install partitioner to be exact) that you want /home on that device saves later steps and is more foolproof, but there is more than one way to get where you want to end up.

I actually DO have a /data partition on some of my devices, but only where the point of the server has to do with database operations. You can us that, or any other useful scheme you choose. As long as the primary Linux folders used by the system are all on nvme, and you home is on the ssd device, you will observe the speed advantages for any operation that does not load from anduse space on that rotational drive.

Last edited by wpeckham; 06-20-2021 at 10:40 AM.
 
Old 06-20-2021, 01:17 PM   #6
tek3195
Member
 
Registered: Jul 2020
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
Exactly. Your real Linux OS install is really only to the nvme. The rest is how to use the other two drives. Clearly there is an advantage in using the ssd as home for speed and space advantage. Telling the installer (install partitioner to be exact) that you want /home on that device saves later steps and is more foolproof, but there is more than one way to get where you want to end up.

I actually DO have a /data partition on some of my devices, but only where the point of the server has to do with database operations. You can us that, or any other useful scheme you choose. As long as the primary Linux folders used by the system are all on nvme, and you home is on the ssd device, you will observe the speed advantages for any operation that does not load from anduse space on that rotational drive.
/data partition makes sense, I just haven't seen it on PC, I'm relatively new to all of this and haven't seen much. I finally got this working I think. I installed with /boot/efi, / and a small swap space on nvme and /home on the ssd. Then created build directory on / and chowned it and then linked it to /home on the ssd. From new build directory I synced source for TWRP to confirm it was going where I wanted it. Speed seems off a bit though, a build of TWRP recovery took same time to build as it did on the SSD. I ran one build to populate ccache and it took three and half minutes, then one with ccache and it was 62 seconds compared to 63 on the ssd. Doesn't sound right, although the cpu is taxed 100%, may be as fast as it's going to get.

Core i7-9700, Asrock B365M Phantom Gaming 4, 32G(4x8) DDR4@2666MHz, Samsung 970 EVO m,2 nvme 500G, SK Hynix Gold S31 SATA Gen3 1TB, WD Blue 2.5" HDD 2TB, Alphacool custom loop

I set power limit 320W short, 300W long to stop all throttling and run 4.5GHz all cores. Extended load period draws 152W average with high temp of 65 C. It's not bad for a locked 65W processor
 
Old 06-20-2021, 02:04 PM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,617

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Quote:
Originally Posted by tek3195 View Post
/data partition makes sense, I just haven't seen it on PC, I'm relatively new to all of this and haven't seen much. I finally got this working I think. I installed with /boot/efi, / and a small swap space on nvme and /home on the ssd. Then created build directory on / and chowned it and then linked it to /home on the ssd. From new build directory I synced source for TWRP to confirm it was going where I wanted it. Speed seems off a bit though, a build of TWRP recovery took same time to build as it did on the SSD. I ran one build to populate ccache and it took three and half minutes, then one with ccache and it was 62 seconds compared to 63 on the ssd. Doesn't sound right, although the cpu is taxed 100%, may be as fast as it's going to get.

Core i7-9700, Asrock B365M Phantom Gaming 4, 32G(4x8) DDR4@2666MHz, Samsung 970 EVO m,2 nvme 500G, SK Hynix Gold S31 SATA Gen3 1TB, WD Blue 2.5" HDD 2TB, Alphacool custom loop

I set power limit 320W short, 300W long to stop all throttling and run 4.5GHz all cores. Extended load period draws 152W average with high temp of 65 C. It's not bad for a locked 65W processor
Putting your /work directory directly on / (mkdir /work) does make sense for maximum build speed. Linkin to the /home or anywhere else on the SSD drops your speed back to the SSD speed. Both should be LOTS faster than putting it on the HDD drive, but why link it onto the SSD in the first place? I may be a bit confused here, but that looks counterproductive. Could you explain more about what you did?
 
1 members found this post helpful.
Old 06-20-2021, 06:06 PM   #8
tek3195
Member
 
Registered: Jul 2020
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
Putting your /work directory directly on / (mkdir /work) does make sense for maximum build speed. Linkin to the /home or anywhere else on the SSD drops your speed back to the SSD speed. Both should be LOTS faster than putting it on the HDD drive, but why link it onto the SSD in the first place? I may be a bit confused here, but that looks counterproductive. Could you explain more about what you did?
I think what I did, was made more of a headache for myself. Probably a typo or something simple at some point, but when I initially attempted to put /build on / I could not write to it freely. Yeah, counterproductive is the under-statement of the year for this one. Spent two days trying to figure out how to save one second from one build, that's beyond counterproductive. I linked it to /home after reading this https://askubuntu.com/questions/7426...utside-of-home . Like I said, it was probably a typo at some point and I didn't have permissions right. Whatever it was, I didn't retry it and allowed it to steer me in the wrong direction. What I have now was what I was going for except for the slowing it down by linking to /home. Now that you see what I was trying to do for max build speed, what would be the correct way to have my /build directory on / partition to take advantage of nvme speed and have permission to write to it ?
 
Old 06-21-2021, 09:47 AM   #9
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,617

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Short tutorial: to make a new build folder on root that you can use for software package builds under your local (ie: non-root) id.

Code:
sudo mkdir /build        # this because your id may not have create privileges on /
sudo chown id:id /build  # makes it so that you own the folder.  
                         # If you only create files and folders inside this space
                         # as yourself, you should always own them.  
                         # This avoids permission and ownership issues.
That, really, is all of it.
Now all of the contents of /build will live on the root storage (nvme in your case).
Builds should be fast.

Last edited by wpeckham; 06-21-2021 at 09:50 AM.
 
1 members found this post helpful.
Old 06-21-2021, 11:24 AM   #10
tek3195
Member
 
Registered: Jul 2020
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
Short tutorial: to make a new build folder on root that you can use for software package builds under your local (ie: non-root) id.

Code:
sudo mkdir /build        # this because your id may not have create privileges on /
sudo chown id:id /build  # makes it so that you own the folder.  
                         # If you only create files and folders inside this space
                         # as yourself, you should always own them.  
                         # This avoids permission and ownership issues.
That, really, is all of it.
Now all of the contents of /build will live on the root storage (nvme in your case).
Builds should be fast.
Well, this is enough to make one seriously pissed at themself. That's exactly what I attempted to do initially, guess I was right about a typo. It is basically what I have now after simply deleting the link to /home. Or actually exactly what I have because that's what I did and then added stupid link. I apologize for wasting your time to help somebody that wasn't paying attention to what they were doing. But I'm glad you did. I had it in my mind that it wouldn't work that way so thanks for straightening this out for me. I really really appreciate it. I guess it's not slow, it built Lineage 18.1 for my device in 02:21:25 with empty ccache and once populated it built in (53:54 (mm:ss)) Upgrading from a refurbed Optiplex 7010 i5 3470 that would build for 12 hours and fail, I'm pretty happy with new build. Again, thank you.
 
1 members found this post helpful.
Old 06-21-2021, 07:04 PM   #11
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,617

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
You are very welcome!
 
1 members found this post helpful.
Old 07-13-2021, 11:34 PM   #12
tek3195
Member
 
Registered: Jul 2020
Posts: 30

Original Poster
Rep: Reputation: Disabled
@wpeckham I have another question that I'm really not clear on. I'm doing clean install and wondering where I should put repo ? It normally goes in ~/bin/repo but with all of my building being done in root partition in /build directory, I don't know if it should go in /build/repo or ~/bin/repo. With ~/bin/repo it would still be under /home on ssd and not under /build on nvme. Will it make a difference where it is and will it work under /build/repo if added to PATH ?
 
Old 07-14-2021, 05:36 PM   #13
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,617

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
It should work wherever you put it. The question is if speed is important how do you assure the greatest speed. The answer is, simply ensure that it uses the fastest storage.


Are /build and /bin both on NVME? If so, they should be equally fast places.
 
Old 07-14-2021, 11:44 PM   #14
tek3195
Member
 
Registered: Jul 2020
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
It should work wherever you put it. The question is if speed is important how do you assure the greatest speed. The answer is, simply ensure that it uses the fastest storage.


Are /build and /bin both on NVME? If so, they should be equally fast places.
You're right, it works fine in /build/repo. The ~/bin/repo would put it on ssd rather than nvme. I got that one taken care of which probably didn't matter that much. Now I have to get ccache on there since that's 40GB of space that is/was on ssd. Tried moving it and then exporting ccache_dir but didn't seem to work, also made ~/.ccache/ccache.config to point to 'CCACHE_DIR = /build/ccache'. I think moving it was wrong and need to delete it and then run a build to populate it fresh in its new address. I'm learning, not as quickly as I'd like, but I'll get there. I appreciate the help and info, thank you.
 
  


Reply

Tags
android, build from source, m.2, nvme, storage



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Video : How to install Official Armbian + Desktop set up + install to NVMe NicoD SBC Linux - Embedded & Single-board computer 0 08-14-2019 09:45 PM
LXer: Data in a Flash, Part II: Using NVMe Drives and Creating an NVMe over Fabrics Network LXer Syndicated Linux News 0 05-20-2019 11:41 PM
Migrate Linux/win10 dual boot from MBR nvme drive to a new GPT nvme drive bluemoo Linux - Software 7 09-25-2018 06:42 PM
[SOLVED] Linux 4.4 seems to refuse to build IPv6 for the 64-bit build - 32-bit build works fine GameCodingNinja Linux From Scratch 2 02-07-2016 06:40 PM
LXer: Build 'em Right, Build 'em Strong, Build 'em Linux LXer Syndicated Linux News 0 10-01-2007 09:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration