31

Compare this answer (note bs=1K is used there): dd is an old, cranky program initially intended to operate on tape devices. When you tell it to read one block of 1kB, it attempts to read one block. If the read returns less than 1024 bytes, tough, that's all you get. conv=sync gets important when dd indeed reads less than it expected. In your case any ...


21

As others have already identified, the problem is that you're using dd. Rule #1 of using dd is you do not use dd. Rule #2 of using dd is you do not use dd. Rule #3 of using dd (for experts only) is don't use the bs option. There is no magic in dd. The magic is in /dev/*. dd will happily mangle your data and setting a block size may or may not help ...


13

Depends on the tool you are using to create the image. Usually you don't need to zero it out. For example ntfsclone (part of ntfs-3g) states this in the man page: ntfsclone will efficiently clone (copy, save, backup, restore) or rescue an NTFS filesystem to a sparse file, image, device (partition) or standard output. It works at disk sector level and ...


8

For anything involving forensics, including undeleting files, dd is the RIGHT tool (at least for the read). The problem, as others have pointed out, is that at the end of a ssh pipe, you aren't reading it blocked. So you either need iflag=fullblock on the second dd, or to just skip the second dd altogether. flag=noerror is probably wrong. You want to ...


6

In order to change the mount to as read-only, you can run: $ sudo mount -oro,remount /mountpoint


5

There isn’t any limit inherent in the file system design itself, and experimentation (thanks ilkkachu) shows that directories can be nested to a depth exceeding limits one might naïvely expect (PATH_MAX, 4096 on Linux, although that limits the length of paths passed to system calls and can be worked around with relative paths). Part of the implementation ...


4

You could use dd for Windows. dd if=/dev/zero of=EMPTY bs=128k del EMPTY Should do the trick.


4

file-nr shows the number of open files, from the kernel’s perspective (this corresponds to open file descriptions, which are kernel data structures, rather than file descriptors, which are per-process). Forking doesn’t open any new files, so the number in file-nr doesn’t increase.


3

exfat behaves just like vfat and since it has no concept of permissions, chown and chmod both won't work. You have to specify mount options such as uid, fmask and dmask, e.g. defaults,noatime,nofail,uid=1000,fmask=0133,dmask=0022 (run id to find out what your ID is).


3

The command dd was modeled after the command DDR (Disk Dump and Restore) from IBM mainframes from the 1960s and is mainly intended to convert and reblock block oriented I/O from/to block oriented disks. This is however not what you intend to do here. The important problem in your use case is than you have an unreliable network pipe in the middle that does ...


3

For Linux, the partition type identifiers are almost entirely cosmetic: in particular, the filesystem repair tools certainly won't require the partition type to be correctly specified in the partition table. If you point an ext4 filesystem recovery tool at a partition, it will do its best to find and fix an ext4 filesystem on it, if at all possible.


2

Install exFAT utilities first. sudo apt install exfat-utils Then sudo mkfs.exfat -n Volume Name /dev/USB_dev_file


2

The disk that contains the filesystem/LV might be unavailable or failing. I hope you have a reasonably up-to-date backup of this server. Use lvdisplay -m /dev/mapper/vg-mng-lv_var (in single user mode it might be lvm lvdisplay -m /dev/mapper/vg-mng-lv_var instead) to identify the PV(s) the LV is located on. If it's a simple local disk, check its health ...


2

Mounted filesystems will be ignored. As of 2.33.1 the man page states: The exception is --all, in this case already mounted filesystems are ignored (see --all below for more details).


2

use the lsblk command. This is bash syntax for an alias, which prints out information to my liking that would make it very easy to know what is where regarding disks. alias lsblk2='lsblk -o type,name,label,partlabel,size,fstype,model,serial,wwn,uuid' do a lsblk --help to find all the things you can give it on the -o. in your case it is not relevant, but ...


2

“#1 (dynamic)” refers to the revision of the ext2 file system; version 1 supports dynamic inode sizes. This has been in use since kernel 2.2. See "mke2fs -r fs-revision-level" - how is this used? for some of the relevant history.


1

Yes, you could use fdisk, gdisk or any other console utility which allows to change the partition type or create a partition without actually formatting it. e.g. for fdisk it would be: sudo fdisk /dev/sda t (change type) 2 (select the second) 7 (NTFS) w (write and exit)


1

Try: sudo tee thefile </dev/null or: sudo truncate -s 0 thefile


1

Sudo doesn't work as you expect it with forwarding and pipes. If you would sudo your command, it would only sudo the part before >. Either do a sudo bash - c "full command" or temporarily become root with sudo -s and execute your command. The file being open doesn't block you from editing its contents. It does not remove the file after you ...


1

In Gnome Files I've noticed that this directory contains a few *zone* files with long and strange name. The files were not visible in ls output and I was not able to delete them using Files window. I know that when you copy something from Windows local drive to the network one OS copies extended NTFS attributes to the corresponding *zone* file. When I ...


1

Yes, it can make a lot of difference... Usually it makes the most difference on file systems with a lot of smaller files. So it may not make a difference to your video collection (mostly GB files) or even you music collection (mostly MB files). But a file system filled with many files only a few KB will definitely see a difference. There are some ...


1

From what you write, you have accidentally shrunk a partition smaller than the file system it contains. On it's own this shouldn't lose any data but almost every action you might do after that could [have]. This definitely includes resize2fs, e2fsck and mount. It appeares you were very lucky since the two commands you executed both detected the problem ...


1

df’s output format is unspecified, including the order of the file systems. Under Linux, GNU df now bases its output on the contents of /proc/self/mountinfo; entries there are listed in the order in which they were added to the current mount namespace.


1

You were on the right track but the partition table was corrupted. So, the first step is to create a new one (a DOS one in this example). I assume your disk is /dev/sdx, please check this, because the next steps will erase the whole selected disk once you write to it (you have to explicitely ask fdisk to do it though). $ sudo fdisk /dev/sdx There are many ...


1

Unfortunately, you cannot have 2 partitions mounted on the same directory. However, you can mount the second partition in an other directory and use symlinks. Ex : mount your HDD into /home/username/ mount your SSD into /mnt/ssd/ Create symlinks in /home/username/ to your /mnt/ssd/ dotted files Note : You can also use bind mounts instead of symlinks


1

I suggest running krenew, which has the option to run a command with the -t flag, which by default is aklog. It’s usually packaged as part of the kstart package. Run the krenew inside the screen session. Make sure you get renewable Kerberos tickets, and your institutions KDC might have limits on how long your ticket can be renewed. As long as the Kerberos ...


1

[EDIT] Since secure erasing is not part of the problem here, this question might actually be a duplicate, the answer of which suggests ddrescue, another great tool, handling potentially failing disks. Paul gave a good solution on Windows (SDelete from sysinternals/Microsoft). However, since this question has been posted in "Unix & Linux", I suppose a ...


1

Okay, I have found the answer. In previous versions of Unix like SVR4, struct file does not contain file_operations field and all operations e.g. read, write etc. contained by vnode->v_op. However, in case of Linux struct file will contain file_operations field which will have functions like open, read, write etc. and struct inode (similar to vnode) will ...


1

Backstory: I had originally installed Linux Mint (like Ubuntu) completely encrypted, and it wiped out my Windows installation in order to check those boxes. That made it so I would up with a supersized LUKS partition with an LVM2 VG inside that took up almost the entire disk. To reinstall Windows on my laptop, I needed approximately 160GB, and so that meant ...


1

additional way to archive permission changes is with an udev rule: $ cat /etc/udev/rules.d/99-asus.rules # allow keyboard brightness control for everyone ACTION=="add", SUBSYSTEM=="leds", KERNEL=="asus::kbd_backlight", RUN+="/bin/chmod a+w /sys/class/leds/%k/brightness" to test the rule try with udevadm test /sys/...


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