Hot answers tagged storage
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 ...
10
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 ...
9
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 ...
7
There's a tool called blkid,
$ 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
6
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 ...
6
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 ...
6
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 ...
6
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.
5
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
...
3
Actually I found the answer eventually here: lvm2 Faq
They are identified by uuids always even if you create them using device names and so are resilient if devices are renamed due to renumbering of devices
I found that I needed to reboot when I changed drive numbers by changing usb devices to have the new positions used by lvm, running vgscan, lvscan or ...
3
From Wikipedia:
For a while, both LVM and EVMS were competing for inclusion in the mainline kernel. EVMS had more features and better userland tools, but the internals of LVM were more attractive to kernel developers, so in the end LVM won the battle for inclusion. In response, the EVMS team decided to concentrate on porting the EVMS userland tools to ...
3
It looks like you are using Veritas Volume Manager on that box. So from what I can tell there, you need to apply a Sun disklabel to the new disks first and then add them to VxVM.
Format each disk and label it first:
# format san_vc0_5
format> label
format> Proceed? yes
Then you should be able initialize each disk and add it to Veritas via:
# ...
3
You should realize that when you boot a virtual machine, it sees the virtual disk as if it was a physical device and, as I understand from your description, the system you boot resides on the disk. So look from the point of view of your normal system: You've got a bigger disk but have the old-sized partition on it. Certainly, you must resize it. But not ...
3
WARNING: e2fsck will likely harm a mounted partition
You've just modified your disk (partition) size; You'll need to do the following to modify you fs size (providing that you are using ext* fs:
e2fsck -f /dev/<partition>
resize2fs /dev/<partition> <size>
HTH
3
After increasing the size of the underlying device, you must as well increase the size of the file system and, if so, everything in-between (partitions, LVM stuff etc.).
If you don't have any if them, and your file system is ext[23], you can just use
resize2fs /dev/...
in order to increase up to the auto-determined size.
3
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 ...
3
You have a couple options:
Start the EBS boot instance with a larger root EBS volume. Here's an article wrote describing how to do this: http://alestic.com/2009/12/ec2-ebs-boot-resize
Attach extra EBS volume(s) to the instance. Here's an article I wrote for Amazon describing best practices with an example using a MySQL database: ...
3
I like to split my data into two central folders: One (I call it normally /heap) with recoverable data which I don't have to backup (everything which is just a replication from a central server) and one (I use /data) for the rest. This makes automated backup mach easier than having to carry a list of directories which are under backup.
That also means I ...
3
Your first task would be to connect both disks to an existing Linux system or connect the new disk to the original system.
You must be very careful since it is very simple to copy the blank disk on top of the good disk!
To end up with the boot sectors and all, you would do something like:
dd if=/dev/hdx of=/dev/hdy
Where hdx is your 40G disk and hdy is ...
3
QEMU comes with the qemu-img program to convert between image formats.
qemu-img convert -f qcow2 -O raw my-qcow2.img /dev/sdb
3
SD cards are pretty much the worst kind of flash storage. They're fine for cameras that do large linear reads and writes to FAT format cards, and don't overwrite the same spot very often, but they wear out very quickly of you try to put a rootfs on them. I have a very unhappy card in a dev board to prove it.
I don't know of a way to monitor the card, but in ...
3
Did you try dd skip with an offset of B's real file size (independent of the partition block size)?
That would get you the missing part. At that point you could directly cat them together into a new file with cat "$B" "$A2" >> "$C"; #mv "$C" "$B" (where $C is of course the missing part on a path with enough space).
cat works fine for concatenating ...
3
The program that "caused" it (really, its caused by bad hardware, it'd be more appropriate to say "the program that was the victim of it") may not even exist anymore.
E.g., send off a write, and then exit. The write will sit in the kernel buffers until the kernel performs writeback. At which point an I/O error may occur.
When the program does still exist, ...
3
iSCSI Enterprise Target (iet) is what you want.
On the server end, you tell iet to take a file or block device and expose it as an iSCSI target.
On the client end, you run an iSCSI initiator. You'll then be able to mount the target as a block device, i.e. /dev/iscsi_target_1
You can then take this /dev/iscsi_target_1 and encrypt it using cryptsetup or ...
3
There are always buffers, so when the command returns, the file may not have been written to disk. All applications will see the file at this point, but if your system crashes or loses power, the file may not be present or may not be complete after you reboot.
You can run sync afterwards to flush all file system buffers but then there is a chance that the ...
3
Actually you don't need the swap partition and the /boot partition.
But returning to your question: yes, the swap is used as virtual memory (and also for hibernation). If both the swap file and the physical RAM fill up, you most likely won't have a kernel panic: applications will just start to be killed by the kernel's out-of-memory killer.
But at this ...
3
You must tell apart the resizing of a block device (here: /dev/sdb4) from the resizing of a file system. A file system can be smaller but not bigger than the underlying block device.
You should make a backup of the partition table:
sfdisk -d /dev/sdb > ~/sfdisk_sdb.txt
Then you make a copy of that file and adapt the line that looks similar to this:
...
3
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
...
2
To simply copy the partition, you can use dd if=/dev/srcDrive of=/dev/dstDrive or something like this. I would recomend you to read its man page. Sorry I can't give much more info, since I'm at work right now..
Only top voted, non community-wiki answers of a minimum length are eligible

