Luks contents not visible/accessible - Manjaro Linux - manjaro

just encrypted with Luks an USB pen drive using KDE partition manager on Manjaro. The operation went well and could mount the USB drive by entering the passphrase. As all permissions were set as root, I changed the ownership with my actual username so that I could copy all my contents from the SSD to the USB pen drive. Once restarted my machine, I was not able to see/access to my USB contents anymore (?!). The mount runs well but can't see nothing but just the folder name which initially contained all my stuff. The fact is that i can see the space which has been occupied (about 350MB) on the USB pen drive by my documents but is like nothing is there.

I dont know how KDE manage LUKS partitions.
If you want to do this manualy:
lsblk to geht your drive number /dev/xxx.
sudo cryptsetup luksOpen /dev/xxx usb replace xxx with your device location.
With mount you can now mount the usb to your wish location sudo mount /dev/mapper/usb /my_location replace my_location with your mounting point. Now your mounting the mapper which cryptsetup created on your system.
To unmount the device: sudo umount /dev/xxx or sudo unmount /my_location.
You can see with df -h all your mounted devices.

Related

Changing the docker data directory to a non root location changes the disks name

High-level goal:
I want to build the carla-simulator in a docker environment.
Low-level goal:
My root file system does not have enough disk space. Therefore, I changed my docker data directory from /var/lib/docker/ to my internal HDD mounted at: /media/<username>/HDD into the folder /media/<username>/HDD/docker/ which I created prior to changing my daemon.json in /etc/docker/. I followed this guide to achieve this modification https://www.guguweb.com/2019/02/07/how-to-move-docker-data-directory-to-another-location-on-ubuntu/.
This worked well until I rebooted.
My Problem:
Everytime I reboot, the name of my mounted HDD is incremented. After the first reboot, the name changed from HDD to HDD1, after the second reboot from HDD1 to HDD2. This caused many problems and I am unable to relocate my docker data directory.
Removing the data-root specification from the daemon.json removed this problem, but I would like to relocate my docker data directory.
Suspected reasons:
Maybe the docker deamon starts looking for the internal HDD before ubuntu mounts the drive. But I don't know what I could do to fix my problem.
Software in use:
Ubuntu 20.04
Docker 20.10.15
HDD Partion as Ext4

docker overlay2 increase size

I am very new to docker so please pardon if anything stupid :P
I have docker running on my cloud server and was facing issue of running out of space because of docker overlay files. So I mounted 100GB of storage to the server at
/home/<user>/data
and in daemon.json configured the docker root directory to this newly mounted storage and copied all the old files but after that also when I check
df -h
overlay file shows size 36G. Am I doing something wrong
How can I increase this overlay to completely utilize the storage ?
PS: Also when it starts filling up it doesn't increase space it just fills up and all the apps stop working
Docker stores images, containers, and volumes under /var/lib/docker by default. If you haven't mounted another filesystem there, you are likely looking at the free space on your root filesystem.
When mounting another filesystem in this location, you likely want to move the current directory aside so you can copy it into the new filesystem. If you do restore the content, be sure to use a command that preserves ownership, permissions, and symlinks (I believe cp -a and tar both do this).
Also, make sure the docker engine is not running when you replace this directory, and be sure the filesystem type matches your current root filesystem type, or is compatible with your graph driver.

Docker access to future mounted volume

I am currently wondering how I can access to an encrypted USB key without the --privileged. Let's say I have /dev/sda1 a Luks encrypted key and container a running docker container. This key is opened via cryptsetup luksOpen /dev/sda1 encrypted_sda1 --key-file=key-file. So now, I have /dev/mapper/encrypted_sda1 accessible. Now, I exec mount /dev/mapper/encrypted_sda1 /media/sda1 where /media is shared between my host and my container.
Now, from my host device, I can access to the content of my key via /media/sda1. But from my container (without privileged), I can't. I just have an empty directory called sda1 in /media
The strange thing is if I run my container after mounting the USB key in /media, I can access to /media/sda1 from the container. So I think it's because the volume is not correctly sync and there is something wrong with some rights.
I don't really understand why I can't access /media/sda1 when I mount a USB key from the host when the container is running. Any lead?
Have a nice day!
Instead of --privileged, I think you need to configure bind propagation on the /media mount. The default is rprivate, meaning that no mount points anywhere within the original or replica mount points propagate in either direction. If you use rslave, submounts (e.g., /media/sda1) of the original mount are visible in the replica.
docker container run --mount type=bind,source=/media,target=/media,bind-propagation=rslave …

Docker volume vs mount bind for external hdd

First time docker ser here, running on Raspberry Pi 3 (Hypriot OS). I have an external hdd attached to my raspberry pi to store all the files. The os is on the sdcard.
I am setting up many images on docker: sonarr, radarr, emby server and bittorrent client.
I have created all containers following the lines on docker hub page, so I attached all of the folders using mount bind (-v /some/path:/some/path).
Now the documentation says volume is better because it doesn't rely on filesystem. Also, I am having problems because I want to use hardlink between files on my external hdd, but because I am using mount binds, it seems to not work when calling hardlink from one mount to another on the same hdd. I think adding only one mount bind should solve this but I just want to make the config correct now.
Is volume an option to store all the movies or should I keep using mount bind?
In canse of volume, can I specify the external hdd to store movies? I have docker installed on an sdcard but I need the movies on my external hdd.
I have used docker create volume --name something -o device=/myhddmount/ but I am not sure if this is ok, because docker volume inspect shows a mountpoint on the sdcard. Also, when I create the volume, should I set -o type=ext4? because according to the manual etx4 doesn't has a device= option.
Thanks!

Storing local docker images on External HDD boot2docker

I'm using docker on my macbook air which unfortunately has quite limited hard drive space (120gb).
Was wondering how I could store containers on my external drive instead of the default (which I believe is /var/lib/docker/) ?
EDIT: It is in fact not /var/lib/docker - when using boot2docker I believe the files are stored on the virtualbox instance.
You can do this by changing file location in docker.
You can go to Preferences->Advanced, and under the storage path change the location to your external hard drive.
View the screenshot for reference
After clearing your macbook folder, mount your external hard drive on that path:
mount -t <fstype> -o defaults /dev/<your device> /var/lib/docker/
For use with boot2docker, try with something like:
mount -t vboxsf -o uid=1000,gid=50 /dev/<your device> /var/lib/docker/
where <your device> could be for example sdb.

Resources