I recently bought a new usb to run my linux-on-the-go system.

I am aware of block limited write-cycles, so I am trying to minimize disk writes. I know that when I insert a disk, it mounts inside /media/[user]/[disk_label].

I am trying to move that /media/[user] to a tmpfs. I know how to do this through /etc/fstab. But there is a little problem. When I make tmpfs on /media/[user], it appears in pcmanfm as whole disk "main". I also tried symbolic linking, but when I link it in /media, it appears as the replacement folder (for example "ramfs"), or when anywhere outside /media (Tried that on /mnt/ access 0777), it simply disappears from pcmanfm side panel after mounted.

My actual questions:

  1. Are there any options to set pcmanfm to ignore ramdisks?
  2. Is there any way to link /media/[user] somewhere else?
  3. How do I create directories on boot in /media, if /media was mounted as a ramdisk?

Because of the low attention of the community, I managed to get the quick&dirty solution. I created small program that copies a filesystem image to /tmp (mounted on tmpfs) and then attaches it to loop device. Next, the udev is run, and it sets UDISKS_IGNORE flag on the loop device. Then, the loop device is mounted on /media. The key is that the filesystem image is really small, just to hold the filesystem (2MB for ext2 or NTFS) and it takes minimal size when on tmpfs, with initial size around 256kb, so the flash is not hurt at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.