Tag Info

New answers tagged

1

Since 35 years, this option no longer exist. Any decent fs will not give you control over inode numbers. What you can do is to parse the restoresymtsble from ufsrestore, but it is undocumented and binary. Star uses the same basic algorithm to track renames and puts the database into star-symtable. This file is a textfile and there is the program star_sym ...


0

With respect to ext4 the debugfs tool can be used in this way (adequate precaution should be taken as debugfs can corrupt your fs) Goal to create a file at inode 77 with the name /lucky77. We assume that inode 77 is yet unused/free/available and as is the filename /lucky77. Further we work offline, on an unmounted fs. debugfs -w /dev/ext4fsblockdev ...


0

AFAIK, there's no way to copy an inode to another inode without also copying the file's data. There's also no API for requesting a new file to have a specific inode number. So all you can do is cp -a old new && rm old to get a new inode for the file, but you can't choose what it will be. And of course this copies the entire data, so it's slow. ...


0

Here's more C++ code if you want to do this from C++... #include <boost/filesystem.hpp> #include <sys/stat.h> /// returns true if the path is a mount point bool Stat::IsMount(const std::string& path) { if (path == "") return false; if (path == "/") return true; boost::filesystem::path path2(path); auto ...


0

A single block device cannot be mounted, read or written by 2 or more systems simultaneously, so using a USB drive as shared storage is not appropriate for your purpose. You might want to set up a diskless system based on NFS which allows to share the file system on a per-file basis among multiple hosts. Here's mini howto using prebuilt image of full (but ...


3

I don't see any advantage to hard links. With hardlinks, you can move the original file (rename it) as needed without needing to recreate the link. That strikes me as a bug rather than a feature. If you want to disable a site (for example because you've just noticed that it has a major security hole), with symbolic links, you can just rename the ...


1

The ext4 filesystem has no built-in snapshot feature. The generic way to make snapshots under Linux is at the level of the storage volume. Your filesystem must be on an LVM logical volume, which is Linux's own partition system, as opposed to directly on a platform-native disk partition. To create a snapshot of a logical volume, run lvcreate --snapshot. You ...


1

This should work: tune2fs -i180d <block device> The default unit is days, so 180 will be interpreted the same as 180d but explicit is better than implicit. For example: tune2fs -i180d /dev/sda3 Make sure you always use tune2fs when the filesystem is unmounted!


1

ctime, or status change time, refers to the time when the file metadata has changed. For example, $ ls -ltc under Linux will sort by and show the time of the last modification of file status information. To get a little deeper, ctime is the inode reported time since data blocks AND/OR the file metadata has changed. Changes in file metadata can refer here to ...


1

Your command is attempting to mount the device, rather than the partition. Instead of mount -t ext2 /dev/xvdb /mnt, try using: mount -t ext4 /dev/xvdb2 /mnt If you would like to automatically mount this partition at boot, you will also need to add the partition to your fstab file. You need to know the UUID of your disk, which you can find with ls -l ...


0

The block device is read-only. You can't mount a filesystem read-write on a read-only device. You can make the block device read-write by running blockdev --setrw /dev/sda1. This won't work on devices that are intrinsically read-only because the driver has no write support (e.g. CD-ROM drive) but it should work for a device that appears as a hard disk like ...


6

GParted -> Swapoff, not closing it swapoff -a as root to make sure the swap is off cat /proc/swaps to make 100% sure the swap is off Commenting out the swap's UUID in /etc/fstab as root Removing the file /etc/initramfs-tools/conf.d/resume, which contained the UUID, as root Deleting the swap partition using GParted and applying the change. Not allocating the ...


1

You can do this by setting up a loop through each directory in the source and if there's no directory in the target by that name, it moves it: bourne snippit: for dir in `cd "$sourcedir" ; ls -1F | grep '/'` do if [ ! -d "${targetdir}/${dir}" ] then mv "$dir" "${targetdir}/" fi done Note that this will either break or overwrite a file if you ...


11

Comment/remove the relevant entry in the /etc/fstab to prevent it from being reenabled on the next boot, then reboot or run swapoff -a to disable the usage of the swap partition for the currently running system. Now delete the swap partition, extend your system partition over that unused space and extend the actual filesystem. I don't know whether your ...


-3

sudo nano /etc/sysctl.conf This will open a configuration file that controls various things, including how often the kernel will choose to swap. Add this line to the end of the file: vm.swappiness=1 This value can range between 1 and 60. The default is 60, meaning it will use swap very liberally indeed, while 1 means it will never use swap.


1

Right click on the swap partition in GParted, and click swapoff. Then delete your swap partition, remove it from /etc/fstab, and regenerate grub (maybe not necessary?) and your initramfs. The swap partition should not be added to the initramfs by the initramfs update script if the swap partition does not exist. EDIT According to this post, this is the ...


-3

You can right click on swap partition in Gparted and select the swapoff option. That's a quick way of accomplishing the same thing you asked.


27

Execute as root: # swapoff -a And to make that change permanent, edit /etc/fstab and remove or comment-out the swap entry.


1

Same problem after truncating a SD card image where the SD had a few blocks less than the original. Repartitioned the drive with fdisk (see above), but message "Size in superblock is different from the physical size of the partition" remained. Found the solution here: ...


1

I tried my googlefu and it seems really hard to get a straight answer :) and on top of that it also got me curios. I'm gonna post my findings because this might get higher in the google search results. The file contains information on the buddy group cache of that specific disk and it's useful for the fragmentation status of said disk. The fields which I ...


0

The filesystem on Linux caches recently accessed files. These caches do not impact performance because they can be invalidated if the memory is needed. It helps the overall performance of the system to use all available pages as a disk cache. There is no caching of search results (as in, associating a certain command with a certain cached output, so that ...


5

Bits in the umask of the current process are cleared when the file is created. In this case, it looks like the umask is 0002 (no world write). Call umask() before calling open() to change that. Soapbox: please don't create world-writable files unless you're really sure that's what you want. umask exists to save you and your users from exactly that type ...


-1

Bleachbit is a GUI-based cleaning utility, I recommend it. It's in most repositories AFIK, (I run Mint) & Github; https://github.com/az0/bleachbit


-1

How Ext4 Extents Work? Earlier Ext2 and Ext3 had the limitation on the size of the file. It used 32 bit block number to access the data blocks. So that limited the maximum size of file to be 2^32 * blocksize(eg. 4k**) = 16TB*. Also the access time for large Files were slow because in had to go through lots of indirection.Ext4 Filesystem can support very ...


1

No. It consumes memory, but any disk usage is transient use of swap space that would not persist across a reboot.


2

The master boot record (MBR) at the beginning of a disk contains only 446 bytes of code, so it is tiny and cannot do much. Therefore, a common booting technique is to do what is called "chain loading," where the MBR loads code at the beginning of the active partition and jumps to that code. By leaving the first two sectors free, the EXT file system allows ...


3

Yum will do that by default in Live mode; anything you install whilst running off a live optical disc is installed to RAM because you are running off of RAM as it is. If you want to do it explicitly, though, you can create a RAM disk: mkdir foo mount -t tmpfs -o size=4096M bar /foo where: mount is the command. -t tmpfs specifies the type of filesystem. ...


3

The method you are using by creating a /forcefsck file in the root directory of each filesystem you want to force a check on, only works in a pure SysVinit environment, or an older Upstart init environment. It doesn't work on a system using systemd init. I also am assuming you are on an ext4 filesystem. The way to run a one time filesystem check at boot ...


2

fdisk -l shows that your new partition already occupies all 20GB of space, so all you need to do is resize the filesystem itself. There are various ways of doing this depending on the filesystem you're using; if you have fsadm installed, you can use that: fsadm resize /dev/vda1 (this will work for ext2/ext3/ext4 filesystems as well as ReiserFS and XFS). ...


1

In an aufs union-mount, a branch and the mountpoint cannot be the same. Use this: mount -t aufs -o dirs=/mnt/home/lucyvanpelt=rw:/home/schroeder=ro none /path/to/mountpoint Normally if you want to merge 2 directories, you have to specify what should happen if something is written on it. As you can see, you can specify each branch with rw (readwrite) or ro ...


0

You can also do this on the device level, without a unionfs like aufs. See device-mapper snapshot-origin.


0

To delete the hidden AUFS white-out files, you could: Find them, and remove them: find . -regex '.*/\.wh\.\.wh\.plnk' -exec rm {} \; for .plnk files find . -regex '.*/\.wh\.\.wh\.aufs' -exec rm {} \; for .aufs files This matches (in any subfolder) the aufs-specific files .wh ..wh.plnk and .wh..wh.aufs, but would not match -say- .wh.Fwh.aufs In the ...


0

On Debian and derivatives you can periodically check the integrity of files installed by the package manager, by using the "-V" (--verify) option to dpkg. Alternatively, for older versions of Debian there is the "debsums" package. For other scenarios than the above, and for configureable data, a tool like "tripwire" might suit your needs.


3

du and df do not count the same things so it is rare from them to give the same results, though the differences are usually attributable to administrative overheads and areas reserved for special purposes. However, with 89% and 96% used you have much larger, and more urgent, problems to deal with.


18

Most probably this is ext2, ext3 or ext4 file system which reserve a few percent of disk space (by default 5%) to be used only by specified users (usually root). If you create file system with mke2fs then -m option is what you are looking for: -m reserved-blocks-percentage Specify the percentage of the filesystem blocks reserved for the ...


1

To include the options you want, you should modify your fstab entry as shown below. Be careful, as adding an option that doesn't actually exist will cause your system not to boot. sshfs#wbarlow@remote:/home/wbarlow/dev /home/wbarlow/dev fuse defaults,users,noauto,idmap=user,Ciphers=arcfour,Compression=no,reconnect 0 0 I tested it by Inspecting the ...


2

I don't know much about "Windows Share", do you mean the SMB protocol? I access files hosted on CentOS from Windows 7/8 machines with samba. No client side installation needed. https://www.samba.org/samba/docs/using_samba/ch03.html


0

What the “Blocks” value (the st_blocks field of a struct stat) measures exactly is not standardized. Traditionally, it counts the number of blocks that are used for filesystem content; this value multiplied by the block size is equal to the file size, rounded up to the nearest multiple of the block size. There's an exception: if the file is a sparse file, ...


0

Use tune2fs to determine inode size of the filesystem. $ df -k / Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 9156984 7509468 1159324 87% / $ tune2fs -l /dev/sda1|grep "^Inode size:" Inode size: 256 $


0

I can confirm that opening the disc with VLC does bypass the protection. However, when using dd, I had to use this command after opening VLC (discovered by loading the disc and using the directory exposed in VLC). dd if=/dev/sr0 of=image_of_disc.iso Which is different from many posts I have read that say this command should work: dd if=/dev/cdrom ...


0

While I have never used beets, I can give you some general info. First you are correct, in one regard at least. Generally speaking 300 Gigs of data is 300 Gigs of data. The file system should not matter too much. There are a few things you can check to make sure things are going smoothly. First is free inodes. When you run df -h you should get free space ...


1

If it has to be quick, I generate a new temporary directory, mv the directory below it and then recursively delete the temporary: t=`mktemp -d` mv certainFolder $t/ rm -rf $t &


5

Tracking freed blocks is unavoidable in any decent file system and ZFS is no exception. There is however a simple way under ZFS to have a nearly instantaneous directory deletion by deferring the underlying cleanup. It is technically very similar to Gilles' suggestion but is inherently reliable without requiring extra code. If you create a snapshot of your ...


4

What you're asking for is impossible. Or, more precisely, there's a cost to pay when deleting a directory and its files; if you don't pay it at the time of the deletion, you'll have to pay it elsewhere. You aren't just removing a directory — that would be near-instantaneous. You're removing a directory and all the files inside it and also recursively ...


2

The copy doesn't do any conversion itself. Basically the "conversion" happens as part of the read process. All file access is through VFS (virtual filesystem) calls. The copy reads data from one file using VFS calls and writes it to another the same way, equally for any file attributes it copies. Copy doesn't really know anything about disk formats like ...


1

I have bad news for you: if I'm reading the code in http://lxr.free-electrons.com/source/fs/efs/ correctly, Linux -- even the very newest version -- does not implement write access to EFS, probably because it was believed that the only use for a filesystem that old was to migrate data off of old disks.


4

In general: Boot a livecd, containing all needed drivers (ZFS) Backup your partition Format it with ZFS Unpack the backup into the new partition Update initrd, make sure all needed modules are included (on debian update-initramfs and configuring /etc/initramfs-tools, but on redhat it will be different). Update grub (e.g. filesystem uuids) Maybe reinstall ...



Top 50 recent answers are included