Hot answers tagged

50

There's a tool called blkid (use it as root or with sudo), # blkid /dev/sda1 /dev/sda1: LABEL="/" UUID="ee7cf0a0-1922-401b-a1ae-6ec9261484c0" SEC_TYPE="ext2" TYPE="ext3" you can check this link for more info


40

Such an utility is zerofree. From its description: Zerofree finds the unallocated, non-zeroed blocks in an ext2 or ext3 file-system and fills them with zeroes. This is useful if the device on which this file-system resides is a disk image. In this case, depending on the type of disk image, a secondary utility may be able to reduce the size of the disk ...


35

In /dev/disk/by-uuid there are symlinks mapping each drive's UUID to its entry in /dev (e.g. /dev/sda1)


17

Normally I would suggest a solution such as "hook up the 2nd hard drive using an external enclosure, boot from a linux CD, then use a command such as 'dd if=/dev/sda of=/dev/sdb bs=1G', but since you want to use the same technique for work, I have what may be a better solution. All of my servers and laptops get imaged at work using Clonezilla. There are ...


17

If one is interested only in block storage devices, one can use lsblk from widely-available util-linux package: $ lsblk -o KNAME,TYPE,SIZE,MODEL KNAME TYPE SIZE MODEL sda disk 149.1G TOSHIBA MK1637GS sda1 part 23.3G sda2 part 28G sda3 part 93.6G sda4 part 4.3G sr0 rom 1024M CD/DVDW TS-L632M It lends itself well to scripting with ...


13

Before we discuss the specifics regarding pdflush, kjournald, andkswapd`, let's first get a little background on the context of what exactly we're talking about in terms of the Linux Kernel. The GNU/Linux architecture The architecture of GNU/Linux can be thought of as 2 spaces: User Kernel Between the User Space and Kernel Space sits the GNU C Library ...


12

RHEL6 LVM Admin Guide According to the RHEL 6 Logical Volume Administration Guide it's recommended that if you're going to use an entire drive as a physical volume in a LVM volume group, that you should still partition it: excerpt from the guide "RHEL6 Logical Volume Manager Administration LVM Administrator Guide" 2.1.2. Multiple Partitions on a Disk ...


10

The walk is over the different software components (drivers) that handle the device; this corresponds by and large to the hardware devices and buses that are involved in connecting to the device. This is mostly unrelated to the physical arrangement of the devices: most of them are inside the same chip anyway. Taking this example from the top: First we ...


10

Use mdadm, check the manpage. However, I will list one gotcha here. If you do this and really want reliability, you should make sure your master boot record is copied to both drives. By default it will likely only get copied to one drive. If that drive dies, you cannot boot from the other drive, even though all your data is safe. To copy the mbr to both ...


9

I've used LVM2 defragmenter before. It is not the simplest or best written, but it does the trick.


9

It's preferable to have some commonly recognized descriptors (meta-data) and MBR does quite stand as such a descriptor. Even GPT uses old MBR-based partition table to indicate its presence. Indeed you lose some diskspace but it's rather negligible meanwhile advantage of understanding what's on the disk (and where) is self-evident.


8

You want rsync: rsync -a --append "$A" "$B"


8

Yes you can use dd to skip the blocks. A="file1" B="file2" BLOCKSIZE=512 # default bs for dd size_b=$(stat -c "%s" "$B") skip_blocks=$((size_b / BLOCKSIZE)) dd if="$A" of="$B" skip=$skip_blocks seek=$skip_blocks bs=$BLOCKSIZE The important parameters here are skip as well as seek: skip: skip BLOCKS ibs-sized blocks at start of input seek: skip ...


8

The simplest way to do this would be to overwrite the entire drive with zeros. dd if=/dev/zero of=/dev/sdX bs=1M Just know that once you execute that, there's no going back. As soon as the command finishes, and you get back to a shell prompt, nothing will work and the box will be extremely unhappy. It might also be safer to background that operation by ...


8

“Input/output error” indicates something that shouldn't happen somewhere in the input/output stack. The intended meaning is a hardware failure: your hard disk is failing. Often this error turns up in cases where the problem is a software bug or a misuse of a special-purpose filesystem. But here, you're reading from a system directory, so a hardware failure ...


7

UPDATE So, I really didn't think I would be researching NTFS this morning, but, thanks mostly to @AndrewMedico's comments below, I learned something. The truth is file streams are weird, and they confuse me, but apparently it gets deeper. Behaving in a way very like NTFS file streams, Transactional NTFS commits file changes to some alternate cache until ...


7

You could trawl through the output of lshw and extract details about devices in the disk or tape class (and maybe others - storage class gives you details on storage controllers, scsi, sata, sas, etc). e.g. lshw -class disk -class tape The -short option gives a nice compact summary. e.g. on my home zfsonlinux server/workstation/experiment-box (no tape ...


6

If you're looking for advanced filesystems for general-purpose computers in the Linux world, there are two candidates: ZFS and BTRFS. ZFS is older and more mature, but it's originally from Solaris and the port to Linux isn't seamless. BTRFS is still under heavy development, and not all features are ready for prime time yet. Both filesystems offer per-file ...


6

Really finding something that works for you is the best option. I always create a new mount point either /data or /storage depending on my mood. any non transient data I think I might need but is just cluttering up /home/ gets moved there, as well as shared data. as far as how do I organize data: /storage/movies/<big pile-o-moviex ...


5

Before doing anything of this sort back up your data to separate media and verify the backup via sha1sum. The process from there would look like Break the RAID1 mirroring so that one of the drives is free Add the third drive to your system Create a degraded RAID5 out of the new drive and the one freed from the RAID1 Copy the data over to the RAID5 volume ...


5

QEMU comes with the qemu-img program to convert between image formats. qemu-img convert -f qcow2 -O raw my-qcow2.img /dev/sdb


5

sfill from secure-delete can do this and several other related jobs. e.g. sfill -l -l -z /mnt/X UPDATE #1 There is a source tree that appears to be used by the ArchLinux project on github that contains the source for sfill which is a tool included in the package Secure-Delete. https://github.com/BlackArch/secure-delete Also a copy of sfill's man ...


5

The short answer No, it's probably not malevolent. It appears Iceweasel writes its preferences file after every keystroke. The long answer (how to find out) The same thing happens here. There is a way to determine exactly what's going on, by using the kernel's block-access dump feature. All of the below is done as root: First, you need to stop the ...


5

There is a special option in rsync: --remove-source-files This tells rsync to remove from the sending side the files (meaning non-directories) that are a part of the transfer and have been successfully duplicated on the receiving side. Note that you should only use this option on source files that ...


5

You should use /mnt in your case as it is on the second partition which has free space. You do not want to allow the root (/) partition to get full as you will run into trouble. For example, during the next system update your package manager may download many packages and crash while trying to install them, simply due to the lack of disk space. The ...


5

In my personal experience, "duplicate PV" is usually caused by the system having multipath access to a particular SAN LUN but LVM hasn't been configured to filter out the block devices for the individual paths. The device mapper name even looks like a WWNN/WWPN (although I don't have enough experience with SLES to know if that could be something else). Not ...


4

Depending on your current file probably this would do: awk ' /^stdout:/ { print substr($0, 9) } /^stderr:/ { print substr($0, 9) > "/dev/stderr" } ' output It could get a bit more elegant with some changes to your "recording script".


4

Short answer: Ext4 is the standard file system on most Linux distribution. It works, it is safe, and as @Marco said: If ext4 works for you, just keep using it Choosing a file system It depends on what are your objectives. For a total compatibility across systems, you may choose FAT32 (do not blame me - I think it's a terrible choice). NTFS works ...


4

I haven't used any dedicated programs for this, but it is quite easy to organize and fine tune with a combination of cron, bash, tar (incremental dumps) and/or rsync. In my mind, there are two optimal solutions, and I use both or one of them depending on the context. I think the first will be more appropriate for you, but I'll describe both here. ...


4

I don't think the installer can do what you want yet (although it's getting better over time), so you could try booting the installation image, and run a root shell from the initial menu. You can then use gpart, zpool and zfs to configure your disks by hand and install the system from the archives on the image. There are numerous guides around the Internet, ...



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