You are not logged in.

#1 2014-11-24 18:05:18

captaincurrie
Member
From: /dev/random
Registered: 2013-11-01
Posts: 82

Utilizing the filesystem

Hello,

Since i began using linux, i've been sort of 'scared' to utilize parts of the filesystem outside my $HOME directory.

But now that i'm more mature, i want to 'spead out' a little more.

For example, instead of keeping all my media (music, videos) in my $HOME directory, i think i want to have it in some seperate partiton under
/data, and then restrict usage of it to the group 'data'.

Anyways, the point is, i want to 'spead out' and i was wondering if anyone had any tips, good books/articles, success stories, personal-growth stories,
about using the entire filesystem for a Personal Linux Computer.

For example, do you use /etc to hold all your program configurations or do you restrict yourself to per-user configs under $HOME?

Note: UNIX was made for multi-programming, multiple people using the same computer. Now that many of us have our own personal computers,
the organization of the filesystem, to me, doesn't really reflect this change in usage.

Thanks

Offline

#2 2014-11-24 18:28:58

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Utilizing the filesystem

You should see how to arrange you partitions and then how to mount your partition for a particular mask, which will comply with you user group.


do it good first, it will be faster than do it twice the saint wink

Offline

#3 2014-11-24 18:56:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Utilizing the filesystem

What are you trying to accomplish?

Offline

#4 2014-11-24 19:25:15

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Utilizing the filesystem

As far as I understood, OP wants a partition to store multimedia files, with a particular private permissions for the group data


do it good first, it will be faster than do it twice the saint wink

Offline

#5 2014-11-24 19:35:20

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Utilizing the filesystem

But why? What is so unsafe about the current setup and what exactly the separate partition and user group will offer?
This is a single machine used by just one person. Is it 'just because I can' setup?

Offline

#6 2014-11-24 20:07:05

captaincurrie
Member
From: /dev/random
Registered: 2013-11-01
Posts: 82

Re: Utilizing the filesystem

I just feel like i should organize my files more generally by using the entire filesystem and not just my $HOME directory. I mean, For Example, why bother putting all your config files under
your home directory when only one person uses your machine. Why not just use /etc for all your config.

My question has nothing to do with any particular setup, i'm asking if anyone has a general philosophy for using the filesystem.

I seek wisdom... tongue

Offline

#7 2014-11-24 20:18:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Utilizing the filesystem

captaincurrie wrote:

For Example, why bother putting all your config files under your home directory when only one person uses your machine. Why not just use /etc for all your config.

Because the files in /etc are owned by the respective packages so they'll get overwritten on update or your edits will result in  creation of .pacsave files.

Offline

#8 2014-11-24 20:22:22

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: Utilizing the filesystem

.pacsave files are not a bad thing. They tell you when the default configuration has changed and you should look at how your changes fit in.

Offline

#9 2014-11-26 04:52:33

lucasam
Member
Registered: 2014-09-25
Posts: 2

Re: Utilizing the filesystem

A convenient aspect of keeping data-like files (i.e. media files) on a separate partition: if one decides to reinstall the OS from scratch, including the home directory, it is easy to do the reinstall without touching the data-like files. Such files can also easily be shared between several OS on the same machine.

Offline

#10 2014-11-26 04:58:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: Utilizing the filesystem

All those points support having said media on a separate partition, but that says nothing about where that partition should be mounted.  Mounting a data partition within $HOME will make it much easier to access and modify without having to manage various permissions, ownerships, or umasks.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2014-11-26 06:43:22

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Utilizing the filesystem

Trilby wrote:

Mounting a data partition within $HOME will make it much easier to access and modify without having to manage various permissions, ownerships, or umasks.

For my own curiosity, mounting NTFS partition would apply this theory?
Ehm, what aboult ACLs?


do it good first, it will be faster than do it twice the saint wink

Offline

#12 2014-11-26 07:08:37

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Utilizing the filesystem

NTFS doesn't understand UNIX permissions.
Why do you want to use ACLs on a single-user personal computer? Apart from learning experience, not sure about the benefits.

Offline

#13 2014-11-26 08:34:13

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Utilizing the filesystem

Thanks, Karol. I learned something new.


do it good first, it will be faster than do it twice the saint wink

Offline

#14 2014-11-26 10:04:34

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Utilizing the filesystem

Leaving aside the separate-partition-for-data thing, where is this urge to "spead out" coming from? Are you assuming that doing all user-level stuff in $HOME is somehow not right? You say you want to "spead out", but you don't say why.

Offline

#15 2014-11-26 10:09:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Utilizing the filesystem

I think OP tried to answer these questions in https://bbs.archlinux.org/viewtopic.php … 2#p1478792

Offline

#16 2014-11-26 11:18:09

captaincurrie
Member
From: /dev/random
Registered: 2013-11-01
Posts: 82

Re: Utilizing the filesystem

tomk wrote:

Leaving aside the separate-partition-for-data thing, where is this urge to "spead out" coming from? Are you assuming that doing all user-level stuff in $HOME is somehow not right? You say you want to "spead out", but you don't say why.

I'm glad you said that.

I think its a natural feeling. I mean, UNIX was made for multi-programming, multiple users. But there is noone else using my computer!
The stuff above my $HOME directory is for a super user to manage multiple users. But i am the only user. Seems strange to me...So i'm managing myself?

I mean, you could use /root as your home directory, /etc as your config directory, /data as your data directory, .... spead out.
But peope will say this is unsafe, and they are probably right.

Just wanted to know if people felt the same way at any time, and where they went from there...

Offline

#17 2014-11-26 11:31:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Utilizing the filesystem

Running applications as root is seldom necessary and is unsafe to set is as a default.

The filesystems, partitions, mountpoints etc. choices stem from your needs: do you want a versioning filesystem for a portion of your data (e.g. configs and documents) and do you want to handle your multimedia files in a different manner? Do you have to share some data with computers using Windows?

Offline

#18 2014-11-26 11:43:51

chaonaut
Member
From: Kyiv, Ukraine
Registered: 2014-02-05
Posts: 382

Re: Utilizing the filesystem

on my laptop, i have a single ext4-formatted home partition with /home/private/chaonaut for my private stuff & /home/share for stuff like media files that can be easily shared (via samba etc) when i want.

root partition is btrfs-formatted since i build everything from source, so i use snapshot feature heavily.

/var/cache (where build process happens) is a separate partition formatted with ext4 with no journaling.

TheSaint wrote:
Trilby wrote:

Mounting a data partition within $HOME will make it much easier to access and modify without having to manage various permissions, ownerships, or umasks.

For my own curiosity, mounting NTFS partition would apply this theory?
Ehm, what aboult ACLs?

yes, if usermaps for NTFS are properly generated.
some time ago, i lived for a while on a dual boot laptop with truecrypted ntfs partition shared between linux & windoze for data storage (disk D: in windoze, /home in linux).
anyway, ntfs is sloooooow since IO is done via fuse.
but it works.
the greatest downside of that setup was the fact that sometimes it couldn't be fsck'd without windoze.

karol wrote:

NTFS doesn't understand UNIX permissions.

actually, ntfs-3g does handle unix permission when usermaps are generated.


— love is the law, love under wheel, — said aleister crowley and typed in his terminal:
usermod -a -G wheel love

Offline

#19 2014-11-26 12:52:13

captaincurrie
Member
From: /dev/random
Registered: 2013-11-01
Posts: 82

Re: Utilizing the filesystem

karol wrote:

Running applications as root is seldom necessary and is unsafe to set is as a default.

The filesystems, partitions, mountpoints etc. choices stem from your needs: do you want a versioning filesystem for a portion of your data (e.g. configs and documents) and do you want to handle your multimedia files in a different manner? Do you have to share some data with computers using Windows?

You could have a seperate user which you run programs under and you could do it in a way so that you don't need to switch users. Not sure how to
do that, but that would be pretty cool.

I mean, thats what you are protecting yourself from by creating a user for yourself. Running programs as root.
So if you could have it so that you were logged in as root, but you had a set of permissions defined for each 'class' of program and they run under those permissions.

How would do that?

Last edited by captaincurrie (2014-11-26 12:52:46)

Offline

#20 2014-11-26 12:57:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Utilizing the filesystem

What default permissions do you want to change?

Offline

#21 2014-11-26 13:05:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: Utilizing the filesystem

captaincurrie wrote:

You could have a seperate user which you run programs under and you could do it in a way so that you don't need to switch users

The first part of this is exactly how it is now.  The second part doesn't make any sense.  Do you expect the computer to read your mind about when you'd want to run a program as root without telling it?  You can get away without entering passwords, just configure sudo for nopassword (not suggesting this, but if you are *sure* you're the only one to ever touch your computer and sure you'll never screw up, it's an option).

In an earlier post you said you are the only user, so it is like you are managing yourself.  But most of the time it is not that you need to manage yourself, you need to manage subprocesses.  You want to run a web browser, but then that web browser spawns dozens of subprocesses - some of them executing arbitrary scripts from any random website.  Do you not want to manage/restric what that code does?

The only way you'd really only be managing yourself is if you wrote *all* code that was ever to be executed on your machine ... in assembly.  Short of that, it is not about managing user accounts, but about managing the permissions granted  to code that is executing.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#22 2014-11-26 15:20:43

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Utilizing the filesystem

captaincurrie wrote:
tomk wrote:

Leaving aside the separate-partition-for-data thing, where is this urge to "spead out" coming from? Are you assuming that doing all user-level stuff in $HOME is somehow not right? You say you want to "spead out", but you don't say why.

I'm glad you said that.

I think its a natural feeling. I mean, UNIX was made for multi-programming, multiple users. But there is noone else using my computer!
The stuff above my $HOME directory is for a super user to manage multiple users. But i am the only user. Seems strange to me...So i'm managing myself?

I mean, you could use /root as your home directory, /etc as your config directory, /data as your data directory, .... spead out.
But peope will say this is unsafe, and they are probably right.

Just wanted to know if people felt the same way at any time, and where they went from there...

You should really read up on the Filesystem Hierarchy Standard, and read the 'hier' manpage. Those upper-tier directories are all intended to serve particular puposes. Storing photos of Grandma's 75th birthday aren't one of them.

This topic seems to come up every once in a while---"Why am I only working in one folder? That's weird. I'm-a run as root all the time" Well, that's how the system was designed; it's a separation of data between that which you make use of for your purposes and that which the system makes use of for its own. Directories outside /home/$USER can  be freely, automatically modified by system processes without any input from you, while $HOME can only be altered at the user's behest. That "one folder" is where most of the data on the disk is stored anyway, and the plain reality is that this is how every popular operating system works. Ever seen the AppData and UserData folders on Windows? The Home, System, Library and so on folders on OS X?

Offline

#23 2014-11-26 15:43:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Utilizing the filesystem

ANOKNUSA wrote:

You should really read up on the Filesystem Hierarchy Standard, and read the 'hier' manpage.

Just FYI: https://bugs.archlinux.org/task/42864

Offline

Board footer

Powered by FluxBB