Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #265945

Re: 512e vs 4K sector confusion

From Timothy M Butterworth <timothy.m.butterworth@gmail.com>
Newsgroups linux.debian.user
Subject Re: 512e vs 4K sector confusion
Date 2024-01-14 19:20 +0100
Message-ID <HWdfr-35lQ-11@gated-at.bofh.it> (permalink)
References <HW3J7-2ZIb-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sun, Jan 14, 2024 at 9:37 AM Andy Smith <andy@strugglers.net> wrote:

> Hi,
>
> I've got a disk image that sits on top of an LVM logical volume
> that is on top of an mdadm RAID-1 that is on top of a pair of:
>
> Device Model:     Samsung SSD 870 EVO 4TB
> Sector Size:      512 bytes logical/physical
>
> so let';s say that is at /dev/foo/disk_image (where /dev/foo is the
> name of the LVM VG and disk_image is the LV)
>
> So,
>
> # fdisk -ul /dev/foo/disk_image
> Disk /dev/foo/disk_image: 400 GiB, 429496729600 bytes, 838860800 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
> Disklabel type: dos
> Disk identifier: 0x14409245
>
> Device                            Boot Start       End   Sectors  Size Id
> Type
> /dev/foo_disk_image                    2048 838858751 838856704  400G 83
> Linux
>
> So it's a 400G disk image with an MBR and a single partition, right?
>
> Now, I dd that disk image across the network to another machine
> which has a similar setup, except here the "foo" volume group is on
> a pair of
>
> Device Model:     HGST HUS726T6TALN6L4
> Sector Size:      4096 bytes logical/physical
>

4096 Bytes is 4K sector size.


Now, after the disk_image has arrived, it looks very odd. fdisk
> thinks it is 8 times bigger than it really is, and thinks it has 4K
> sectors. I can't use "kpartx" to get at the partition inside it, and
> fsck.ext4 doesn't like its first partition at all.
>
> Is there any way to make this work?
>
> If necessary and if there is a way, I *can* nuke off the target
> machine's "foo" volume group and recreate the RAID array if I have
> to make it 512e format. But obviously I'd like some way to move this
> disk image and have it still work without having to meddle inside it
> much — it is a VM disk.
>
> Thanks,
> Andy
>
> --
> https://bitfolk.com/ -- No-nonsense VPS hosting
>
>

-- 
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
⠈⠳⣄⠀⠀

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

512e vs 4K sector confusion Andy Smith <andy@strugglers.net> - 2024-01-14 09:10 +0100
  Re: 512e vs 4K sector confusion Andy Smith <andy@strugglers.net> - 2024-01-14 09:20 +0100
    Re: 512e vs 4K sector confusion "Alexander V. Makartsev" <avbetev@gmail.com> - 2024-01-14 12:30 +0100
    Re: 512e vs 4K sector confusion Arno Lehmann <al@its-lehmann.de> - 2024-01-14 12:40 +0100
  Re: 512e vs 4K sector confusion "Thomas Schmitt" <scdbackup@gmx.net> - 2024-01-14 14:30 +0100
    Re: 512e vs 4K sector confusion Andy Smith <andy@strugglers.net> - 2024-01-14 17:20 +0100
      Re: 512e vs 4K sector confusion "Thomas Schmitt" <scdbackup@gmx.net> - 2024-01-14 18:00 +0100
  Re: 512e vs 4K sector confusion Timothy M Butterworth <timothy.m.butterworth@gmail.com> - 2024-01-14 19:20 +0100
  Re: 512e vs 4K sector confusion Stefan Monnier <monnier@iro.umontreal.ca> - 2024-01-15 05:40 +0100
    Re: 512e vs 4K sector confusion Andy Smith <andy@strugglers.net> - 2024-01-15 06:40 +0100
      Re: 512e vs 4K sector confusion Nicolas George <george@nsup.org> - 2024-01-15 22:30 +0100
      Re: 512e vs 4K sector confusion Nicholas Geovanis <nickgeovanis@gmail.com> - 2024-01-15 22:30 +0100
        Re: 512e vs 4K sector confusion Andy Smith <andy@strugglers.net> - 2024-01-16 01:40 +0100
        Re: 512e vs 4K sector confusion Teemu Likonen <tlikonen@iki.fi> - 2024-01-16 17:40 +0100
      Re: 512e vs 4K sector confusion Andy Smith <andy@strugglers.net> - 2024-01-17 08:30 +0100
  Re: 512e vs 4K sector confusion Andy Smith <andy@strugglers.net> - 2024-01-20 22:30 +0100

csiph-web