Tag Info

New answers tagged

2

It depends. There is no general answer to this question. In the absence of caching, writing a disk file is usually measurably slower than reading. This has little to do with the operating system and everything to do with the hardware: both hard disks and solid state media read faster than they write. A secondary factor is related to filesystem structure: ...


0

Writing should be faster. The free block list is kept in memory, so finding the next free block will be very fast. Unless you're writing in synchronous mode, when you try to write something it will simply copy the data into a kernel buffer and queue the write; it doesn't have to wait for the I/O to complete. On the other hand, a read has to wait for the ...


2

A partition can be mounted in multiple paths, but the lsblk will only show one. In your case /dev/sda2 contains a btrfs filesystem, which is mounted both as / and as /var/lib/docker/btrfs, probably with two different subvolumes. To see more details on how stuff are mounted around your system use cat /proc/mounts. As for number 3, my guess is that docker ...


0

I found the solution for my problem. It is simply a problem of mathematics ! Different numbers can give the same result. So between Linux and Solaris, the member f_frsize has a different value. But it doesn't matter because when you convert blocks to bytes using the f_frsize in both OS with this formula taken from here: static unsigned long kscale(unsigned ...


1

I'm a user of Raspberry PI, not BBB but I think in this context is the same. If external storage device is working, i.e. kernel can handle it, there is enough power etc. then you can use filesystems as on other hardware platforms. Eventually you should check /boot/config* file if there is support for desired filesystem in the kernel or modules. Cheers,


4

mount -p will show you the file system type used for each mounted file system, eg: $ mount -p rpool/ROOT/solaris - / zfs - no /devices - /devices devfs - no /dev - /dev dev - no ctfs - /system/contract ctfs - no proc - /proc proc - no mnttab - /etc/mnttab mntfs - no ... Unless you are currently using a bootable DVD or USB thumbdrive (i.e. you are in ...


0

According to this, Rootfs is a type of Ramfs, so it should grow dynamically as needed (hopefully). https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt More info here too: http://superuser.com/questions/576723/what-is-rootfs-and-what-can-you-do-with-it


0

iozone -Rab output.wks will do both. The command will output the flat ascii formatted results for possible import by Excel ( space and tab delimited ) as well as generating the output.wks file, which is already in BIFF (Binary Interchange File Format). The output.wks file can be opened directly with Excel, and permits one to skip importing the flat ascii ...


1

You can't do fdisk because you're already at twice MBR's maximum with a 4TB device at 512b sectors. You need to format it with GPT. From wikipedia: The organization of the partition table in the MBR limits the maximum addressable storage space of a disk to 2 TB (232 × 512 bytes). Get the gdisk package and reformat the disk (though it seems to me it ...


0

Mounting filesystems is reserved to root by default, because many filesystems allow a user to gain privileges if they control the disk image (e.g. by creating setuid files). Look for a FUSE filesystem implementation that supports the filesystem in your image. FUSE filesystem drivers run in userspace with no privileges, unlike in-kernel filesystem drivers. ...


1

Among other things, it's possible to obstruct/overlay filesystem structures with mounts, thus you're not usually allowed to mount anything anywhere without root privileges. The cases where this is done (or seems to be done), there usually is a mount helper involved that runs as root (like fusermount, udisks, ...). If for some reason using a mount helper is ...


2

These are backup files that gedit creates by default. You can disable this feature by going to Preferences → Editor and unchecking the line Create a backup copy of files before saving


1

OK, so in Computer Science, I'm not overly fond of saying "you can't get there from here", but in this case, you're trying to fit a square peg into a round hole. The Sector size is usually set by the DEVICE. The 2048B sector size reported is normal for a CD/DVD drive, whereas 512B (or 520B -- which is why I said USUALLY -- some hard drives can actually ...


7

Install auditd and run: sudo auditctl -a exit,always -F arch=b64 -S fchmod -S chmod -S fchmodat \ -F path=/dev/null -k dev-null-chmod sudo auditctl -a exit,always -F arch=b32 -S fchmod -S chmod -S fchmodat \ -F path=/dev/null -k dev-null-chmod You'd find the culprit in the output of: sudo ausearch -ik dev-null-chmod You'll see the command name, pid ...


1

For: WARNING: Not enough clusters for a 32 bit FAT! you can use -s2 parameter at mkfs.fat command. On the other hand if (sector_size_set) { if (ioctl(dev, BLKSSZGET, &min_sector_size) >= 0) if (sector_size < min_sector_size) { sector_size = min_sector_size; fprintf(stderr, "Warning: sector size was set to ...


0

btrfs has implemented the find-new command against subvolumes for years. If you keep a relatively up-to-date snapshot tree, it can be used to atomically watch a filesystem for all changes with little fuss. You would use it like: btrfs sub find-new /chk/path [gen-id] You can get the gen-id you need for comparison with the same command, but using a bogus ...


2

I was also searching for the "Search Everything" tool for linux and discovered "Search Monkey" in the Ubuntu repository. LOVE IT! It's light weight, loads quick, wild card searches produces tons of results instantly, plus it has filters and advanced search methods. I now have my "Everything" search tool back for linux!


1

I think you want something like this: (until findmnt . ; do cd .. ; done) The problem you're running into is that all paths are relative to something or other, so you just have to walk the tree. Every time. findmnt is a member of the util-linux package and has been for a few years now. By now, regardless of your distro, it should already be installed on ...


0

debian Gnu/Linux is supposed to mount HFS+ automatically, and 'just work'--it even has all the packages pre-installed typically. You may need to install hfsprogs and any other "hfsp..." packages you are missing. I've seen disks like yours plug-n-play into Debian. The support for hfs+ has reportedly (I will post a link, can't find it at the moment) been ...


1

It can be somewhat messy if the mount points contain blanks, but this should work except in cases where the mount points contain newlines: #!/bin/sh mountpoint="$(df -P "$1" | awk '{ if (NR==1) i=index($0,"Mounted on"); else print substr($0,i); }')" mount|grep " on ${mountpoint} type " df -P outputs one line for the filesystem; ...


1

I don't know of a command, but you could create a function. You can add the below to your .bashrc: mountinfo () { mount | grep $(df -P "$1" | tail -n 1 | awk '{print $1}') } This executes the mount command and passes the output to grep. grep will look for the output of df -P "$1" | tail -n 1 | awk '{print $1}', and to break it down: df -P "$1" will ...


1

The Linux/Unix way is to have a toolbox of small utilities that, when combined, give you the results that you're after. They tend not to have an utility for every occassion. Instead you have many small useful utilities that are combined together with pipes etc. The advantage of this is that you can write your own utility quite easily if none are available. ...


2

A makefile recipe will stop executing if any command in it returns a failure status (unless the command is preceded by a -). The recipe you cited will ensure that /bsd only gets replaced if the cp bsd /nbsd command succeeds. The cp could fail if the partition were full or out of inodes.


-1

A wrote up an elaborate blog post on how to do exactly this. http://blog.championswimmer.in/2014/saving-linux-data-on-your-fat32-external-hdd-using-loop-mount/ Basically you cannot save Linux data to FAT32 without loosing permissions and having it screwed up. What you can do is create an Ext4 loop device inside it and store there. The linked blog post ...


1

Not sure to understand, If the question is: could some process have keep an acces to my file after umout ? , then the answer is no, as you can't umount if someone/something access your file.


1

If the system has access to the underlying block device, yes, in theory you could read the filesystem files, but! this is cumbersome, and can cause more problems than it's worth, specially if you try to write it. In short, yes, if a OS have access to the block device it's always possible they can read specific files if they know their position in the ...


3

All three data journaling modes should leave the filesystem itself fully intact after a power failure. So it should always mount without errors. The difference is only in the data in your files; data=writeback mode may leave stale data (i.e., what was stored in the disk sectors before the writes your app did). data=ordered and data=journaled should not do ...


3

The manufacturer sold you the 2GB USB stick as 2 Gigabytes, meaning 2000000000 bytes. Your computer is showing the stick in units of Gigibytes. 1 Gigibyte is 1024 x 1024 x 1024 bytes, which is 1073741824 bytes. If you divide your 2000000000 by 1073741824 you'll end up with 1.86264514923095703125 or, rounded to two decimal places 1.86 GiB. In other words, ...


0

The difference is the space used by the file system. There is a space overhead for both metadata and the file system's internal structure. This is true of virtually all file systems whether they are Windows or Linux file systems. On linux, storage devices such as your ssd are treated as a block devices and there is a command 'dd' that will address entire ...


0

"n/a" means "not available" So it is saying that there is no "B" time code in an ext2 filesystem.


0

If you meant /root as the directory then, you would need to create a new partition on the hard drive with fdisk or parted and assign it to be mounted as /root in either during install process or manually in /etc/fstab file. This way the mount point /root will be consuming just that partition. along this how to will suffice. ...


2

You can get the on-disk mapping of a file with the FIEMAP ioctl. There is also the FIBMAP ioctl, which does a similar thing, requires root, and isn't well-documented. Without writing C, you can use filefrag -v or hdparm --fibmap to get at the data.


2

No. Files are not always stored continuously; discontinuous storage actually has a name, "fragmentation" (because each separately stored portion of the file is a "fragment"). This is required, because otherwise you'd not be able to make a file larger than the largest contiguous free space. And appending to files would often fail (or, alternatively, require ...


1

Most linux/unix formats (ext2/ext3/ext4 and HFS/HFS+, btrfs and ZFS) try to keep data unfragmented, but there will always be some small amount of fragmentation. Usually, all but a small amount of data will be contiguous.


6

A filename is an entry in a directory. In essence, directories are two-column tables, where column 1 is the filename and column 2 is the inode number. (Ok, for modern filesystems the story is more complex, but for the explanation that will do.) The inode number points into the inode table; this table is not visible to userland processes, but you can query ...


1

The reason for EPERM (the permission denied error ) is here: drwxr-xr-x 5 www-data www-data 4096 juil. 30 13:47 . The directory where you are trying to create a file (in other words change contents of the directory-file) is writeable only for user www-data, which you are not. Either mark the directory as writeable for the group, change the user to ...


3

Advisory locking is for processes that cooperate "peacefully". The kernel keeps track of the locks but doesn't enforce them - it's up to the applications to obey them. This way the kernel doesn't need to deal with situations like dead-locks. Mandatory locking was introduced in System V Unix, but it turns out that the design was not the brightest thing. ...


3

An easy way is to just create a directory in /tmp and use a symlink: mkdir /tmp/mine ln -s /tmp/mine /home/me/tmp You may want to chmod 700 /tmp/mine to keep it private. If you instead want to mount an actual separate tmpfs directory: mount -t tmpfs -o size=100M tmpfs /home/me/tmp You need root privileges to do this, but normal permissions rules apply ...


1

Using the @reboot cron keyword, this will execute the specified command once after the machine got booted every time. @reboot rm -rf /dev/tmp/*


0

Hardlink creation on directories would be unrevertable. Suppose we have : /dir1 ├──this.txt ├──directory │ └──subfiles └──etc I hardlink it to /dir2. So /dir2 now also contains all these files and directories What if I change my mind? I can't just rmdir /dir2 (because it is non empty) And if I recursively deletes in /dir2... it will be deleted from ...


1

The standard command-line, indexed file search is locate. The index can be updated with updatedb. Most Linux systems have these tools configured by default (where updatedb is set up as a nightly cron job). The index only stores file paths. It doesn't do any advanced indexing like file type, modified date, etc. but for many simple purposes it is ...


1

Are you familiar with Vim? If yes, then have a look at Ranger. It's a very fast text-based file manager, and uses Vim-like shortcuts. Move around with hjkl. To bookmark current directory, press m, then the key to store the bookmark under. To access the bookmark, press ', then the key you bookmarked it under. To create a directory simply type :mkdir ...


6

Command Line Tools I use autojump myself and I also depend on many aliases for navigating at the command line, e.g.: alias b='cd -' alias c='cd ~/Dropbox/95_2014/work/code' alias d='~/Dropbox' alias lnk='cd ~/Dropnot/webs/rails_apps/linker' alias n='cd ~/Dropnot' alias play='cd ~/play/' alias q='cd ~/Dropbox/95_2014/work/code/ruby__rails/ruby/ruby_quiz' ...


3

As for a GUI solution I use and suggest Thunar (it's of course available for other desktops too). It's fast, lightweight and stable, it's memory footprint is almost unnoticeable (~70 MiB on 30+ tabs on two separate windows). Some of its features include: Tab navigation. Drag/drop Bookmarks. Select files by pattern (Ctrl+S). Batch file and directory ...


5

Personally, I have never understood the use of fully-fledged file managers. I deeply prefer to use coreutils for file management. As a result, my solution for this would be to suggest a directory management utility. There are a myriad of these, and I have never personally found a use for them so I can make no personal recommendation. But, below are a few ...


4

async is the opposite of sync, which is rarely used. async is the default, you don't need to specify that explicitely. The option sync means that all changes to the according filesystem are immediately flushed to disk; the respective write operations are being waited for. For mechanical drives that means a huge slow down since the system has to move the ...


0

I found an article suggesting ext4 with following configuration in /etc/fstab: /dev/sda / ext4 noatime,nodiratime,discard,errors=remount-ro 0 1 Here is my source for more information: apcmag.com Good question by the way, I'm planning on installing Linux on a SSD drive too, but didn't think of this before reading your question.



Top 50 recent answers are included