Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

  1. #1

    Default Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    I'm trying to optimize the file structure for my SSD. Current fstab is,

    UUID=4af029ee-9a7e-4e42-b1d9-99b0d4c34846 swap swap defaults 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 / btrfs noatime,defaults 0 0
    UUID=fc2ca443-0bcb-4f3e-bfdd-719b6ffa5ecf /home ext4 noatime,defaults 1 2

    #UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /tmp btrfs subvol=@/tmp 0 0
    #UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/spool btrfs subvol=@/var/spool 0 0
    #UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/tmp btrfs subvol=@/var/tmp 0 0
    #UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/log btrfs subvol=@/var/log 0 0

    tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
    tmpfs /var/spool tmpfs defaults,noatime,mode=1777 0 0
    tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0
    tmpfs /var/log tmpfs defaults,noatime,mode=1777 0 0

    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /boot/grub2/i386-pc btrfs subvol=@/boot/grub2/i386-pc 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /boot/grub2/x86_64-efi btrfs subvol=@/boot/grub2/x86_64-efi 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /opt btrfs subvol=@/opt 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /srv btrfs subvol=@/srv 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /usr/local btrfs subvol=@/usr/local 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/cache btrfs subvol=@/var/cache 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/crash btrfs subvol=@/var/crash 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/lib/libvirt/images btrfs subvol=@/var/lib/libvirt/images 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/lib/machines btrfs subvol=@/var/lib/machines 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/lib/mailman btrfs subvol=@/var/lib/mailman 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/lib/mariadb btrfs subvol=@/var/lib/mariadb 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/lib/mysql btrfs subvol=@/var/lib/mysql 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/lib/named btrfs subvol=@/var/lib/named 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/lib/pgsql btrfs subvol=@/var/lib/pgsql 0 0
    UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/opt btrfs subvol=@/var/opt 0 0

    Question one: Should I change
    "UUID=3c4938af-c70d-42a9-abb3-91bced2eecc6 /var/lib/libvirt/images btrfs subvol=@/var/lib/libvirt/images 0 0"
    and the other /var files to
    "tmpfs /var//lib/libvirt/images tmpfs defaults,noatime,mode=1777 0 0" ?

    Question two:
    I've added the following to my /etc/rc.d/boot.local file to create a filestructure in /var for /log,
    for dir in apparmor apt cups dist-upgrade fsck gdm installer samba unattended-upgrades ;
    do
    if [ ! -e /var/log/$dir ] ; then
    mkdir /var/log/$dir
    fi
    done
    Should I be doing this for /spool and /tmp as well? What about the other directories mentioned in Question one? Is this necessary?

    Question three: How are most people configing this on their SSDs? TIA

  2. #2
    Join Date
    Apr 2017
    Location
    Piemont
    Posts
    274

    Default Re: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    Fantastic btrfs incest mode
    I use ext4 for everything
    I mounted / (root)> / home> / boot on ssd
    Bios > SATA configuration: AHCI.
    Code:
    UUID=21f4840c-ff3d-48f0-a36a-5578ce6041c1 /                    ext4       acl,user_xattr,noatime,discard        1 1
    UUID=4a79e528-7bbb-4357-ac42-c6b1b4796448 /archivio            ext4       defaults              1 2
    UUID=2568bd9d-67b8-4cc3-9c61-6230b0b2d5a1 /boot                ext4       acl,user_xattr,noatime,discard        1 2
    UUID=42b49c5f-a050-4506-b9b5-7b66fa9c071c /home                ext4       acl,user_xattr,noatime,discard        1 2
    UUID=da51f0b3-b149-423f-a6a8-0556e79dc257 /tmp                 ext4       acl,user_xattr        1 2
    UUID=3216c0a4-023c-4f56-8298-31f4e39c5ac3 /var                 ext4       acl,user_xattr        1 2
    loyalty returns to those who practice it

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,353
    Blog Entries
    15

    Default Re: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    Quote Originally Posted by portsample View Post
    I'm trying to optimize the file structure for my SSD. Current fstab is,
    <snip>

    Question three: How are most people configing this on their SSDs? TIA
    Hi
    Don't bother, new SSD's handle many writes and reads, 20GiB plus a day, far more than can be expected for normal use... What brand/model of SSD

    If you want to go that route, then consider a re-install and select expert partitioner mode, then here you can configure the mount points and exclude directories if using btrfs.

    The system already optimizes for an SSD device, fstrim etc. They only thing I do is configure swap to reduce it's swappiness....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,353
    Blog Entries
    15

    Default Re: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    Quote Originally Posted by V_idocq View Post
    Fantastic btrfs incest mode
    Hi
    A word to the wise, you have your opinion, just like everyone else, we can all argue to the cows come home about the features etc of whichever filesystem, Desktop etc is better or not. If you want to make a change to the defaults, the forum here is not the place, either the Factory mailing list or a feature request and get some traction to changing it.

    If wanting to help, then I suggest to keep things on a technical level (we have chat and soapbox) and guide/help the user with their specific issue if you can. Thanks
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5

    Default Re: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Don't bother, new SSD's handle many writes and reads, 20GiB plus a day, far more than can be expected for normal use... What brand/model of SSD

    If you want to go that route, then consider a re-install and select expert partitioner mode, then here you can configure the mount points and exclude directories if using btrfs.

    The system already optimizes for an SSD device, fstrim etc. They only thing I do is configure swap to reduce it's swappiness....
    Thanks Malcolm. I've been using Samsung SSDs, both 250gb, one is an 840 the other is an 850. The 840 I've been using daily since 2013 and was starting to develop weird issues, (freezing, garbled text) that I'd attributed to my getting lazy in recent years and just installing the stock openSuse with no special tweaks for SSDs, (no swappiness adjusting, no tmpfs, etc). I'd figured that the openSuse developer lords had incorporated SSD adjustments (fstrim, etc) as standard in the stock distros, but had not seen mention of these changes anywhere. My recent problems w/the Samsung 840 had made me question this assumption.

    Thanks for the response.

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,353
    Blog Entries
    15

    Default Re: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    Quote Originally Posted by portsample View Post
    Thanks Malcolm. I've been using Samsung SSDs, both 250gb, one is an 840 the other is an 850. The 840 I've been using daily since 2013 and was starting to develop weird issues, (freezing, garbled text) that I'd attributed to my getting lazy in recent years and just installing the stock openSuse with no special tweaks for SSDs, (no swappiness adjusting, no tmpfs, etc). I'd figured that the openSuse developer lords had incorporated SSD adjustments (fstrim, etc) as standard in the stock distros, but had not seen mention of these changes anywhere. My recent problems w/the Samsung 840 had made me question this assumption.

    Thanks for the response.
    Hi
    Ahh Samsung... they have been known to be quirky, if you test them with fstrim from the command line, it may still be blacklisted (840's perhaps);

    Just check with;
    Code:
    fstrim --verbose --all
    Is the firmware on the SSD's all up to date?

    This thread maybe of interest about fstrim: https://forums.opensuse.org/showthre...ghlight=fstrim
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7

    Default Re: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Ahh Samsung... they have been known to be quirky, if you test them with fstrim from the command line, it may still be blacklisted (840's perhaps);

    Just check with;
    Code:
    fstrim --verbose --all
    Is the firmware on the SSD's all up to date?

    This thread maybe of interest about fstrim: https://forums.opensuse.org/showthre...ghlight=fstrim
    Samsung 850 EVO and Pro work just fine.

  8. #8

    Default Re: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Ahh Samsung... they have been known to be quirky, if you test them with fstrim from the command line, it may still be blacklisted (840's perhaps);

    Is the firmware on the SSD's all up to date?

    This thread maybe of interest about fstrim: https://forums.opensuse.org/showthre...ghlight=fstrim
    Firmware on both is up to date. From what you have said, I gather that you are of the opinion that it is not needed to establish /tmp and /var in RAM via tmpfs? Correct? Thanks for the useful and thoughtful responses.

  9. #9
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,353
    Blog Entries
    15

    Default Re: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    Quote Originally Posted by portsample View Post
    Firmware on both is up to date. From what you have said, I gather that you are of the opinion that it is not needed to establish /tmp and /var in RAM via tmpfs? Correct? Thanks for the useful and thoughtful responses.
    Hi
    I have never worry about it these days, but that's just me

    I have five laptops here with various OCZ's, a Crucial and a SanDisk SSD(s). When using ext4 on my oldest one (OCZ Agility 60GB) a number of years ago I did a few extra tweaks, but now just run the defaults, on average my systems are writing 6~7GB to the SSD a day, well below the manufacturers specs... the one above is at 38,770 power on hours and SSD_LIfe_Left is at 99% (has been like that for awhile).... There has been some discussion on the forum about the btrfs defaults, but I don't see any indication of any of my SSD's failing in the near future....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  10. #10

    Default Re: Installing on SSD: moving /tmp and /var into tmpfs in RAM memory

    Quote Originally Posted by portsample View Post
    Thanks Malcolm. I've been using Samsung SSDs, both 250gb, one is an 840 the other is an 850. The 840 I've been using daily since 2013 and was starting to develop weird issues, (freezing, garbled text) that I'd attributed to my getting lazy in recent years and just installing the stock openSuse with no special tweaks for SSDs, (no swappiness adjusting, no tmpfs, etc). I'd figured that the openSuse developer lords had incorporated SSD adjustments (fstrim, etc) as standard in the stock distros, but had not seen mention of these changes anywhere. My recent problems w/the Samsung 840 had made me question this assumption.

    Thanks for the response.
    Here is an example of the garbled text that I am getting from the Samsung 840 drive,

    I've moved the drive to machines with similar hardware configs, and have totally wiped the drive using the Samsung bootable exe available from Samsung Magician and then totally openSuse 42.3 with standard SSD optimizations...still I get freeze-ups and this weird malformed text. Note that all of the capital "D"s and lower case"p"s are affected. This machine with the Samsung 850 installed runs fine. I think the drive is toast even though SMART drive calls it "good". Go figure. Anyone here ever seen this before?

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •