2

Using the version of ubuntu server 20.04 I would like to copy some files in the RAM memory from a usb stick and then transcribe them again in a second usb memory.

I currently have 32GB of RAM installed, but it looks like I can only use 16GB. enter image description here

I understand that the system to work needs a slice of memory to work, but would it be possible to repartition the ram memory in order to allocate 5GB of RAM and another 27GB of "HDD"?

I have already read that it is possible to extend this space using a USB memory, but they are not solutions for me.

UPDATE 1: the result of free-h is the following: enter image description here

The goal was to avoid that the USB stick A can transmit information on the USB stick B due to some computer virus or other.

So the idea was as follows:

  • Copy the contents of memory B to RAM.
  • Replace USB memory B with memory A.
  • Write the data in memory A

UPDATE 2: I found this: https://ostechnix.com/adjust-size-root-partition-live-arch-linux/

is it possible to replicate this in ubuntu?

Alternatively, using Arch, how can you quickly set the screen resolution via the terminal?

As the system boots, a resolution or frequency not supported by the display appears to be used!

I know that xrandr exists, but without a video output it seems a bit difficult to understand what is broken.

Pinguto
  • 167
  • 1
    What is the output of free -h ? – Soren A Dec 09 '21 at 10:16
  • 3
    Can you connect both USB drives at the same time, or can you only connect one of them each time? Why are you running Ubuntu Server live? Is there an internal drive? What kind of drive and how big is it, the drive that your Ubuntu Server is booting from? - I think it would nicer to run Xubuntu Core live or persistent live instead of Ubuntu Server. Xubuntu Core is small. – sudodus Dec 09 '21 at 10:20
  • 3
    I have updated the question .. I hope I have answered both of them. :) – Pinguto Dec 09 '21 at 10:57
  • Most virus will reside in files, and I don't think your strategy will protect against such virus. I think you can have two USB drives connected at the same time, and make the transfer directly. – sudodus Dec 09 '21 at 16:55
  • 1
    I understand, but I'd like to get a computer that is literally impossible for you to access without my permission to use as a "digital safe". As you well know, despite the continuous updates, there will always be some exploitable bugs, so I aimed at a hardware procedure with which it is possible to avoid data leakage. – Pinguto Dec 09 '21 at 20:54
  • I don't understand your logic, Please see: https://security.stackexchange.com/questions/123872/safe-to-connect-a-usb-to-linux and https://askubuntu.com/questions/4508/how-do-i-safely-use-a-virus-infected-usb-drive-in-ubuntu – ofirule Dec 12 '21 at 23:49
  • I found no answers for this interesting question... https://www.linuxquestions.org/questions/ubuntu-63/change-the-size-of-the-ramdisk-used-by-ubuntu-12-04-live-cd-4175435393/, https://unix.stackexchange.com/questions/393973/define-ram-disk-size-of-a-custom-built-kali-iso-when-booted-live – sancho.s ReinstateMonicaCellio Dec 13 '21 at 01:39
  • I have updated my application again. I understand that for some my purpose may not make any sense, but I often have to work using live CD distributions and often a few more gigs is not that I would mind that much! – Pinguto Dec 14 '21 at 11:26

2 Answers2

2

You can try to resize the memory partition size using:

sudo mount -o remount,size=10G none /
  • none - doesn't matter for tmpfs
  • / - mountpoint

Example:

# mkdir /mnt/test 
# mount -t tmpfs -o size=1G none /mnt/test
# df -h |grep test
none                 1,0G     0  1,0G   0% /mnt/test
# mount -o remount,size=10G none /mnt/test
# df -h |grep test
none                  10G     0   10G   0% /mnt/test
# mount -o remount,size=1000G none /mnt/test
# df -h |grep test
none                1000G     0 1000G   0% /mnt/test

Second, If you can resize it fine, you could even set it way more that your available memory, BUT keep in mind, that those files are stored in memory, and your PC will slow down event into standstill if you run out of free memory.

If you really need more than available memory you can:

  • setup a swap file/partition on some hard drive (including usb) - but keep in mind that it will not be encrypted by default
  • just create/mount some drive like normal and use it (same, you can always encrypt it)
kolorafa
  • 141
  • 3
  • Your solution works, but before accepting it I believe that some corrections need to be made: in ubuntu the folder for mounting devices is media and not mnt and if you don't create the folder in which to mount the partition dummy with mkdir / media / test the command will fail! – Pinguto Dec 16 '21 at 14:45
  • Path was just as an more visual example. Personally I use /mnt/ for manually created mountpoints, because /media/ is a lot of times managed by OS subsystem, so I avoid any potential problems. But added the mkdir. – kolorafa Dec 17 '21 at 15:35
  • OK thank you! I happily accept your answer! :) – Pinguto Dec 18 '21 at 09:36
0

Here is a guide on how to adapt GRUB2 and mount a LiveISO and maybe this guide for a TAILS distribution is also interesting for achieving your goals. This starts a virtual system which enables you to mount USB flash drive A and B. Here you can do everything, zip packages or encrypt folders and files.

Pablo Bianchi
  • 15,657
lemrm
  • 143
  • Not bad tool, but I don't think it's for me. Anyway thanks for your answer! – Pinguto Dec 14 '21 at 19:18
  • @Pinguto I'm very interested in your solution. Please, post it here. – lemrm Dec 14 '21 at 19:39
  • For the moment I have not yet found a definitive solution. I'm doing some tests with Manjaro's linux distribution or I'll try to get the 16GB offered by ubuntu enough. – Pinguto Dec 14 '21 at 20:58