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.

learn more… | top users | synonyms (1)

42
votes
1answer
1k views

Why are there so many different ways to measure disk usage?

When I sum up the sizes of my files, I get one figure. If I run du, I get another figure. If I run du on all the files on my partition, it doesn't match what df claims is used. Why are there so many ...
38
votes
11answers
8k 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 ...
37
votes
6answers
15k 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 ...
28
votes
9answers
10k 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 ...
23
votes
3answers
7k 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?
22
votes
2answers
6k 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 ...
22
votes
7answers
4k 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 ...
21
votes
1answer
19k 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% ...
20
votes
2answers
28k 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 ...
16
votes
4answers
10k 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" ...
15
votes
3answers
20k 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 ...
13
votes
10answers
23k 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 - ...
13
votes
6answers
28k 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 ...
13
votes
6answers
6k 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 ...
12
votes
4answers
3k 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 ...
12
votes
3answers
7k 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 ...
11
votes
4answers
3k 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 ...
11
votes
1answer
865 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
10
votes
2answers
727 views

What is this 1K logical partition?

I noticed that I have a strange partition under sda3, with a size of 1K. I am about to reformat my hard drive and re-install my OS with Ubuntu 14.04 while creating separate partitions for / and /home. ...
10
votes
2answers
39k 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 ...
9
votes
2answers
10k views

How to reduce Volume Group size in LVM?

[root@localhost ~] vgdisplay --- Volume group --- VG Name vg_root System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 7 VG ...
9
votes
1answer
11k 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, ...
9
votes
1answer
4k 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 ...
9
votes
3answers
17k 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 ...
9
votes
1answer
2k 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 ...
9
votes
1answer
338 views

How can Solaris sub-partitions be accessed in FreeBSD?

First of all, Linux detects the partitions: sdg1: <solaris: [s0] sdg5 [s1] sdg6 [s2] sdg7 [s8] sdg8 > However, FreeBSD 9.0 shows only the main partition. Is it possible that only Solaris ...
8
votes
1answer
580 views

Does Linux still have to reside within the first XX cylinders of a HDD?

It's been a while since I last bothered with partitioning my hard drive, but now it's time again and I remember last time I did this there was a requirement to put the root partition (or only GRUB?) ...
8
votes
5answers
472 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 ...
8
votes
4answers
4k 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 ...
8
votes
1answer
467 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?
7
votes
6answers
25k 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, ...
7
votes
3answers
1k 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
1answer
3k 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, ...
7
votes
5answers
19k views

How to salvage an unreadable usb flash drive

I have a 16GB USB flash drive that somehow got corrupted to the point in which even fdisk -l can't find it (I get a one-line error message saying: "Unable to open /dev/sdc") However, it is being ...
7
votes
1answer
66 views

Why would a partition be in use by the system if it isn't mounted?

I've been migrating my system from btrfs to ext4 after running into performance issues with VMs. I have two hard drives in my laptop to work with. I've successfully moved my home partition, but the ...
6
votes
3answers
3k 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
2answers
381 views

Defragging an ext partition?

Why don't ext2/3/4 need to be defragmented? Is there no fragmentation at all?
6
votes
1answer
918 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
1answer
284 views

Why are there 2048 sectors of free space between each logical partition?

I know about the advanced format and setting 2048 free sectors at the beginning of a disk. But I just converted a partition table of my disk from MS-DOS to GPT, and I noticed this: Before: Number ...
6
votes
4answers
1k 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
3answers
2k views

How to clone a NTFS partition (WinXP) from a damaged disk to a new one?

I'm an Italian Windows programmer. I know almost nothing of Linux, so please be patient if the question is dumb and pardon my bad english. I need to clone a NTFS partition from a damaged, near to die ...
6
votes
2answers
972 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
2answers
5k views

How can I resize my root partition in Debian?

I am trying to add space to my root partition and am really not sure the safest way to go about it. I have read this thread, Can I resize the root partition without uninstalling and reinstalling ...
6
votes
3answers
1k views

Primary vs Logical partition

I know that you can only have 4 primary partitions on a hard drive. But if you're using less than 4, is there a benefit/penalty for using logical partitions?
6
votes
1answer
2k 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
250 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
6k 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
2answers
3k 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
200 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
5answers
3k views

Arch GRUB asking for /run/lvm/lvmetad.socket on a non lvm disk

I am running this script based on the ArchWiki setup procedure. It fails on the GRUB configuration step I am using the archlinux-2013.12.01-dual.iso inside VMware Player with 1 GB ram, sda is 810 ...