Hot answers tagged

18

That entirely depends on what services you want to have on your device. Programs You can make Linux boot directly into a shell. It isn't very useful in production — who'd just want to have a shell sitting there — but it's useful as an intervention mechanism when you have an interactive bootloader: pass init=/bin/sh to the kernel command line. All Linux ...


9

First of all the hassle with encrypted root and early userspace is typically already handled by your distribution (as far as i know Fedora, Debian, Ubuntu and OpenSUSE support encrypted root out of the box). That means you don't have to care for the setup itself. One reason for encrypting / is just to be sure you don't leak any information at all. Think ...


8

/etc, /var, and /tmp come to mind. All can potentially have sensitive contents. All can be given separate volumes, but it's common for each of these to be on the same filesystem as the root directory. Maybe you've moved one or more off into their own volumes, but have you moved them all? /etc contains: hashed passwords; possibly multiple sorts, such as ...


8

Different modules behave differently when you provide the same option multiple times. I know you can say console= multiple times, and you get multiple consoles (we use it for machines with main consoles on both their framebuffers and serial port). However, you can only have one root partition, so root= almost certainly overwrites the previous value seen, ...


8

New answer (2015-03-22) (Note: This answer is simpler than previous, but not more secure. My first answer is stronger because you could keep files read-only by fs mount options before permission flags. So forcing to write a files without permission to write won't work at all.) Yes, under Debian, there is a package: fsprotect (homepage). It use aufs (by ...


7

When the boot loader calls the kernel it passes it a parameter called root. So once the kernel finished initializing it will continue by mounting the given root partition to / and then calling /sbin/init (unless this has been overriden by other parameters). Then the init process starts the rest of the system by loading all services that are defined to be ...


7

Mounting or remounting a filesystem is done using the mount(2) syscall. When remounting, this takes the target location (the mountpoint), the flags to be used in the mount operation, and any extra data used for the specific filesystem involved. When remounting read-only, the flags used are MS_RDONLY and MS_REMOUNT; you're also supposed to provide any other ...


6

OK, I tried it. First two problems from the beginning: NO support for hard and symbolic links. It means that I had to copy each file, duplicating it and wasting space. Second problem: no special file support at all. This means things like /dev/console are unavailable at boot time to init before even /dev is remounted as tmpfs. Third problem: you will ...


6

SquashFS is a read-only file system. https://en.wikipedia.org/wiki/SquashFS You could create a new filesystem and copy the contents of the squashfs to that. To do that, you need to: Backup your data from the old filesystem Start from a Live-CD/USB Make a new Filesystem on /dev/mtdblock3 Copy your data to the new filesystem Instead of booting from a ...


6

It is given at boot time by your bootloader, for example Grub. To see with which arguments your kernel was started, do this: $ cat /proc/cmdline For me, this ouputs: BOOT_IMAGE=/vmlinuz-3.5.0-13-generic root=/dev/mapper/crypt-precise--root ro So the initrd/initramfs will try to mount my /dev/mapper/crypt-precise--root (encrypted LVM) logical volume as ...


5

You should be able to log in as root, because usually a percentage of the partition's size is reserved in order to always enable root login for rescue operations and such. See this U&L Q&A: Reserved space for root on a filesystem - why? What you won't be able to do, however, is log in as a regular user from your display manager then switch to root ...


5

/tmp can be considered as a typical directory in most cases. You can recreate it, give it to root (chown root:root /tmp) and set 1777 permissions on it so that everyone can use it (chmod 1777 /tmp). This operation will be even more important if your /tmp is on a separate partition (which makes it a mount point). By the way, since many programs rely on ...


5

It's pretty straight forward, although we should distinguish between "driver" and "module". A driver may or may not be a module. If it is not, then it is built into the kernel loaded by the bootloader. If it is a module, then it is in a filesystem hierarchy rooted at /lib/modules/[kernel-release].1 Note that it is possible to boot a kernel together with ...


4

As the kernel documentation states, /dev/nfs is not a real device but only a hint to the kernel to use NFS as rootfs. You'll also have to tell the kernel where to find this root through the nfsroot parameter or a properly set up DHCP daemon. For the latter one to work you'll also have to either configure your kernel to auto-configure its network ...


4

When you make any changes to filesystem in recovery root shell , you have to remount the partition with read write permissions, mount -o remount,rw / . Then you can proceed with changing permissions of root directory


4

This is a well known problem, currently without solution. On Debian (and other systems), systemd fails to assemble an encrypted BTRFS array, because of the parallel processes and various tests. All the volumes of a BTRFS array must be present for it to be mounted (properly), but as all the volumes of the BTRFS array have the same UUID (by design), systemd ...


4

Linux provide many partitioning tools to re-size or shrink the partition that also without any data loss,It is possible to resize a partition using Gparted in a easy and a convenient way.As its a opensource and free download. To modify the partition with Gparted, it has to be downloaded then burned into a blank CD. This CD will be used as a bootable CD in ...


3

Yes, see for instance how to boot a VM with the FS of the host: Add the 9p modules to the host initramfs (that's the easiest way albeit not the cleanest, to have an initrd with the needed modules): printf '%s\n' 9p 9pnet 9pnet_virtio | sudo tee -a /etc/initramfs-tools/modules sudo update-initramfs -u qemu -kernel "/boot/vmlinuz-$(uname -r)" \ -initrd ...


3

All you need is one statically linked executable, placed on the filesystem, in isolation. You do not need any other files. That executable is the init process. It can be busybox. That gives you a shell and a host of other utilities, all in itself. You can go to a fully functioning system just by executing commands manually in busybox to mount the root ...


3

If you have free disk space (Partition, LVM) then you can mount it at /opt. If not then you can move /opt to e.g. /usr/opt and create a symlink in the rootfs. Or you make a bind mount (via fstab): mount --bind /usr/opt /opt


3

I usually make my root partition sizes for some of the distributions I run around 40 GB and haven't gone less than 20GB. It really depends on the operating system, display/window manager, and intended use. My intended use is Geographic Information Systems so this can involve installing several extra packages often exceeding several GBs (10+) in disk space ...


3

you did not mention if you have a hardware RAID, or if you will be doing it in software via something like mdadm. my recommendation is stay away from software raid, which gets implemented during and after your system boots because it relies on the linux operating system to first be booted and running. Any power outages can cause file system corruption ...


3

The value in the superblock shown by tune2fs is the first inode number usable for new files, while the root directory must always exist when the file system is created. https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Special_inodes documents the inode numbers which are used internally by file systems features.


3

The options in fstab are supposed to be used to remount it, applying the options specified ( which may NOT include rw access ). A boot script that is hard coded to remount the root fs with rw without consulting fstab is broken. Thus, the only result of leaving it out of fstab is that it won't be remounted, and will remain ro with no other options applied.


3

The Archbang project don't have a central code repository, so it is difficult to establish what the current state is, however, it appears that there is an option in the Archbang ISO to bypass sections of the installer. This directory should have been removed in the script but, for whatever reason, in your case it failed to do that. You can remove the ...


3

If you do not need any shell utilities, a statically linked mksh binary (e.g. against klibc – 130K on Linux/i386) will do. You need a /linuxrc or /init or /sbin/init script that just calls mksh -l -T!/dev/tty1 in a loop: #!/bin/mksh while true; do /bin/mksh -l -T!/dev/tty1 done The -T!$tty option is a recent addition to mksh that tells it to spawn a ...


3

Here's an excerpt from your kernel logs: [194844.372691] ata1.00: exception Emask 0x0 SAct 0x700 SErr 0x0 action 0x0 [194844.372702] ata1.00: irq_stat 0x40000008 [194844.372710] ata1.00: failed command: READ FPDMA QUEUED [194844.372723] ata1.00: cmd 60/08:40:98:cc:96/00:00:0b:00:00/40 tag 8 ncq 4096 in [194844.372723] res ...


3

/media/ is a stub where most modern distributions mount removable media when they are plugged in, e. g. USB hard drives, optical media, flash drives, etc. One of them you have mounted is identified as HDD2-200GB which is appearing as a 12.5GB filesystem, which is full. /mnt/ is another stub which is generally used for permanently mounted filesystems. ...


3

In my experience, no. The system will panic once the root device disappears. You can verify this in your particular situation if you want using a virtualization application like VirtualBox, qemu, kvm, etc. These will allow you to remove a virtual HDD from the machine and observe the result on the system. If you're interested in making a bootable USB drive ...


3

In Linux, most drivers can be either built statically into the kernel, or built as modules. This is a choice you can make when the kernel is being configured for compilation. They will only appear in /lib/modules/$(uname -r) if they are built as loadable modules. Typically, for general purpose systems, especially for pre-compiled kernels made available as ...



Only top voted, non community-wiki answers of a minimum length are eligible