this post was submitted on 09 Apr 2024
314 points (98.8% liked)

Linux

48878 readers
939 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I thought I'll make this thread for all of you out there who have questions but are afraid to ask them. This is your chance!

I'll try my best to answer any questions here, but I hope others in the community will contribute too!

(page 4) 50 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 9 months ago (2 children)

How do programs that measure available space like 'lsblk', 'df', 'zfs list' etc see hardlinks and estimate disk space.

If I am trying to manage disk space, does the file system correctly display disk space (for example a zfs list)? Or does it think that I have duplicate files/directories because it can't tell what is a hardlink?

Also, during move operations, zfs dataset migrations, etc... does the hardlinked file continue tracking where the original is? I know it is almost impossible at a system level to discern which is the original.

[–] [email protected] 4 points 9 months ago* (last edited 9 months ago) (1 children)

I'm not super familiar with ZFS so I can't elaborate much on those bits, but hardlinks are just pointers to the same inode number (which is a filesystem's internal identifier for every file). The concept of a hardlink is a file-level concept basically. Commands like lsblk, df etc work on a filesystem level - they don't know or care about the individual files/links etc, instead, they work based off the metadata reported directly by the filesystem. So hardlinks or not, it makes no difference to them.

Now this is contrary to how tools like du, ncdu etc work - they work by traversing thru the directories and adding up the actual sizes of the files. du in particular is clever about it - if one or more hardlinks to a file exists in the same folder, then it's smart enough to count it only once. Other file-level programs may or may not take this into account, so you'll have to verify their behavior.

As for move operations, it depends largely on whether the move is within the same filesystem or across filesystems, and the tools or commands used to perform the move.

When a file or directory is moved within the same filesystem, it generally doesn't affect hardlinks in a significant way. The inode remains the same, as do the data blocks on the disk. Only the directory entries pointing to the inode are updated. This means if you move a file that has hardlinks pointing to it within the same filesystem, all the links still point to the same inode, and hence, to the same content. The move operation does not affect the integrity or the accessibility of the hardlinks.

Moving files or directories across different filesystems (including external storage) behaves differently, because each filesystem has its own set of inodes.

  • The move operation in this scenario is effectively a copy followed by a delete. The file is copied to the target filesystem, which assigns it a new inode, and then the original file is deleted from the source filesystem.

  • If the file had hardlinks within the original filesystem, these links are not copied to the new filesystem. Instead, they remain as separate entities pointing to the now-deleted file's original content (until it's actually deleted). This means that after the move, the hardlinks in the original filesystem still point to the content that was there before the move, but there's no link between these and the newly copied file in the new filesystem.

I believe hardlinks shouldn't affect zfs migrations as well, since it should preserve the inode and object ID information, as per my understanding.

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 4 points 9 months ago (3 children)

Someone gifted me with some old iPad that's more than 10 years old. What steps should I take to install Linux on the iPad?

load more comments (3 replies)
[–] [email protected] 3 points 9 months ago (6 children)

@cyclohexane Is there any risk for me to try installing Linux on my MacBook (intel) and are there specific distros that run better on a macbook?

[–] [email protected] 3 points 9 months ago

Check compatibility first. Some of em need a binary blob network driver that certain distros don’t ship by default. But yeah you can run Linux on Macs pretty good. What mb do you have and I can give better input?

load more comments (5 replies)
[–] [email protected] 3 points 9 months ago (4 children)

This is the dumbest question ever, but here goes: I'm trying to use pika to make regular backups of my whole system to my synology Nas. So I'd choose "remote", but no matter what I enter after the SMB it doesn't take it. How do I back up to my synology Nas using pika? I like pika because the UI is fucking stupid simple, except this one little nugget.

load more comments (4 replies)
[–] [email protected] 3 points 9 months ago (10 children)

I have windows PC with 6 drives, mostly SSD and on HDD that I assume are all NTFS. Two of the drives are nvme(?) attached to the mobo, and I only have one mobo with nvme slots. I have a number of older boards that top out at SATA connections.

If I install Linux Mint, can I format one nvme drive with whatever the current preferred linux formatting is, install Mint, and move the files from the other drives around as I format each one?

Or do I need to move all the data I want to keep to SATA drives, put them in a different windows box, and then copy them over using a network connection?

It's been a while and I'm guessing my lack of finding an answer means linux still doesn't work with NTFS enough to do what I'm thinking of.

[–] [email protected] 4 points 9 months ago

I was read/writing on NTFS partitions back in 2004, so your information that Linux doesn't work with NTFS is at least 20 years old.

load more comments (9 replies)
[–] [email protected] 3 points 9 months ago (6 children)

what is hyprland

why do ppl use the CLI for things like making and moving files? i find the GUI easier and faster as well as less prone to mistakes

what is wayland and xorg, and why does everyone argue about them

[–] [email protected] 3 points 9 months ago (1 children)

hyprland

A wayland compositor and tiling window manager. The lead developer of the project is a Polish transphobic workaholic.

why do ppl use the CLI for things like making and moving files? i find the GUI easier and faster as well as less prone to mistakes

If you understand how shell scripting works you can easily automate menial tasks. CLI is also an interface shared by all operating systems so if you know how to work around in a shell you're not bound to any particular workflow/desktop GUI. Keep using GUIs though, they exist for a reason.

what is wayland and xorg, and why does everyone argue about them

Both are display protocols that are in charge of displaying graphics to your screen. Xorg is over 30 years old while wayland is only about 15 years old. The polemic about xorg was that the codebase was unmanageable and the design architecture of the program was inherently flawed (example: screenlocker getting access to your entire screen including apps and desktop, making writing malware for x11 a 3 line python script). X11 was designed during a time when people were using actual real life terminals and mainframes. Wayland is much more modern and akin to how modern graphics APIs are handled (for the most part)

Wayland at its core has and always will be design by committee so a lot of the arguing is necessary (though sometimes long-winded) to make sure to not repeat xorg's mistakes. Protocols take months if not years to be merged into wayland and those protocols have to be implemented by wayland compositors themselves rather than sharing 1 program altogether like with xorg.

Watch this video for more information, explains it much better and is from an actual wayland board member.

Why YOU should write a Wayland compositor – Victoria Brekenfeld – HiP22 Berlin

load more comments (1 replies)
load more comments (5 replies)
load more comments
view more: ‹ prev next ›