36
votes
Accepted
Change permisions of a file with my cat's help
There are several possibilities, all depending on the exact parameters of your situation right now. I'm going to assume Linux in the following examples where applicable, but similar functionality ...
15
votes
Mount root filesystem from initramfs
exec switch_root /mnt/root /sbin/init
https://wiki.gentoo.org/wiki/Custom_Initramfs#Init
13
votes
How to change the casefold ext4 filesystem option of the root partition, if I only have ssh access
Thanks to @Marcus Müller I was able to do it. The trick is to add tune2fs into the initrd image and to call it during boot.
Create the script for initramfs-utils:
cat > /usr/share/initramfs-tools/...
11
votes
Accepted
How to programattically determine the device name/basename of the root partition?
Mount point is controlled by systemd.
You can list the systemd mount unit files through:
systemctl list-units --type=mount --all
sample output:
-.mount loaded active ...
10
votes
How does linux know where the rootfs is?
First of all, don't be scared by the references to "2.6" in the kernel docs. The current kernels are still members of the "2.6" line, but they went through two rounds of renumbering just for "...
10
votes
Accepted
How to change the casefold ext4 filesystem option of the root partition, if I only have ssh access
I like your approach; it's clean in that it doesn't require modification of the data on your main system.
And, yes, I think that if you want to run tune2fs then by a large margin, the easiest solution ...
9
votes
Mount root filesystem from initramfs
It depends on the kind of problem, if the problem was borking the initramfs image itself then you'll need to actually regenerate it (run update-initramfs) to fix things. Remember the initramfs file ...
8
votes
Accepted
Where should I put my source code?
If you’re installing the software in /usr/local, I would use /usr/local/src — that’s the local variant of /usr/src, of which the FHS says
Source code may be placed in this subdirectory, only for ...
8
votes
Accepted
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block(0,0)
The error message hd0,X not found comes from GRUB, and indicates GRUB configuration file has an error, pointing to a partition that either does not exist or is not readable by GRUB.
The titular error ...
7
votes
Accepted
Rollback root snapshot in BTRFS
What you have is a BTRFS filesystem with two subvolumes:
fedora - This is set as your default subvolume, and is what you see when you mount the filesystem without specifying specifying a subvolume. ...
6
votes
Why use relative symlinks in the root directory?
One advantage of relative symlinks, even in the root directory, is that they produce the expected result even when the file system is mounted elsewhere. This can be useful when repairing a system, or ...
6
votes
How to programattically determine the device name/basename of the root partition?
Here's a Linux answer that doesn't rely on systemd (requires /sys mounted for lsblk use and also the jq command to parse results).
Knowing that lsblk already includes all the logic to figure out the ...
5
votes
Using a different directory than /usr as standard
It may be that Endless OS is not the right tool to be able to accomplish what you want. From the Endless OS Developer page,
Endless OS
Not your typical Linux distribution. We don’t use rpm, apt, or ...
5
votes
Accepted
What are limitations chrooted system?
Functionally, nothing. Literally all that the chroot() call does is update where the kernel anchors path resolution for your process. In particular, unless you also drop root privileges, you can ...
5
votes
Accepted
Why is there no rootfs file system present on my system?
On old systems, mount may disagree with /proc/mounts
Most of the time you won't see rootfs in /proc/mounts, but it is still mounted.
Can we prove that rootfs is still mounted?
1. On old systems, mount ...
5
votes
How is /etc/fstab accessed before root is mounted?
An entry in fstab is needed, if you want to specify some non-default mount options. However, nowadays with systemd, a correct kernel device and fstype in fstab are unncesessary. You can replace the ...
5
votes
Running QEMU with a root file system directory instead of disk image
If your rootfs is not too big you can use an initd. Use the -initrd option to qemu and provide a (compressed) cpio file with the rootfs. So if you have a tar file you must unpack it and create a cpio ...
5
votes
Is it accurate to say that the Linux partition is "mounted" to the "/" directory?
The root filesystem is a bit of a special case, as it is typically mounted by initramfs/initrd (in most major distributions) or the kernel (with no-initramfs kernel configurations, similar to how ...
5
votes
root filesystem not listed when executing mount
The mount command only shows you whatever is listed in /etc/mtab. If you want to see all the mounts, you can do cat /proc/mounts. You can mount something without having it recorded in /etc/mtab by ...
5
votes
Accepted
What does ' sudo rm -rf /* ' do?
sudo rm -rf /* (-r means to remove directories and their contents recursively and -f to ignore nonexistent files and arguments and never prompt for confirmation and /* just expands to everything in /) ...
5
votes
Accepted
LUKS - How can / be encrypted but /boot and /boot/efi are not?
The devices (partitions) that / and /boot reside on are different,
and one can be encrypted while the other is not.
GRUB knows how to find /boot by using something like set root=(hd0,1) or search --...
5
votes
Accepted
A process called "Opera" (the browser is not installed) constantly uses 100% of my CPU. Does anyone know what this is?
According to https://www.cadosecurity.com/blog/tracking-diicot-an-emerging-romanian-threat-actor, the file .b4nd1d0 is created by a crypto-mining malware named diicot. Perhaps that is the reason that ...
5
votes
How to create partitions on a volume with the root filesystem mounted on the enitre disk
with only one disk
You have to
(create a snapshot of the virtual disk – in case things go south...)
boot from a different volume
reduce the filesystem size
copy the content of the reduced filesystem ...
4
votes
Accepted
Buildroot generate rootfs with gcc
it seems that's buildroot's decision to not to include a compiler in target file system. They aim to reduce image size and see compilation on target as useless.
find more details in their ...
4
votes
Where does kernel define the SD card naming index?
This seems to be the kernel code responsible for making sense of root=/dev/mmcblk0p2.
Given that no initramfs is present, there is no udev daemon running to name the devices and /dev/mmcblk1 doesn't ...
Community wiki
4
votes
Accepted
Building Kernel Image for Embedded Linux Platform
Building embedded linux is an extremely broad yet very arcane topic, not sure if it has a good fit in either the EE.SE or the Unix/Linux.SE site.
Some of the books that address your questions can be ...
4
votes
Accepted
Why Am I able to edit /etc/resolv.conf on a read only file system?
However, I see that I am still able to change the contents of file /etc/resolv.conf How is that possible?
It's either a symbolic link to a tmpfs filesystem mounted e.g. in /run or /var or you're ...
3
votes
Accepted
Pass root file system by label to linux kernel
The problem is that LABEL and UUID handling is not done by the Linux Kernel but is done via an initramfs, which you would need to provide as well. If you want to bypass that you need to use PARTUUID ...
3
votes
Accepted
Which filesystem should I use in an SD card on a NAS?
Here is the info I was able to find online.
https://en.wikipedia.org/wiki/Flash_file_system#Linux_flash_filesystems mentions JFFS, JFFS2, YAFFS, UBIFS, LogFS, F2FS. Some of these (but not F2FS) are ...
3
votes
Accepted
When can Linux boot with a Read-Only Root Filesystem
At boot, you are supposed to check your filesystems to see if the system was shut down properly or if it crashed, and perform the necessary recovery actions in the latter case. On modern journaled ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
root-filesystem × 290linux × 65
filesystems × 48
mount × 37
boot × 29
partition × 24
linux-kernel × 21
initramfs × 19
debian × 16
kernel × 16
ubuntu × 15
readonly × 15
lvm × 13
embedded × 13
root × 11
nfs × 11
buildroot × 10
centos × 9
arch-linux × 9
disk-usage × 9
fstab × 8
btrfs × 8
chroot × 8
systemd × 7
permissions × 7