You are not logged in.

#1 2012-04-04 23:47:42

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

I'd like to physically move a partition, but it's an LVM partition...

So GParted can't do it.

I'd like to scoot my partition over because it's not aligned

[rob ~ ]$ sudo fdisk -l
Password: 

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x702e5435

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *   976575285   976768064       96390   83  Linux
/dev/sda2              63   976575284   488287611   8e  Linux LVM

It starts at 63. I've heard that if I just move the partition back and forth with the most recent GParted, it will align the sectors properly. I have a few MB of unpartitioned wiggle room on the disk.

Since I can't use GParted, what is the easiest/quickest way to do this? It almost certainly wont be "worth it," but I'm pretty hellbent anyway.

Offline

#2 2012-04-05 15:44:12

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,392

Re: I'd like to physically move a partition, but it's an LVM partition...

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors

Harddrives normally start with sector 0, cylinder 0 .
On your harddrive sector 63 should be the first sector on cylinder 1, and thus aligned perfectly.

Or do you mean another kind of alignment ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2012-04-05 21:13:39

akspecs
Member
Registered: 2012-02-11
Posts: 179

Re: I'd like to physically move a partition, but it's an LVM partition...

If your disk was a GPT disk I think to tool in the repo is called gptfdisk which installs cgdisk.  That had an alignment tool if I remember correctly.  Why u no put guid partition table!?

Offline

#4 2012-04-05 21:38:05

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: I'd like to physically move a partition, but it's an LVM partition...

My disk is not a GPT disk. It's not an SSD, either.

I was under the impression that newer disks have 4k sectors, but that starting at 63 is somehow good for 512 byte sectors and inefficient for 4k sector disks...

I think it's obvious I don't really know what I'm talking about.

Apparently though, you can call fdisk with -S 4096 to tell it to use 4k sectors.

Offline

#5 2012-04-06 14:18:28

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: I'd like to physically move a partition, but it's an LVM partition...

If I'm not mistaken fdisk does align partitions to 4k sectors by default now, even for disks with 512byte sectors (the wasted space is minimal).

For disks with 512byte sectors, starting at sector 63 means aligning that partition to the start of the first cylinder, I don't know why that is a good idea but many program like to have partitions aligned to cylinder boundaries.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#6 2012-04-06 14:31:02

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: I'd like to physically move a partition, but it's an LVM partition...

R00KIE wrote:

If I'm not mistaken fdisk does align partitions to 4k sectors by default now, even for disks with 512byte sectors (the wasted space is minimal).

Yup.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#7 2012-04-06 22:19:56

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,392

Re: I'd like to physically move a partition, but it's an LVM partition...

R00KIE wrote:

For disks with 512byte sectors, starting at sector 63 means aligning that partition to the start of the first cylinder, I don't know why that is a good idea but many program like to have partitions aligned to cylinder boundaries.

The read/write heads in a harddisk can only access 1 cylinder at any given time, to access another cylinder they need to be moved physically.
This takes time and slows things down.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#8 2012-04-08 13:50:49

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: I'd like to physically move a partition, but it's an LVM partition...

Lone_Wolf wrote:

The read/write heads in a harddisk can only access 1 cylinder at any given time, to access another cylinder they need to be moved physically.
This takes time and slows things down.

It makes sense but I suppose that's not the only reason, one cylinder doesn't hold that much data so the heads will need to move between cylinders to get data, besides it is quite probable that data will be scattered in several cylinders due to fragmentation and requesting different files so requesting sector X or sector X+1 will be almost the same.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2012-04-08 14:46:36

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: I'd like to physically move a partition, but it's an LVM partition...

Apparently, depending on the hard drive, partition misalignment because of the 4k sector stuff can degrade write performance up to 30%. I assume this is writing many small files.

Anyway, as for my issue, I tried just backing up all my stuff, blowing up my partitions. Then I recreated the partitions (properly aligned) and dumped my stuff back onto them. That caused nothing but headaches, so I reinstalled. :-p

Luckily, I had all my config files and my whole home directory backed up, so it wasn't too horrible to get back the way I had it.

I haven't run anything too scientific, but Gnome's Disk Utility says my read speed went up from an average of ~81MB/s to ~84MB/s. This is probably because my hard drive has something called "SmartAlign" which Seagate swears takes care of everything. Apparently it does a pretty good job based on my experience here.

Offline

Board footer

Powered by FluxBB