Disk partitioning is the act of dividing a hard disk drive into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks.
33
votes
11answers
3k views
Is it good to make a separate partition for /boot?
I've seen some people make a separate partition for /boot. What is the benefit of doing this? What problems might I encounter in the future by doing this?
Also, except for /home and /boot, which ...
24
votes
6answers
11k views
Different linux distros sharing the same /home folder?
what is the best way to share the same /home directories between different linux distribution?
I mean, I want to have both , say, Fedora and Arch, and I want to find my files at home no matter which ...
22
votes
9answers
5k views
Why put things other than /home to a separate partition?
So recently a Debian 5.0.5 installer offered me to have separate /usr, /home, /var and /tmp partitions (on one physical disk).
What is the practical reason for this? I understand that /home can be ...
20
votes
7answers
2k views
How can I use DD to migrate data from an old drive to a new drive?
I am upgrading the internal SATA hard drive on my laptop from a 40G drive to a 160G drive. I have a Linux/Ubuntu desktop which has a SATA card. I would actually like to do the same thing for a couple ...
18
votes
2answers
3k views
What mount points exist on a typical Linux system?
I have 2 questions.
During Linux installation we specify memory space for 2 mount points - root and swap. Are there any other mount points created without the users notice?
Is this statement ...
13
votes
6answers
4k views
What's the best way to partition your drive?
I usually install Linux on a single partition since I only use it as a personal desktop.
However every now and then I reinstall the box and what I simply do is to move my files around with an ...
13
votes
3answers
3k views
Are there any side effects when two distros share a swap partition?
In order to save disk space, I want to have two OS installations share a single swap partition (a dual-boot). Is this a good idea?
13
votes
1answer
5k views
How can I increase the number of inodes in an ext4 filesystem?
I had a problem (new to me) last week. I have a ext4 (Fedora 15) filesystem. The application that runs on the server suddenly stopped. I couldn't find the problem at first look.
df showed 50% ...
11
votes
1answer
556 views
What is the difference between “extended” partition and “logical” partition
What is the difference between "extended" partitions and "logical" partitions on my hard disk? What's the need for each? I am using Linux
11
votes
4answers
1k views
Wipe last 1MB of a Hard drive
Is there an easy command that I can use to zero out the last 1MB of a hard drive?
For the start of the drive I would dd if=/dev/zero of=/dev/sdx bs=1M count=1. The seek option for dd looks ...
11
votes
3answers
4k views
How can I move the home directory to a separate partition?
I would like to install another distribution but keep my home directory. Is there a way to move the home directory to a separate partition? I don't have an external hard drive available to back up my ...
9
votes
4answers
1k views
The merits of a partitionless filesystem
I ran into something a couple of weeks ago that I'd never seen before: A filesystem (ext3 I believe) installed to a storage device without a partition. In essence /dev/sdb was the entire filesystem. I ...
8
votes
6answers
13k views
How to partition 22TB disk?
I have a 22TB disk on /dev/sdb. How do I create a 22TB partition? Don't really care about the file system - ext4 or zfs is fine.
Running CentOS 6.2 - Partition will be used as a data dump. Only a ...
8
votes
2answers
2k views
Clear unused space with zeros (ext3,ext4)
How to clear unused space with zeros ? (ext3,ext4)
I'm looking for something smarter than
cat /dev/zero > /mnt/X/big_zero ; sync; rm /mnt/X/big_zero
Like FSArchiver is looking for "used space" ...
8
votes
1answer
2k views
How does partprobe work?
I was looking for a way to refresh the scsi bus (or any other bus, for that matter) that would allow my kernel ( 2.6.18-194-el5 on CentOS 5.5) to know about the partitions on a drive, and I couldn't ...
8
votes
2answers
10k views
Create partition aligned using parted
I'm partitioning a non-SSD hard disk with parted because I want a GPT partition table.
parted /dev/sda mklabel gpt
Now, I'm trying to create partitions correctly aligned so I use the next command ...
7
votes
3answers
706 views
Why do we need to specify partition type in fdisk and later again in mkfs?
I'm a little confused about fdisk and mkfs.
So - here is typical USB flash drive partitioning and formatting:
umount /dev/sdb
fdisk fdisk /dev/sdb
Command (m for help): d
Selected partition 1
...
7
votes
5answers
370 views
Mounting a partition into a 'sandbox'
I'm wondering if this is possible. I want to set up a linux system that mounts / remote linux machine to / on the local machine. However, I want all changes on the local machine to be saved to ram so ...
7
votes
1answer
396 views
Can I convert an ext3 partition into ext4 without formatting?
my home directory is on a separate partition which still uses ext3. Is there a way to convert this partition into ext4 in a non-destructive way?
6
votes
3answers
834 views
How to read the in-memory (kernel) partition table of /dev/sda?
I accidentally overwrote my /dev/sda partition table with GParted (full story on AskUbuntu). Since I haven't rebooted yet and my filesystem is still perfectly usable, I was told I might be able to ...
6
votes
3answers
3k views
How to copy the partition layout of a whole disk using standard tools
I want to take a backup of the whole partition layout of a hard drive, including logical drives, so that I can restore that layout to another disk. I do not want to copy the contents of the ...
6
votes
2answers
19k views
Can I resize the root partition without uninstalling and reinstalling Linux (or losing data)?
I have started using a machine that has both Debian and Windows 7 installed. However, after installing some programs I started getting a message that there is not enough space. I knew that the system ...
6
votes
1answer
622 views
Move /usr to SSD
I have an SSD and regular HDD drive in my laptop. The SSD drive is not used at all; it is not even being mounted. I am using Arch Linux. I'd like to start using the SSD, and from what I have read I ...
6
votes
4answers
611 views
Difference between bootable and non-bootable partitions
What is the difference between a bootable and non-bootable partition? I know that a user cannot boot a system from a partition marked non-bootable and can from one marked bootable.
I want to know ...
6
votes
2answers
396 views
How to properly unplug/plug removable LVM2 device?
How to properly unplug (remove) and later plug (insert) removable (hot-plug, usb etc) storage device with LVM2 on it ?
I've found this note
Remove (unplug, eject):
lvchange -an ...
6
votes
1answer
766 views
How to properly align partitions?
I'm trying to understand what are the rules for creating correctly aligned partitions.
For the moment I'm playing with parted on a virtual machine, but I'm planning to move to a real hard disk when I ...
5
votes
6answers
241 views
What's the best tool chain or single tool to transform a NTFS to ext[n] filesystem?
I've decided to go Linux only, finally!
This also means that I have a bunch of disks still under NTFS.
I don't have spare space anywhere to transfer the files to and then just re-format the drive so ...
5
votes
2answers
718 views
Unpack files and directories from an image created by dd?
I created an image of an NTFS partition using dd.
I wonder if I can unload/unpack the files and directories in the image to any partition whose size is larger than the image size, so that I can ...
5
votes
2answers
179 views
Ignorantly dd'd /dev/sda*
I was trying to write an iso to a flash drive. I mistakenly thought that all /dev/sda* are flash drives attached to the system. I wasn't sure how to figure out which was which, so I just unplugged my ...
5
votes
4answers
5k views
List partition labels from the command line
Is there a command that will list all partitions along with their labels? sudo fdisk -l and sudo parted -l don't show labels by default.
EDIT: (as per comment below) I'm talking about ext2 labels - ...
5
votes
4answers
2k views
Convert image of a partition into image of a disk with partition table
I have an image of an existing partition generated with dd if=/dev/sdXN of=image.bin. Now I want to use this image as the basis for a virtual machine. I know how to convert the image into a format ...
5
votes
2answers
326 views
Defragging an ext partition?
Why don't ext2/3/4 need to be defragmented? Is there no fragmentation at all?
5
votes
2answers
1k views
Accidentally deleted the partitions on my boot disk. The system is still running. How can I recover?
I just accidentally scrubbed all the partitions from the wrong disk.
/dev/sda is the boot disk, and /dev/sdb is a new disk I am trying to set up as a RAID mirror.
I accidentally fat-fingered it, ...
5
votes
2answers
1k views
Finding the sector size of a partition
I answered this question, assuming that the *.img file had a sector size of 512.
How do I query a device, or the image of a device, to find the correct sector size?
5
votes
1answer
405 views
Partition not mounting from fstab
I have mounted a partition and add it to fstab file and then rebooted but I see that the partition is not mounted although it was added to fstab.
What is wrong, and how can I solve it?
fstab line:
...
5
votes
1answer
6k views
How to (safely) move /tmp to a different volume?
Today the /tmp directory filled up on a machine at work. The problem was, it was on the root partition which wasn't very big. In order to fix this, a co-worker created a /new/tmp directory elsewhere, ...
5
votes
3answers
324 views
how to use “Unusable” sectors outside defined partition boundaries
What might be a convenient way to stash some hidden data in the "Unusable" area following the last partition, or anywhere outside defined partition boundaries? For example, making it appear as a ...
5
votes
3answers
4k views
How do I partition a USB drive so that it's bootable and has a Windows-compatible data storage partition?
split from here
I have a 16gb flash drive, which I want a live ISO to boot from (via unetbootin or something similar). It'll be some 32bit distro that I can plug-in and boot on whatever computer I ...
5
votes
2answers
74 views
Rearrange partitions to install a second Linux distribution
I am new to Linux and just got some foggy idea of partition tables. To be precise here it is:
Model: ATA ST3500418AS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition ...
5
votes
1answer
2k views
How can I quickly copy a GPT partition scheme from one hard drive to another?
On a non GPT partition table I can do
sfdisk -d /dev/sda | sfdisk /dev/sdb
But sfdisk doesn't support GPT partition tables. What can I use instead?
I'm looking for a one or two command solution, ...
5
votes
1answer
759 views
Defragmentation of LVM2 logical volumes
Question: Is there a tool supporting de-fragmentation of LVM2 logical volumes ? (Making their extents into consistent sequences)
Preferably by defining desired order of extents (something like ...
5
votes
2answers
59 views
Linux/GParted can see partition table but dd bs=512 count=1 can't
I have an MBR formatted sd card and when connect to a Linux machine (xubuntu 12.04) it can mount a partition and parse the file system (as can GParted). However, when I try to read the MBR from the ...
5
votes
2answers
541 views
How can I diagnose and repair missing drive space?
I have a small ext3 / partition on a 2T drive which appears to have a discrepancy in its free space. How can I determine what is causing it and how it can be fixed.
After trying everything I could ...
5
votes
1answer
66 views
Why do some of my lvm partitions have “-real” appended to their names?
In the /dev/mapper directory I can see my lvm partitions, but then I'll see some other ones with the same names, but with "-real" appended to them.
What's that about?
5
votes
3answers
562 views
How to resize an LVM partition at the beginning
I have resized lvm partitions in the past, but after the resize there is space at the end of the partition. What I want to achive is to have the space at the beginning of the partition instead.
The ...
4
votes
4answers
166 views
If I have an SSD and a hard disk in a system, can the SSD act as cache for the hard disk?
Say I have some partitions; one on a SATA drive and one on an SSD. I want to create a "virtual" hybrid disk. Is this possible?
4
votes
3answers
3k views
Change the number of the partition from sda1 to sda2
I have a disk with two partitions: sda1 and sda2. I would like change the number of sda1 to sda2 and sda2 to sda1.
It's possible but I don't remember the procedure. i.e. My first partition will be ...
4
votes
4answers
8k views
How to extend CentOS 5 partition on VMware?
I have a CentOS 5 virtual machine and I added 20GB more to disk size. How do I initialize and extend the available space?
I'm new to Linux, so what should I do?
I tried loading GParted as well, ...
4
votes
2answers
335 views
Create a partition from a directory
I have a Linux system with only one partition /dev/sda1 on /dev/sda disk with / mount point. Is it possible to create partitions after installation?
e.g. create /dev/sda2 with the mount point /home/
...
4
votes
2answers
82 views
Why would I want to create more partitions if RHEL will only recognize up to 16?
During some basic RHEL training, I came across this blurb:
Although it's possible to create more, RHEL will recognize only up to 16 partitions on any individual SATA, SCSI, PATA, or virtual hard ...
