# Using a hotswap rack[SOLVED]

## A.S. Pushkin

I hate to pose this question, but searches have not yielded an answer.

Last year I built a new box. My system is loaded on a Samsung 850 PRO SSD, with home partition on a Seagate Baracuda.

I decided to include a hotswap rack and currently have a Seagate 1TB installed there. The intent is primarily for files from CAD(Blender and Freecad), video and audio editing.

Currently it it does work, but I don't like the way it is mounted and wonder how I might alter that. Right now it mounts like this:

/dev/sdd2       437G   71M  414G   1% /run/media/pushkin/389cf391-5608-4b9f-be33-84939c3f37f2

/dev/sdd1       481G   70M  456G   1% /run/media/pushkin/9a84a5b7-8b2f-48ab-a5a8-6bf68365a6b7

I have a two partitions on that drive right now. I had hoped to have the rack mount under other than /mnt  or /media.

Any suggestions would be appreciated.

----------

## Roman_Gruber

 *Quote:*   

>  I have a two partitions on that drive right now. I had hoped to have the rack mount under other than /mnt or /media. 

 

mounting as /media is bad in my eyes. it was introduced with those automounters a few years ago, before it was usually alawys /mnt

When you want it to be mounted somewhere else, create a fstab entry with the uuid!

I do not rely on automounting. I mount stuff myself, or have fstab entries

----------

## NeddySeagoon

A.S. Pushkin,

Make mount points wherever you want. Under /mnt  is traditional.

Add entries to /etc/fstab to perform the mount.

----------

## A.S. Pushkin

Thanks for the responses.

Roman_Gruber I'm beginning to agree with you on the automount. I'm embarrassed to say I've never fully grasped mounting

so I initially was happy with it, but see this as a small problem.

NeddySeagoon thank you, too.

May I pose a question to  you both? I've tried setting fstab to handle this hotswap rack. When I built this current box, I created

a special location, but I suspect  Roman_Gruber is right, that is to mount at /mnt. The question I have is if I add an fstab entry can I make a generic one

that would function for any sata drive I would install in the hotswap rack, at /mnt regardless of partition schemes that may be used? Currently

the 1TB drive has two partitions, but that might vary depending on the use. The current drive is just extra space, but others might be used for

audio editing and video editing. I'm working with Blender, Freecad, ardour and kdenlive. I may jump into a commercial CAD program BricsCAD as well.

Thanks!

----------

## Roman_Gruber

 *A.S. Pushkin wrote:*   

> 
> 
> May I pose a question to  you both? I've tried setting fstab to handle this hotswap rack. When I built this current box, I created
> 
> a special location, but I suspect  Roman_Gruber is right, that is to mount at /mnt. The question I have is if I add an fstab entry can I make a generic one
> ...

 

```
blkid
```

It all depends on the use case.

USE gpt when dealing with uefi and (or) Drives bigger as 2.2TB

use e.g. UUID (check with blkid), PARTUUID? or any other unique way to name a partition.

Just generate several fstab entries. You 'll probably need ot initialize it anyway. Let'S say create gpt partition table, file system. I recommend that you will use lvm2 "Containers" (lv / vg) and creatre those fstab entries. Your can use the same mountpoint anyway because the hotswap will only allow a set of drives anyway at a point of time. I also write the lvm2 names on the drives with a marker these days

lvm2 is more flexible as the common used partition thing. IT also depends if you are using af file system which allows growing or shrinking of the partition.

----------

## NeddySeagoon

A.S. Pushkin,

You cannot make a generic fstab entry for any hard drive.

You don't mount drives, you mount the filesystems that they contain. To do that, you need to know something about either the partition that holds the filesystem, or the partition itself.

It follows that you need to know how many partitions are on the drive at a minimum.

You can cheat a little though.  If you know that several partitions are all mutually exclusive, because, say, you can only put one drive into the hot swap bay at a time, you can have several fstab entries poinitng to the same mount point.

e.g. 

```
UUID=1c981da8-f0f6-4953-b485-8dbc9e7c6879  /mnt/music                    ext4  noatime,nofail    1 0

UUID=24e36648-f410-40b8-931f-41ad46741a47  /mnt/music                    ext4  noatime,nofail    1 0

UUID=c486b7cc-6df4-4a55-8add-0691db3bbc02  /mnt/music                    ext4  noatime,nofail    1 0
```

If somehow to manage to have all three filesystems online at the same time, they would be mounted on top of each other at /mnt/music

You need to be sure that can't happen.

----------

## szatox

Hint: LABEL is a very convenient feature.

I don't swap drives nearly often enough to care, but if I needed automount I'd go with a cheat script creating directories named after labels on filesystems then mounting there.

Maybe - just maybe - you could even use already existing helpers. GUI tools are doing something similar. It can be good enough unless they depend on half of the DE  :Smile: 

----------

## A.S. Pushkin

NeddySeagoon, szatox, and Roman_Gruber, thanks for the input. It's clear I've been playing a Windose

user with my Linux box.

I like the idea of LVM, too.

I should add that I've used Clonezilla very successfuly.

Thanks.

----------

## A.S. Pushkin

Until my recent update, which ever drive was in the hotswap rack would be auto mounted. With that update it no longer does.

if I run the mount command I can mount it at /mnt.

When I built my current box I opted to move my distfiles to a separate drive to save space on my / drive.

Currently fstab has it mounted at /mnt, which is a problem as when I mount manually to drive in my hotswap

rack. I typically use that for CAD files and Video/audio files. I'd like to mount the distfiles drive another way.

I'm not certain if I should create a directory off of / or what, so that I can leave /mnt free. My optical drive

mounts at /media.

Suggestions would be appreciated.

TIA.

----------

## NeddySeagoon

A.S. Pushkin,

/mnt is not intended to be used as a mount point itself.

Its directory containing other mount points.

```
$ ls /mnt

bluray  floppy  media   usb2_32_mini  usb3_16

cdrom   gentoo  oldvar  usb2_64       usbstick
```

My filesystem tree is

```
$ df -Th

Filesystem                 Type   Size  Used Avail Use% Mounted on

/dev/mapper/static-root    ext4   976M  761M  149M  84% /

/dev/mapper/static-usr     ext4   158G  109G   42G  73% /usr

/dev/dm-12                 ext4   5.8G 1002M  4.5G  18% /var

tmpfs                      tmpfs  1.6G  180K  1.6G   1% /run

shm                        tmpfs  7.9G   34M  7.8G   1% /dev/shm

cgroup_root                tmpfs   10M     0   10M   0% /sys/fs/cgroup

/dev/mapper/vg-home        ext4   1.5T  1.1T  357G  76% /home

/dev/shm                   tmpfs  7.9G   20K  7.9G   1% /tmp

/dev/mapper/static-opt     ext4   976M  273M  636M  31% /opt

/dev/mapper/static-local   ext4   976M  6.5M  903M   1% /usr/local

/dev/mapper/static-portage ext4   3.0G  319M  2.5G  12% /usr/portage

/dev/mapper/vg-distfiles       ext4   148G  117G   25G  83% /usr/portage/distfiles

/dev/shm                   tmpfs  7.9G     0  7.9G   0% /var/tmp/portage

/dev/mapper/vg-var         ext4    58G   21G   35G  38% /mnt/oldvar
```

As long as you can describe the filesystem tree in /etc/fstab, you can use it.

----------

## A.S. Pushkin

Thanks for the feedback! You may have covered this here, but let me ask this question

as it clearly will vary with each drive.

As I noted, with my recent upgrade the automounter is no longer working on my hotswap rack.

I'll have to get my Unix book out as now I've been reminded that everything is about "files"

and that applies in Linux as well.

NeddySeagoon thanks for the refresher, too, about /mnt.

I've never used LVM, though I would like to have done so, but this raises still another question.

If my Linux box is not using LVM, can I set LVM up on what amounts to a portable drive, that is

a drive in a hotswap rack?

As I think about it, though I like the automounter, I do prefer having more control on what I attach to

my system.

Thanks for the help in this.

----------

## A.S. Pushkin

NeddySeagoon thanks for this reminder! 

 *Quote:*   

> /mnt is not intended to be used as a mount point itself.
> 
> Its directory containing other mount points. 

 

I created a directory at /mnt and running the mount command gave me access to the hotswap rack drive.

Often time Gentoo is painful, but the forum is one reason I continue with Gentoo as my primary Linux distro!

Thanks for the help, all  who responded to my post! NeddySeagoon, your reminder was particularly important!

Thanks to all.

----------

