You are not logged in.

#1 2013-09-28 10:40:30

AK-33
Member
Registered: 2011-07-02
Posts: 9

No Swap, No Disk, Only RAM

Greetings to the Arch community!

Yesterday, I performed my first installation of ArchBang on a brand new 16GB USB flash drive. The installation was easy enough (using the abinstall command from an ArchBang virtual machine - although I could not install GRUB, only SysLinux), but I have one major concern. I have read through the "Installing Arch Linux on a USB key" guide (https://wiki.archlinux.org/index.php/In … _a_USB_key) as well as the part about how to minimize read/writes to Solid State Drives (https://wiki.archlinux.org/index.php/SS … d.2FWrites) but still see no clear answer to my question.

I want to know how to ensure all activities performed on my USB drive occur ONLY in the volatile memory (RAM) of the host desktop/laptop.

I created the drive with only one partition (meaning no swap). The 'free -m' command shows available swap space as 0. 'df -h' still shows a number of tmpfs partitions, which I am not 100% certain how are related to swap. 'sudo /sbin/swapon -s' produces no output (as expected).

Basically, I do not want any data (other than that which I intentionally want to make persistent by actually saving onto my USB drive) written to the drive or the host machine's physical disk. My laptop has 6GB of RAM and my desktop has 16, but the drive only uses around 3-4, as I believe a 32-bit OS is limited to about that much. The guide on SSDs also states that swap is rarely used if there is more than 2GB of RAM available.

Nonetheless, I want to ENSURE that nothing is ever written to swap space or to the hard drive.

Have I already accomplished this or is there something else I need to do?

Thank you all in advance.

Offline

#2 2013-09-28 11:47:20

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: No Swap, No Disk, Only RAM

You are looking for a multi-layered unification filesystem; laying tmpfs over your actual install. Have a look at http://aufs.sourceforge.net/

Offline

#3 2013-09-28 21:53:37

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: No Swap, No Disk, Only RAM

Well, we have a couple questions here.  First, your questions don't make a lot of sense.

Example:

I want to know how to ensure all activities performed on my USB drive occur ONLY in the volatile memory (RAM) of the host desktop/laptop.

What?  All activities in the USB drive occur in the novRAM  of the host? 

Second, you don't tell us what the host operating system is.  There are a couple differences between Unix, Linux, Windows, and OS/X.

Third, you don't tell us what the virtual machine is that you are using.  VMware, VirtualBox, QEMU, Whatever Microsoft calls theirs.

Fourth, you really need to ask the question on the forums of the distribution you are using.  Archbang != Arch. 

I will leave this open on the chance I have missed something, but please be aware of our policy:   https://wiki.archlinux.org/index.php/Fo … pport_ONLY


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2013-09-29 11:05:21

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: No Swap, No Disk, Only RAM

@ewaller; while the ts mentions using a vm to install arch-whatever to the usb-stick; I don't see him wanting to run arch-whatever from within a virtualized environment. Also, even if he would; aufs would work just fine. I also fail to see what is archbang (or even archlinux) specific about this question (99% of the topics are about linux software running on arch anyway and not archlinux itself)

And Microsoft calls it "Microsoft Windows Server 2012 Datacenter' wink

Offline

#5 2013-09-29 15:09:38

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: No Swap, No Disk, Only RAM

Spider.007 wrote:

And Microsoft calls it "Microsoft Windows Server 2012 Datacenter' wink

Although it has become virtualized, VirtualPC is probably what he was looking for.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#6 2013-09-29 16:09:40

AK-33
Member
Registered: 2011-07-02
Posts: 9

Re: No Swap, No Disk, Only RAM

@Spider.007: Thank you for the reference to aufs. I never heard of it, but I will check it out.

@ewaller: Forgive my ignorance, as this is the first time I played around with running *nix off a USB flash drive, but to address your questions:

1. I do not want to create a swap partition on my USB drive in order to increase the longevity of the drive. No swap partition means no extraneous writes onto the USB stick. Of course, when I create, save or download files, they will have to be written to the drive. I also do not want any data written to the physical hard drive of the host computer (as would occur if I were installing a *nix distro the usual way - straight onto a host computer - and creating a swap partition). Thus, all activities that do not involve the ones mentioned above should occur only in volatile memory of the host computer. Please let me know if I am still being unclear or explain if what I wish is unfeasible.

2. I am unsure how the host OS is relevant when running Arch* or any *nix distro off a USB or LiveCD/USB, but my laptop is Win7 Home and desktop is Win7 Ultimate.

3. As Spider indicated, I only used the virtual machine (VMware) to install the distro onto the USB drive and am not interested in running it in a virtualized environment.

4. According to my research, ArchBang is for those who wish to run Arch Linux but without having to go through the hassle of the installation process (which I have gone through many a time). In fact, on the ArchBang Installation Guide (http://wiki.archbang.org/index.php?title=Installation), it even reads, "Tip: For reference, read the official Arch Linux Beginner's Guide online. If you are installing Archbang to a USB memory or USB HD, you have to add USB as a HOOK in /etc/mkinitcpio.conf, during the configuration. More information in the official Installing Arch Linux on a USB key."

Spider is again correct in that this question is not ArchBang- or Arch Linux-specific. However, if you still deem this inappropriate here, I will gladly move it to the ArchBang forums.

Offline

#7 2013-09-29 16:29:21

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: No Swap, No Disk, Only RAM

Points 1,2,3.  Okay, I understand now.  Yes, you should be fine.  I thought, perhaps, you were concerned about data leaks in which data would be written to a drive other than the USB.  If those were keys, banking credentials, etc, they could be compromised.  I guess I was over complicating things.  If you are concerned about drive wear and you are running native, without a swap partition you will not wear out your drive.  Consider telling systemd not to log to the disk, but to keep logs in RAM.

As to point 4.  Everyone is free to use our documentation.  We regard Archbang as an Arch Fork, and we are fine with that and which the gold folks at Archbang all the success in the world.  The problem, however, is that there are differences between Arch and Archbang.  I cannot enumerate tose diffences, but that is not my task.  Nor is it our task to keep track of those differences.  My charter as a moderator is to maintain the Arch Linux forums as a technical resource for Arch Linux.  When questions about Arch forks appear, the wisdom provided by Arch users may not be applicable to the various forks.  At that point, if the discussion were to continue, the thread would have to diverge from being applicable to Arch Linux.  We cannot permit that confusion.  Feel free to read and participate in our forums.  We do ask that questions be posted to the forums that are hosted by the distribution you use. 

Thanks.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#8 2013-09-30 15:30:41

AK-33
Member
Registered: 2011-07-02
Posts: 9

Re: No Swap, No Disk, Only RAM

Data leaks are also a legitimate concern, which is why I also do not want any data written to the physical hard drive of the host system. For hypothetical instance, if I were to visit a public library and plug my Arch* USB into one of the computers there for personal use (checking e-mail, online banking, etc.), I would definitely not want anything to be stored on the hard drives of those computers (as Windows potentially would during memory paging processes). However, as far as I know, *nix would only do that if a swap partition is defined; if not, then everything executes in RAM only.

Thus, from a forensics point of view, my activities while using the USB stick should only be written to the stick itself (either during logging or file writes initiated by me) or the volatile memory of the host machine running the USB so that once the host is turned off any traces of my activities would disappear.

Thank you for the advice on systemd - I'll definitely take its configuration into consideration.

Offline

Board footer

Powered by FluxBB