New answers tagged

0

A [probably not perfect] solution to this has been to hook onto the "systemd-remount-fs.service" systemd service, which is the remounting of the filesystem to read-write. This means the module will be loaded as early as possible, whilst still being loaded after the filesystem becomes readwrite. My sample systemd config file is as follows: [Unit] ...


1

summary: ext2 is a bad choice for /boot, since (unless I'm missing something or am very unlucky) it appears to prevent "normal" update of GRUB2. details: Today I was updating a 2010-vintage laptop that runs a Debian distro (LMDE2) shipped with win7, which I dualbooted with an unmanaged Linux /boot partition and a managed (LVM2-on-LUKS) partition: $ sudo ...


-1

In the 1970s, UNIX had all official executables in /bin and /usr/bin was a location beneath the users home directories (e.g. /usr/dmr) that was available for any user to store own binaries that might have been of interest for others as well. The result of this open /usr/bin was a junk yard of undocumented software and so Stephen Bourne wrote a cron script ...


3

tune2fs applies only to ext[2-4] filesystems; not to XFS ones. The "Bad magic number in super-block" simply means that tune2fs doesn't understand the filesystem type. As you noted, the fact that your filesystem can be mounted confirms that it's viable.


2

I don't agree with the squashfs recommendations. You don't usually write a squashfs to a raw block device; think of it as an easily-readable tar archive. That means you would still need an underlaying filesystem. ext2 has several severe limitations that limit its usefulness today; I would therefore recommend ext4. Since this is meant for archiving, you ...


2

SquashFS is a compressible read-only filesystem that fits your requirements well, has been in the kernel for a few years, and is already widely used (e.g., in LiveCDs). The latest documentation for the userspace tools is on GitHub. From the documentation: Squashfs is a highly compressed read-only filesystem for Linux. It uses either gzip/xz/lzo/lz4 ...


1

You'd probably be better served by a compressed filesystem. There are ways of compressing various Linux filesystems (FUSE can do it), but since this will be read-only once you've created it, you might consider squashfs. You create the filesystem with mksquashfs. Linux has had squashfs in the main kernel since 2.6.something, so it should work from pretty ...


4

Presumably you already found this: http://serverfault.com/questions/528075/is-it-possible-to-on-line-shrink-a-ext4-volume-with-lvm so the short answer is "because the folks who wrote ext4 don't support this." The slightly longer answer is that it's hard, especially if maintaining any sort of backward compatibility with ext2. Finding all the bits and pieces ...


5

The "marking that memory as unused" is a function of how much work the unlinkat(2) system call has to do, which in turn scales linearly with the size of the file. For a default tmpfs on a RHEL 6 system with ~4G of memory, this can be demonstrated as follows. $ sudo mkdir /tmpfs; sudo mount -t tmpfs -o size=75% tmpfs /tmpfs; cd /tmpfs $ dd if=/dev/zero bs=1M ...


2

You have created an "infinite loop" with a softlink that points to itself. You may have mixed up the arguments to ln. Since the second argument to ln is an existing directory, it will create a softlink with the same "base name" as the first argument, inside that directory. So you create a softlink ROOT which points to ROOT. When trying to resolve this you ...


1

rm -rf is not unsafe per se, so go ahead and run it. However, it won't completely work. For some reason, an empty Btrfs subvolume cannot be removed with the rmdir(2) system call. rm -rf will remove all of the contents of all of the subvolumes (regular files, etc...) but the empty subvolumes themselves as well as the parent directories of all those ...


2

You could take a look at the project squashmount. It mounts a directory with both a squashfs and an autofs/overlay/overlayfs system to allow for squashing ro access as well as write access. Completely configurable on how much change requires re-squashing, its a nice to use for database storage, repos spools, etc.


0

sudo apt-get install mtpfs Next you’ll need to create a static mount point for MTP attached devices: sudo mkdir /media/MTPdevice sudo chmod 775 /media/MTPdevice sudo mtpfs -o allow_other /media/MTPdevice if you don’t already know your device’s idVendor and idProduct, you can determine them by connecting your phone via USB and querying it using MTP. ...


0

One easy (and heavy handed) way to do this would be to wipe the whole contents of the disk. The simplest way to do that would be to use dd: $ sudo dd if=/dev/zero of=/dev/<disk> bs=1M count=500000 By the time the command ends (maybe an hour?) your whole disk will be filled with zeros. If you're in a rush, you could kill the process with Ctl+C ...


2

Don't use -o remount. That's only useful for remounting, that is, unmounting and mounting again in one operation which isn't supported in your case. Therefore, you need to unmount just like you did and then run: sudo mount -o rw /media/sda3


1

The message appears in case that certain process (in this case sftp-server) doesn't get CPU for 120s (default limit). This could be caused by high load on the system. Generally this could be caused waiting on any resource, most likely candidates are CPU, disk and network. When debugging such problems you can test writing speed on disk: $ dd if=/dev/zero ...


1

Apparently an old version of squashfs-tools doesn't have this, but the switch is -Xcompression-level. One can locally build working squashfs-tools with no root rights.


0

using vim you can "edit" the directory. removing all but the ./ and ../ should "reset" the folders metadata My downloads directory is 12k vim Downloads/ " ============================================================================ ...


1

This ls /lib/modules/$(uname -r)/kernel/fs command only lists the names of the filesystem kernel modules of your currently running kernel. If your kernel has been compiled with build-in ext4 support, then there is no ext kernel module necessary, so it won't show up in that ls command. Like @Jeff Schaller said, it's likely your case (also because Ubuntu ...


1

According to man stat the ID is the ID of the filesystem, whatever that may or may not mean. I'm guessing this is generated when the filesystem is. The first column references the partition UUID, not the filesystem ID. It's a departure from the more traditional /dev/sdXX, mostly because with modern systems it's sometimes possible for the traditional drive ...


0

With a systemd enabled system you can use tmpfiles. See man 5 tmpfiles.d for details. Create a file /etc/tmpfiles.d/tmp.conf with this content: d /tmp 1777 root root - - systemd-tmpfiles-setup.service will take care of your permissions.


1

vfat is only to represent that it's a FAT partition, according to the partition table and fstab. fdisk -l will tell you the same thing as df -T or mount. I wouldn't use stat, I would use file /dev/sda2 or parted /dev/sda -l to get a better idea. Side note: fuseblk is used for auto-mounted media. There is a clear difference between the /boot/efi and the ...


2

The inode number is simply the unique identifier of an inode. It is analogous to a UID or GID. Thus, each inode has exactly one identifier. To find the inode number of a file, use either ls -i or stat. Each directory in Unix is just a list of (filename, inode number) pairs. The inode number serves as a "pointer" to find the inode structure itself. The ...


0

I had this problem trying to create a new volume on a brand new 3TB drive. Answer is to create 2 partitions which builds a good superblock then resize the get a single partition of max size. Ray


1

With 3.2 million inodes, you can have 3.2 million files and directories, total (but multiple hardlinks to a file only use one inode). Yes, it can be set when creating a filesystem on the partition. The options -T usage-type, -N number-of-inodes, or -i bytes-per-inode can all set the number of inodes. I generally use -i, after comparing the output of du -s ...


2

Yes, it is. Use stat *directory name* in order to obtain inode number


11

Directories are special files, hence they have inodes. You can test that with ls: ls -li or using stat: stat -c '%F : %i : %n' * Example: % stat -c '%F : %i : %n' * regular file : 670637 : bar.csv regular file : 656301 : file.txt directory : 729178 : foobar The number in the middle is the inode number.


0

If sdb is partitioned, you could backup just the partition with the data of interest. For example: sudo dd if=/dev/sdb1 of=rpi-backup-image bs=4MB


2

Files like .__afs063D are created when a process has a file descriptor open but the file has been deleted. Its how the AFS cache handler handles that situation. Next time the volume is salvaged, it will be removed.


0

If you don't care about the original data continuing to exist, and you just want to delete files that you can't delete directly due to character encoding issues then this is your solution. It involves using rename to rename the files so they may be deleted. The example below will remove all NON-ASCII characters from all file and directory names in the ...


2

/sys/class/gpio/gpio60 is a symbolic link. That's a special type of file that points to another file. When accessing the file contents, symbolic links are transparent: they act like their target (the file they point to). But when listing directories, symbolic links appear as themselves; ls -l shows them with l in the leftmost column, and shows their target ...


2

Editing a disk image is possible, but very risky. If you have a suitable editor that can help you with this it would be worth making sure that you have a copy (written or otherwise) of the data you're changing. Most importantly, it must not be attempted without the disk being unmounted and not in use. If it's your boot/system disk that means you are going ...


-1

I would personally use mountpoint (very portable on Linux!): NAME mountpoint - see if a directory is a mountpoint SYNOPSIS mountpoint [-d|-q] directory or showmount which is pretty much required to be installed on any system that actually mount NFS shares (part of nfs-common package): NAME showmount - show mount information for an ...



Top 50 recent answers are included