2

My issue is that I have no idea how to make Ubuntu recognize my intent to have one drive for the loading and use of the operating system and the other for the storage of programs. Is this even feasible? I have extensive knowledge with Windows, and even server related functions; however despite a year of use with Linux 3 years ago, I'm struggling to find a solution.

I'm using a 120 GB Samsung 3D VNAND SSD for booting Ubuntu and updates to the OS and a secondary 2TB Western Digital Black Drive (that i'm hoping to get ubuntu to install programs onto)

Since I was confused on the formatting I simply partitioned the 120 GB SSD to load Ubuntu and left the data cable to the 2TB unplugged from the motherboard

After loading in and playing with the partitioning tool I realized that the HDD was appearing in a separate window

There was no tie whatsoever with the original SSD where Ubuntu is located

While I can format the 2TB and 120GB Drives I'm unable to determine how to make them work the way I want them to.

Arosrheoc
  • 21
  • 1
  • 2

2 Answers2

1

I would advice against it and keep the OS on 1 drive. And on the SSD to have the fast boot.

If you want to use a 2nd drive you need to mount the directories onto partitions on that disk.

Software is installed into a lot of directories since software is placed into directories intended for that part of the software. /bin/, /usr/, /lib/, /var/ and more directories will contain parts of an installation. And you will need partitions for each of them where you need to make sure you create plenty of room so the partition can not fill up. Each directory will have overhead decreasing the space you can use for your own files. See this answer on U&L where it is explained how you so this with symlinks or binding (that is a bit high level though).

In the end you will see you probably are going to copy -everything- over to that 2nd disk.

I myself would put the / on the SSD and if you want a separate /home/. And use the 2Tb as a data partition. This is what I have:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        46G  5,9G   38G  14% /
/dev/sda1        47M  3,5M   43M   8% /boot/efi
/dev/sda5        34G  540M   32G   2% /home
/dev/sdb1       917G   69G  802G   8% /discworld

(I remove the tmp's).

My /home/ is empty. I use users-dirs.dirs to point my directories to /discworld/:

$ ls -l /discworld/
total 72
drwxr-xr-x 6 rinzwind rinzwind 12288 mrt 18 23:07 Desktop
drwxr-xr-x 2 rinzwind rinzwind  4096 mrt  2 19:21 Documents
drwxr-xr-x 3 rinzwind rinzwind  4096 mrt 14 11:46 Downloads
drwxr-xr-x 2 rinzwind rinzwind  4096 jun  7  2015 Music
drwxr-xr-x 4 rinzwind rinzwind  4096 mrt 18 23:47 Pictures
drwxr-xr-x 2 rinzwind rinzwind  4096 jun  7  2015 Public
drwxrwxr-x 3 rinzwind rinzwind  4096 mrt  5 16:04 steam
drwxr-xr-x 2 rinzwind rinzwind  4096 jun  7  2015 Templates
-rw------- 1 rinzwind rinzwind   672 nov  8 20:15 backup.user-dirs.dirs
drwxr-xr-x 2 rinzwind rinzwind  4096 jun  7  2015 Videos

$ more .config/user-dirs.dirs 
XDG_DESKTOP_DIR="/discworld/Desktop"
XDG_DOWNLOAD_DIR="/discworld/Downloads"
XDG_TEMPLATES_DIR="/discworld/Templates"
XDG_PUBLICSHARE_DIR="/discworld/Public"
XDG_DOCUMENTS_DIR="/discworld/Documents"
XDG_MUSIC_DIR="/discworld/Music"
XDG_PICTURES_DIR="/discworld/Pictures"
XDG_VIDEOS_DIR="/discworld/Videos"

And I have a spare SSD so if it ever fails I can be up and running in 15 minutes (with an SSD that is what it takes to install).


And there is a move in the Linux world to create a base system that has a read only and a writable part. When that is possible your idea will be possible. You put all the read only stuff on the SSD and the system will remount it writable to do updates and then mount it as read-only for using it.

Rinzwind
  • 299,756
  • I hope the movement mentioned in the last 2 sentences happens.. my intent isn't to take shortcuts; I want to learn how to make use of the powerful commands in Linux. Half of the reason to adding it to my active operating systems, is to make use of it as a server. I suppose I'll have to use a single drive until I can learn how to regulate programs using partitioning/other tools.. I truly wish I had more knowledge and insight.. I guess I'll have to learn the long way. I greatly appreciate your contribution! You've given me a lot to think about. – Arosrheoc Mar 20 '16 at 13:02
  • Here is the way to do it (and all the problems that still exist): https://wiki.debian.org/ReadonlyRoot – Rinzwind Mar 20 '16 at 13:16
0

Rinzwind has explained the basics, but I want to make a few more points:

  • Most Ubuntu installations consume no more than about 15 GB for the OS plus all the programs you might install, but some can be more than that. The system on which I'm typing this uses 28 GB for the OS plus its programs. On a typical desktop or laptop, user data goes in /home. Servers might store lots of data in /srv or /var. Other locations may see heavy use on some systems, but details depend on the purpose of the computer and how it's administered.
  • It's possible to split off /usr (where most program files reside), /home, /var, /srv, /tmp, and many other directories into their own partitions. This can be done to segregate data for safety, to take advantage of unique filesystem features, or for other reasons. A few directories, such as /etc, cannot be split off into their own partitions in this way.
  • I disagree with Rinzwind's use of a non-standard location (/discworld in his case) to hold most user data, at least in most cases. That's re-inventing the wheel, and results in greater complexity. There can be exceptions, such as if you're in a dual-boot configuration and you need to share your personal files across both OSes. This could be a very long debate, though.

Overall, it's not clear why you want to set things up as you suggest, Arosrheoc. If you care to state the reasons for your suggested layout, we might be able to offer better specific advice. Overall, it sounds like you're trying to apply a common Windows habit (namely, segregating the OS from its applications) to Linux. Linux has a very different model of how programs are installed, so that Windows habit just doesn't work in Linux. Understanding the practical goal (optimizing speed, having space for specific big programs, enabling easy OS re-installation, etc.) may enable us to suggest an alternative that will work as well or better.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105