Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
pseudorandom name
May 6, 2007

Klyith posted:

I didn't go with LVM for my first install, so I'm just doing manual storage management. I dunno how useful LVM would be for me anyways: I have one each NVMe, SSD, and HDD (plus a smaller SSD for windows) and so spanning across 3 very different drive speeds seems questionable.

LVM is useful even if you're not doing anything with it *now* because you can do neat things like transparently move an in-use volume to a different disk later.

Adbot
ADBOT LOVES YOU

BlankSystemDaemon
Mar 13, 2009



Klyith posted:

So, now that I'm pretty satisfied that I can use desktop linux as my main OS, I am converting my storage & data over to linux-native from ntfs. Question time:

1) How do people generally like to mount supplemental drives or volumes? The file manager auto-mounts stuff in /run/media/username, but if I'm putting stuff in fstab should that be in /mnt or what?
I didn't go with LVM for my first install, so I'm just doing manual storage management. I dunno how useful LVM would be for me anyways: I have one each NVMe, SSD, and HDD (plus a smaller SSD for windows) and so spanning across 3 very different drive speeds seems questionable.

2) Usernames, groups, and IDs: are they as simple as they look? Particularly when it comes to user & group ownership of files. Say my username is Sexcopter & UID is 1001. Sometime in the future I move a HDD to a new machine which also has Sexcopter:x:1001 in passwd. Will the folders and files owned by Sexcopter still be owned by the new Sexcopter on the new install?
(I ask because this was a thing that was super-annoying in Windows, your true ID was a huge GUID so if you reinstalled or whatever you had to reset ownership everywhere.)

3) Are there any other common gotchas or noob mistakes with user/group ownership? I've read "don't chmod +777 stuff" which I can get behind, but is there for example a problem with assigning ownership of a folder to nobody?
To add to what xzzy said about it being that simple; the reason it's simple is that the username is just there for humans to read; most software uses UIDs and GIDs for everything, and most utilities that manipulate them can be instructed to not even display the usernames, should you need to work with things programmatically (since it's easier to do error checking on integers than it is to do on strings).

ExcessBLarg!
Sep 1, 2001

Klyith posted:

but is there for example a problem with assigning ownership of a folder to nobody?
Well, the whole point of the nobody user is that it isn't a "real user" and so it shouldn't have permissions to anything (other than things that have "other" permissions). If you find yourself in a situation where you're trying to chown a folder to nobody, you're probably better off creating a dedicated service user for that purpose and assigning ownership to that user.

Otherwise "nobody" isn't special, this is all convention.

The only other gotcha worth mentioning is that you might run across POSIX/NFS/whatever ACLs at some point, particularly in a remote-mounted filesystem, in which case ownership and access is a bit more complicated than the traditional model of user/group/other, but you probably won't come across that on a straight desktop install.

ExcessBLarg! fucked around with this message at 22:46 on Jul 2, 2022

BlankSystemDaemon
Mar 13, 2009



ExcessBLarg! posted:

Well, the whole point of the nobody user is that it isn't a "real user" and so it shouldn't have permissions to anything (other than things that have "other" permissions). If you find yourself in a situation where you're trying to chown a folder to nobody, you're probably better off creating a dedicated service user for that purpose and assigning ownership to that user.

Otherwise "nobody" isn't special, this is all convention.

The only other gotcha worth mentioning is that you might run across POSIX/NFS/whatever ACLs at some point, particularly in a remote-mounted filesystem, in which case ownership and access is a bit more complicated than the traditional model of user/group/other, but you probably won't come across that on a straight desktop install.
GID 65533 and GID+UID 65534 very explicitly exist because of NFS, and the configuration directive maproot which remaps a client UID/GID=0 as something else on the server, so NFS can't be used to escalate privileges by accident.
This is also the default behaviour, at least the BSDs.

It has been repurposed by so many people over so many years that this is almost impossible to prove with official documentation as it was never explicitly written down to begin with, but I've heard it from several people including Rick Macklem who's been involved with NFS since the 80s and is still active today.

It's always better to have a process running as its own user-group, ie. www:www for a httpd, ntpd:ntpd for ntpd, et cetera ad nauseum.

BlankSystemDaemon fucked around with this message at 23:13 on Jul 2, 2022

Mr. Crow
May 22, 2008

Snap City mayor for life
I have my extra desktop drives mounted in various locations, like /home, /usr/local (and another under /usr/local/games) and /opt. I put temporary mounts and NFS mounts under /mnt.

man hier and man filesystem go into detail on the filesystem hierarchy and common spots to create mounts, but as was said you can do whatever.

Aware
Nov 18, 2003
What's the best small memory footprint Linux these days? I'm doing some lab setups to give training from on my laptop which has 16gb of ram. I'd like to have a bunch of small CLI only guests for basic poo poo like using ping and trace route. Ideally something that can run with 256mb of ram or there abouts. Doesn't have to be current as far as kernel/software goes, won't be connected to the internet in any meaningful way and will only run for a few hours in a given day.

E. Actually freebsd seems to want only 64mb that'll do I reckon.

Klyith
Aug 3, 2007

GBS Pledge Week
Thanks for the rundown on nobody, BSD and ExcessBlarg!

I had read a blurb that mentioned it and said something like "nobody is always the same as the least privileged account", and was thinking that was like, everybody could be nobody. So it would be like saying "no owner". Nope, barking up the wrong tree. Hmmm.


Mr. Crow posted:

I have my extra desktop drives mounted in various locations, like /home, /usr/local (and another under /usr/local/games) and /opt. I put temporary mounts and NFS mounts under /mnt.

oh man I didn't think about putting things directly in /home rather than in the ~ user folder. I like that. No problem with making additional folders in home that aren't user accounts?


pseudorandom name posted:

LVM is useful even if you're not doing anything with it *now* because you can do neat things like transparently move an in-use volume to a different disk later.

Yeah, I 100% see the coolness factor. I'm just taking the cowardly approach of learning about things before I try them out and gently caress everything up.

Also I've had the same general setup of Windows drives / partitions for a hella long time, so TBQH I don't know if I'll ever need much in the way of dynamic managed storage. I'm pretty tidy and well-organized with my data.

xzzy
Mar 5, 2009

Klyith posted:



oh man I didn't think about putting things directly in /home rather than in the ~ user folder. I like that. No problem with making additional folders in home that aren't user accounts?

This is totally fine if it makes sense to you. Even if you make a user account in the future with the same name as an existing folder it doesn't matter, you can make their home directory any folder you want in /etc/passwd.

They won't automatically get ownership of that folder either if you do make it their home, account creation tools don't do a recursive chown.

BlankSystemDaemon
Mar 13, 2009



Klyith posted:

Thanks for the rundown on nobody, BSD and ExcessBlarg!

I had read a blurb that mentioned it and said something like "nobody is always the same as the least privileged account", and was thinking that was like, everybody could be nobody. So it would be like saying "no owner". Nope, barking up the wrong tree. Hmmm.
I understand why people make the assumption about the nobody account+group and nogroup group, because I used to make exactly the same assumption a long long time ago.

There's no such thing as "least" privileged (*), every account that isn't UID 0 (root/toor) share the same level of privilege and their access is controlled via groups or ACLs.

*: The exception being if you make it so an account can't login (by setting its home-directory to /nonexistent, set a blank password, or set their shell to /usr/sbin/nologin - all of which the nobody user has, which is why people make the assumption), which is usually just done for service accounts that only run a single daemon which logs to syslog and have pid files that're managed by a supervisor process.

breadshaped
Apr 1, 2010


Soiled Meat
Does anyone know why I can't seem to get past here? Either I press enter or I let it countdown but everytime the count resets and it never actually boots. I believe I have allowed all bios settings to do a UEFI boot from usb. I don't have another USB to try right now but I tried using the Universal-USB-Installer in NTFS and FAT32.

Hardware is a Lenovo Thinkpad T480 i5 8th gen.



e: \/\/\/ that's a nice suggestion, I'll try it!

breadshaped fucked around with this message at 21:05 on Jul 3, 2022

Mr. Crow
May 22, 2008

Snap City mayor for life
This is a wild rear end guess, but Its a net installer, maybe it cant load your network driver? Try the offline one

hazzlebarth
May 13, 2013

Bedshaped posted:

Does anyone know why I can't seem to get past here? Either I press enter or I let it countdown but everytime the count resets and it never actually boots. I believe I have allowed all bios settings to do a UEFI boot from usb. I don't have another USB to try right now but I tried using the Universal-USB-Installer in NTFS and FAT32.

Could this maybe be a secure boot issue? I don't know how/if Debian signs their kernels, so maybe grub itself is signed, but the installer kernel isn't?

RFC2324
Jun 7, 2012

http 418

time i have had that behavior it was because the distro required a CPU feature that my old rear end hardware lacked, and didn't have handling to tell me why

something to do with my old rear end EFI implementation.

maybe try running a memtest?

Truga
May 4, 2014
Lipstick Apathy

Mr. Crow posted:

This is a wild rear end guess, but Its a net installer, maybe it cant load your network driver? Try the offline one

it's not that, the network driver gets loaded later on during setup, along with dhcp and asking for IP if that fails

also, secure boot install worked fine on my pc, but i have no idea how wonky uefi standards for that are

Bedshaped posted:

Does anyone know why I can't seem to get past here? Either I press enter or I let it countdown but everytime the count resets and it never actually boots. I believe I have allowed all bios settings to do a UEFI boot from usb. I don't have another USB to try right now but I tried using the Universal-USB-Installer in NTFS and FAT32.

it's weird you're only getting the filename of the iso, instead of a few options for the debian installer (like graphical, command line, expert, recovery mode, etc). idk how you got that but i found the simplest way to install debian is to just dd the entire netinst iso to /dev/sdX and boot that. if you're on windows, probably just use ethcher, there's a simple portable download at github https://github.com/balena-io/etcher/releases

Comatoast
Aug 1, 2003

by Fluffdaddy
That could be file corruption. Either the USB is bad, the download was bad, or the transfer to the USB was bad.

breadshaped
Apr 1, 2010


Soiled Meat
So secure boot was already disabled.

I've downloaded the full dvd iso instead of the netinst and I'll use Etcher put that on the same usb drive. I'll try again now before looking at other options posted.

Edit: it worked. Thanks everyone

breadshaped fucked around with this message at 22:22 on Jul 3, 2022

CaptainSarcastic
Jul 6, 2013



Mr. Crow posted:

This is a wild rear end guess, but Its a net installer, maybe it cant load your network driver? Try the offline one

I do this as a matter of course just because online repositories are often slow as poo poo and a net install can take significantly longer than just starting with a 5GB ISO download and running updates afterward. I haven't done a net install in years because of that, as well as other poo poo like networking drivers and such not working on net installs. It seems like net installs are really ideal if you are running them off a local network compared to having pull everything from the Internet.

RFC2324
Jun 7, 2012

http 418

CaptainSarcastic posted:

I do this as a matter of course just because online repositories are often slow as poo poo and a net install can take significantly longer than just starting with a 5GB ISO download and running updates afterward. I haven't done a net install in years because of that, as well as other poo poo like networking drivers and such not working on net installs. It seems like net installs are really ideal if you are running them off a local network compared to having pull everything from the Internet.

pretty sure thats the ideal for everyone involved, yeah, tho they are pretty fast nowadays, with plenty of mirrors

CaptainSarcastic
Jul 6, 2013



RFC2324 posted:

pretty sure thats the ideal for everyone involved, yeah, tho they are pretty fast nowadays, with plenty of mirrors

I might have bad luck or be in a place with bad routing, but I sometimes have the OpenSUSE repos just crawl, and the last year or two Packman has had issues with mirrors and connectivity.

RFC2324
Jun 7, 2012

http 418

CaptainSarcastic posted:

I might have bad luck or be in a place with bad routing, but I sometimes have the OpenSUSE repos just crawl, and the last year or two Packman has had issues with mirrors and connectivity.

OpenSUSE mirrors can be a bit dodgy, yeah. I'm not running a linux desktop right now, so I forgot about that

BattleMaster
Aug 14, 2000

So for mount locations, my thoughts are as follows and I'm wondering how "standard" this is (though I understand you can just put anything anywhere if you want):

Root: Lots of stuff can get mounted in root if you want to put it on another drive or partition to give it dedicated space or make it easier to migrate to a new install. /var and /home seem most common for those reasons. /usr seems less likely to be mounted elsewhere nowadays but /opt and /usr/local are candidates if you install a lot of non-distro-managed stuff. /srv if it has its own drive or the system is serving content from a network location (webserver running on multiple machines serving content from a fileserver?).

The old rationale for giving /boot its own small partition at the start of the drive seems to no longer be valid on 2000s and later hardware but I think UEFI insists on a separate /boot? Maybe a separate /boot if you have multiple Linux installs?

/media: Removable stuff - optical, USB, whatever. Some programs like pmount or various file browsers will automatically create mount points here when you need them, so you don't necessarily need fstab entries or existing mount points for this stuff.

/mnt: Non-removable storage and network locations that do not need to be mounted elsewhere. I mount those things here and put symlinks in my home directory or desktop or wherever for convenience.

You can get more specific than those (/srv/www and /srv/ftp or whatever each having their own drives for instance) but I'm wondering if you want to start looking into RAID at that point?

Yaoi Gagarin
Feb 20, 2014

BattleMaster posted:

So for mount locations, my thoughts are as follows and I'm wondering how "standard" this is (though I understand you can just put anything anywhere if you want):

Root: Lots of stuff can get mounted in root if you want to put it on another drive or partition to give it dedicated space or make it easier to migrate to a new install. /var and /home seem most common for those reasons. /usr seems less likely to be mounted elsewhere nowadays but /opt and /usr/local are candidates if you install a lot of non-distro-managed stuff. /srv if it has its own drive or the system is serving content from a network location (webserver running on multiple machines serving content from a fileserver?).

The old rationale for giving /boot its own small partition at the start of the drive seems to no longer be valid on 2000s and later hardware but I think UEFI insists on a separate /boot? Maybe a separate /boot if you have multiple Linux installs?

/media: Removable stuff - optical, USB, whatever. Some programs like pmount or various file browsers will automatically create mount points here when you need them, so you don't necessarily need fstab entries or existing mount points for this stuff.

/mnt: Non-removable storage and network locations that do not need to be mounted elsewhere. I mount those things here and put symlinks in my home directory or desktop or wherever for convenience.

You can get more specific than those (/srv/www and /srv/ftp or whatever each having their own drives for instance) but I'm wondering if you want to start looking into RAID at that point?

/boot needs to be FAT32 because of EFI

Imo, on a modern system there's basically no need to separately mount any of the other standard directories under / for a desktop, except for maybe /home if you really want to (or your home is on NFS or whatever)

buglord
Jul 31, 2010

Cheating at a raffle? I sentence you to 1 year in jail! No! Two years! Three! Four! Five years! Ah! Ah! Ah! Ah!

Buglord
I'm trying to make a transition to Linux from Windows and one thing that I noticed is missing is an app for OneDrive. Looks like there's some third party solutions which cost money if I really wanted to keep OneDrive.

Are there any Linux-friendly (has a desktop application) cloud hosting services this thread uses? A must-have is in iOS app, too. Does this thread have any suggestions? Mega looks decent, has more privacy (seemingly) than OneDrive, has a linux app and an iOS app. Dropbox is another option but didnt they have security issues and leaks several years ago? I'm trying to de-Google myself so I dropped Google Drive a while back too.

BattleMaster
Aug 14, 2000

VostokProgram posted:

/boot needs to be FAT32 because of EFI

Imo, on a modern system there's basically no need to separately mount any of the other standard directories under / for a desktop, except for maybe /home if you really want to (or your home is on NFS or whatever)

I've never seen it happen but I've heard that a separate /var can limit the damage from something that's broken or badly behaved that eats all the free space.

I do separate /var and /home on my machines because I'm a weirdo who likes to have a read only root. (I also have tmpfs for /tmp and /media)

RFC2324
Jun 7, 2012

http 418

on my home machines I just make new directories and mount poo poo there :shobon:

on work machines man heir is fun to try to follow tho

Mr. Crow
May 22, 2008

Snap City mayor for life

buglord posted:

I'm trying to make a transition to Linux from Windows and one thing that I noticed is missing is an app for OneDrive. Looks like there's some third party solutions which cost money if I really wanted to keep OneDrive.

Are there any Linux-friendly (has a desktop application) cloud hosting services this thread uses? A must-have is in iOS app, too. Does this thread have any suggestions? Mega looks decent, has more privacy (seemingly) than OneDrive, has a linux app and an iOS app. Dropbox is another option but didnt they have security issues and leaks several years ago? I'm trying to de-Google myself so I dropped Google Drive a while back too.

Checkout https://syncthing.net/ if you just want file synchronization, its great, FOSS, and available on all platforms. I use it to sync photos on my families phones and my NAS, among other things. My wife will take a picture and ill (usually) see it on my phone in under a minute and i have it configured to only run on wifi or wireguard.

I don't use OneDrive so I cant comment on this things quality but a quick search did pull up this reasonably active linux client https://github.com/abraunegg/onedrive

Mr. Crow fucked around with this message at 05:11 on Jul 4, 2022

jaegerx
Sep 10, 2012

Maybe this post will get me on your ignore list!


You are overthinking this /boot and / everything else.

BlankSystemDaemon
Mar 13, 2009



CaptainSarcastic posted:

I might have bad luck or be in a place with bad routing, but I sometimes have the OpenSUSE repos just crawl, and the last year or two Packman has had issues with mirrors and connectivity.
There's a reason why FreeBSD is looking to try and get package mirrors onto the big CDNs; there's enough route fuckery on the internet that sometimes it's possible to have them be utterly unavailable.
This despite the fact that FreeBSD already has a CDN-like setup with servers in Japan, United Kingdom, Brazil, South Africa, Malaysia, multiple places in USA, Australia, and Taiwan.

BattleMaster posted:

So for mount locations, my thoughts are as follows and I'm wondering how "standard" this is (though I understand you can just put anything anywhere if you want):

Root: Lots of stuff can get mounted in root if you want to put it on another drive or partition to give it dedicated space or make it easier to migrate to a new install. /var and /home seem most common for those reasons. /usr seems less likely to be mounted elsewhere nowadays but /opt and /usr/local are candidates if you install a lot of non-distro-managed stuff. /srv if it has its own drive or the system is serving content from a network location (webserver running on multiple machines serving content from a fileserver?).

The old rationale for giving /boot its own small partition at the start of the drive seems to no longer be valid on 2000s and later hardware but I think UEFI insists on a separate /boot? Maybe a separate /boot if you have multiple Linux installs?

/media: Removable stuff - optical, USB, whatever. Some programs like pmount or various file browsers will automatically create mount points here when you need them, so you don't necessarily need fstab entries or existing mount points for this stuff.

/mnt: Non-removable storage and network locations that do not need to be mounted elsewhere. I mount those things here and put symlinks in my home directory or desktop or wherever for convenience.

You can get more specific than those (/srv/www and /srv/ftp or whatever each having their own drives for instance) but I'm wondering if you want to start looking into RAID at that point?
I assume you've heard of hier(7)? It ought to describe it in detail.

Ultimately though, as RFC2324 hints at, you can put things where you like on a local installation - hier(7) mostly describes how the distribution is laid out and how it thinks you should separate things when you're adding to the distibution (do people still call this slipstreaming?), but you do you.

VostokProgram posted:

/boot needs to be FAT32 because of EFI

Imo, on a modern system there's basically no need to separately mount any of the other standard directories under / for a desktop, except for maybe /home if you really want to (or your home is on NFS or whatever)
According to the UEFI specification, the EFI System Partition should be FAT12, FAT16 or FAT32 - but a non-trivial amount of UEFI implementations will straight up poo poo themselves if the ESP isn't FAT32. It's great :allears:

Speaking of NFS, /net for autofs(5) based ease of access is neat.
Just cd /net/freebsdisos and it's automatically available if I'm on my home network, and if not it stops trying after a few tries - and if I forget to unmount before disconnecting (although it'll also disconnect if idle for long enough), umount -N comes in handy.

BlankSystemDaemon fucked around with this message at 06:57 on Jul 4, 2022

RFC2324
Jun 7, 2012

http 418

Autohome is my best friend that I never get to set up because ldap isn't lightweight

BattleMaster
Aug 14, 2000

Hier is fuzzy about why /mnt is different from /media (it says /mnt is for temporary mounts but removable media seems like the definition of temporary) and offers no guidance on what reason you may want to mount things in places other than /mnt and /media so I was fishing for opinions on those things.

Mount poo poo wherever you want is also a valid opinion but I am interested in how the standard directory structure gets used with lots of mounts.

Edit: or weird poo poo that people do, that also interests me. Like why put mounts under /home?

BattleMaster fucked around with this message at 07:30 on Jul 4, 2022

BlankSystemDaemon
Mar 13, 2009



BattleMaster posted:

Hier is fuzzy about why /mnt is different from /media (it says /mnt is for temporary mounts but removable media seems like the definition of temporary) and offers no guidance on what reason you may want to mount things in places other than /mnt and /media so I was fishing for opinions on those things.

Mount poo poo wherever you want is also a valid opinion but I am interested in how the standard directory structure gets used with lots of mounts.

Edit: or weird poo poo that people do, that also interests me. Like why put mounts under /home?
This is partially based on FreeBSDs hier(7), but I believe the difference between /media and /mnt is that the first is for removable media that's automatically mounted, whereas the latter is for the system admin to do maintenance tasks in.

Mr. Crow
May 22, 2008

Snap City mayor for life

BattleMaster posted:

Edit: or weird poo poo that people do, that also interests me. Like why put mounts under /home?

The arguments for multiple mounts is, among others, you can keep your data separate from your OS (/) install. This makes switching distros or clean installing stuff super simple. Also I encrypt my home directory so i don't have some of the annoyances of going full disk encryption on root (e.g. i can reboot and walk away, and have a login prompt when i get back).

Truga
May 4, 2014
Lipstick Apathy
heh where i live most distro repos are hosted by the national education network, so regardless of my bandwidth apt downloads tend to max out. i think the only outliers are the enterprise linuxes, but there's plenty of very fast german mirrors for that. i've not used an offline linux installer since probably the slackware cds

also, having a separate /home is nice if your distro somehow fucks up upgrades. in my ~15 years of using mainly debian at various jobs i've only had 1 incident of upgrades not working cleanly, but the possibility is still there so i generally have a separate /home so in case of upgrade failure i can just quickly reinstall and be back on my desktop in 10 minutes

BattleMaster
Aug 14, 2000

Mr. Crow posted:

The arguments for multiple mounts is, among others, you can keep your data separate from your OS (/) install. This makes switching distros or clean installing stuff super simple. Also I encrypt my home directory so i don't have some of the annoyances of going full disk encryption on root (e.g. i can reboot and walk away, and have a login prompt when i get back).

I get that and I covered that in my larger post a little earlier (though I didn't think about encryption) but this response to you:

Klyith posted:

oh man I didn't think about putting things directly in /home rather than in the ~ user folder. I like that. No problem with making additional folders in home that aren't user accounts?

made me think that there was like /home/myuser and /home/mymount for some reason. I'd definitely be interested in why one would do that.

I don't think that mounting /home itself to another drive or partition is particularly weird and is probably one of the most common things to do if you don't just slam everything into one partition.

BattleMaster fucked around with this message at 09:36 on Jul 4, 2022

Saukkis
May 16, 2003

Unless I'm on the inside curve pointing straight at oncoming traffic the high beams stay on and I laugh at your puny protest flashes.
I am Most Important Man. Most Important Man in the World.

BattleMaster posted:

/usr seems less likely to be mounted elsewhere nowadays but /opt and /usr/local are candidates if you install a lot of non-distro-managed stuff.

The old rationale for giving /boot its own small partition at the start of the drive seems to no longer be valid on 2000s and later hardware but I think UEFI insists on a separate /boot? Maybe a separate /boot if you have multiple Linux installs?

Separate /usr isn't really supported nowadays since /bin and /sbin are often symlinks to /usr/(s)bin/.

We use separate /boot on servers at work because everything else is on LVM.


VostokProgram posted:

/boot needs to be FAT32 because of EFI

/boot can be a Linux FS if /boot/efi is FAT.


BattleMaster posted:

made me think that there was like /home/myuser and /home/mymount for some reason. I'd definitely be interested in why one would do that.

I assumed they were talking about the case of mounts under /home/myuser/, it can be convenient if you are the only user on the machine.

Kivi
Aug 1, 2006
I care

Truga posted:

firstly, on my postgresql boxes ram usage never goes beyond about 4 GB, and even those are big outliers that'd probably be better served by some other db, and i'm just being stubborn about consistency. most stay below 1-2GB and have the vast majority of ram filled by linux cache, with only 2-4gb actually free ram that stays free because it's regularly used by complex queries or other temporary processes

postgres works as well as it does primarily by efficiently abusing the linux cache system. this is reinforced in postgresql docs, telling you to use fairly low numbers for most memory size settings and increase the effective cache size value outside very specific workloads, to let the postgresql query planner decide what's what and lean on system cache as much as possible


as for your actual issue, i'm 99% sure you're hitting the pg_dump hard memory limit of 1gb for data somewhere in your dump, which can cause problems with deceptively small fields that have binary data in them. pg_dump tries to convert it into text (escaped hex iirc, it's been a while) for the dump file, hitting you with an out of memory error real quick because ascii text is much less space efficient than binary data, i think a 200mb bytea field is already too large

you can temporarily work around this by using pg_dumpbinary, though i'm not sure if that has its own pitfalls somewhere, as the docs insist you only use it if pg_dump fails. i haven't had issues with it personally, but i've also complained to our devs when pg_dump failed until they fixed the fields in the db, so i've only ever used it very temporarily
Yeah, that makes tons of sense. I reached to our DBA guys and they suggested that I use dblink and copy over the large objects with that, and do rest with regular pg_dump / pg_restore process. It seems straightforward enough.

Truga posted:

incidentally, how have you been backing up your database so far? :v:
With this https://www.postgresql.org/docs/10/continuous-archiving.html

Last month we had to do restore from production to non-production so it's sort of tried and tested too! :v:

Klyith
Aug 3, 2007

GBS Pledge Week

BattleMaster posted:

made me think that there was like /home/myuser and /home/mymount for some reason. I'd definitely be interested in why one would do that.

I don't think that mounting /home itself to another drive or partition is particularly weird and is probably one of the most common things to do if you don't just slam everything into one partition.

Yeah I already have /home on a separate partition because I wasn't sure if I'd switch distro at some point and I'd seen how that makes it easier. (I'm sure it's also possible with the btrfs subvolume thing that most distros are defaulting to.)

As for why I like the sound of /home/mydrive -- no reason of any importance or functionality. I didn't want to mount them inside my user folder itself for clutter management, but in /home keeps everything together in one area. Also for the super petty reason that I find '/mnt' annoying to type. I'm having to do a lot of console file management due to a kde / dolphin bug where moving files using the GUI across volumes causes runaway memory.

ExcessBLarg!
Sep 1, 2001

BattleMaster posted:

Heir is fuzzy about why /mnt is different from /media (it says /mnt is for temporary mounts but removable media seems like the definition of temporary) and offers no guidance on what reason you may want to mount things in places other than /mnt and /media so I was fishing for opinions on those things.
/media is for actual physical media mounts (cdrom, USB, etc.) and often automounted.

/mnt is for filesystems you might manually mount that don't belong elsewhere, like loopback volumes or LVs (if you don't keep them permanently mounted).

Saukkis posted:

Separate /usr isn't really supported nowadays since /bin and /sbin are often symlinks to /usr/(s)bin/.
With the right initrd, some Linux distros explicitly support mounting /usr as read-only. Bootstrapping /bin and /sbin is done by the initrd mounting /usr before calling pivot_root.

Saukkis
May 16, 2003

Unless I'm on the inside curve pointing straight at oncoming traffic the high beams stay on and I laugh at your puny protest flashes.
I am Most Important Man. Most Important Man in the World.

ExcessBLarg! posted:

With the right initrd, some Linux distros explicitly support mounting /usr as read-only. Bootstrapping /bin and /sbin is done by the initrd mounting /usr before calling pivot_root.

Probably not worth the effort except in edge cases. Main use for separating mounts is to mitigate problems against excessive space usage and unexpected growth. /usr is quite stable in that regard and pretty much only grows during installs.

Adbot
ADBOT LOVES YOU

RFC2324
Jun 7, 2012

http 418

Saukkis posted:

Probably not worth the effort except in edge cases. Main use for separating mounts is to mitigate problems against excessive space usage and unexpected growth. /usr is quite stable in that regard and pretty much only grows during installs.

you mount it as ro on a production box to reduce the chance of something there getting compromised.

I can also see doing it with an nfs share, depending on whats happening on the box, but that feels like a pxe boot environment with more steps

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply