[ale] what should I do when resizing ext4 partition

Ron Frazier (ALE) atllinuxenthinfo at techstarship.com
Tue Jun 11 00:53:19 EDT 2013


On 6/10/2013 8:53 PM, Derek Atkins wrote:
> Hi,
>
> "Ron Frazier (ALE)"<atllinuxenthinfo at techstarship.com>  writes:
>
>    
>> Hi all,
>>
>> I have a machine which dual boots windows and mint.  The 500 gb hdd is
>> mbr with 4 primary partitions, ntfs windows, ext4 mint, linux swap,
>> and ntfs data.  I'm cloning the drive to a 1 tb wd drive with WD
>> Acronis true image.  This will automatically proportionally resize the
>> partitions to the larger size.  I know what to do with windows to make
>> sure it's compatible after I reboot on the new drive.  However, is
>> there anything I should do with mint to make sure it boots properly
>> and doesn't damage the mint os or other parts of the drive?  As far as
>> I can tell, the swap file will not be changed.  As far as I can tell,
>> the partition order will remain the same, but the boundaries will
>> change.  When I'm done, I'll check it to make sure everything is on 1
>> MB boundaries, but the WD Acronis program should do that
>> automatically.
>>
>> Any help is appreciated.
>>      
> Once you repartition you'll need to re-install Grub.  I don't think
> Acronis will do that for you.  Beyond that, everything else should be
> fine.
>
>    
>> Sincerely,
>>
>> Ron
>>      
> -derek
>
>    
Hi Derek, and all,

Thanks to all for the help.

Well, it looks like I have a bit of egg on my face regarding the 4K 
sectors.  I was poking around with the Windows fsutil utility.  You can 
issue fsutil fsinfo ntfsinfo c: and get a status display about the hard 
drive.  It shows bytes per (logical) sector and bytes per physical 
sector.  (You can do the same thing in Linux with different commands.)  
On advanced format drive, the first number will be 512 and the second 
will be 4096.  On this drive, it showed 512 and 512.  I was under the 
impression that any hdd made after 2010 had to be advance format.  I was 
puzzled by this reading.  If the bytes per physical sector reading is 
empty or says not supported, you probably have a driver or bios problem, 
which can cause data corruption.  I googled around for a while trying to 
figure out if the drive was running in some sort of compatibility mode 
or something.  That probably wouldn't hurt my data, but could hurt 
performance.  I didn't find anything and, after a while, I went and 
looked at the spec sheet for the WD Black 1TB drive.  (By the way, if 
you want a 5 year warranty, you have to get black.)  I was very 
surprised to find that, even though it was made in 2013, it was NOT an 
advanced format drive.  So, the physical sectors really were 512 bytes.  
That eliminated any concerns I had about that causing a problem.  As far 
as I know, any HDD that has any flash memory, be it hybrid or ssd, will 
be advanced format, with 4K sectors.

On the Linux side of the fence, the boot loader was indeed broken.  I 
used the Ubuntu boot repair disc which rebuilt grub for me.  Mint then 
booted fine, but the swap partition was not active according to system 
monitor.  I used gparted to delete and recreate the swap partition, then 
rebooted.  The swap was still not active.  I looked at the /etc/fstab 
file and found in the comments that you can use blkid to read the UUID 
of each partition.  I also found that the UUID was wrong for both the / 
partition and the swap.  I'm not sure how the system booted in this 
case, but I'm not complaining.  I changed the UUID for both entries in 
the fstab file to the correct number for the / and swap partitions 
respectively and rebooted again.  This time, the swap partition was working.

So, Windows is happy, Mint is happy, I've got twice the HDD space, so 
I'm happy.

I ran WD Align on the HDD anyway to make sure the partitions are aligned 
in case I ever clone it to an advanced format drive.  Since WD Acronis 
True Image is advanced format aware, and since I created the swap 
partition around 1 MB boundaries with gparted, all the partitions showed 
that they were already properly aligned, just the way I wanted them.

Sincerely,

Ron


-- 

(PS - If you email me and don't get a quick response, you might want to
call on the phone.  I get about 300 emails per day from alternate energy
mailing lists and such.  I don't always see new email messages very quickly.)

Ron Frazier
770-205-9422 (O)   Leave a message.
linuxdude AT techstarship.com
Litecoin: LZzAJu9rZEWzALxDhAHnWLRvybVAVgwTh3
Bitcoin: 15s3aLVsxm8EuQvT8gUDw3RWqvuY9hPGUU



More information about the Ale mailing list