Package: util-linux
Version: 2.20.1-5.2
Severity: normal

addpart seems to have serious issues above 2147483648 I think. This results in
partitions starting at 0 or having length 0.

As a workaround I copied partx_add_partition from the current linux-utils repo
and called it, basically like that:

----
static inline int partx_add_partition(int fd, int partno,
      uint64_t start, uint64_t size)
{
  struct blkpg_ioctl_arg a;
  struct blkpg_partition p;

  p.pno = partno;
  p.start = start << 9;
  p.length = size << 9;
  p.devname[0] = 0;
  p.volname[0] = 0;
  a.op = BLKPG_ADD_PARTITION;
  a.flags = 0;
  a.datalen = sizeof(p);
  a.data = &p;

  return ioctl(fd, BLKPG, &a);
}

partx_add_partition(fd, 3, 8392704ULL, 2930259968ULL);
----

Worked fine.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.6-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages util-linux depends on:
ii  debconf [debconf-2.0]  1.5.46
ii  dpkg                   1.16.9
ii  initscripts            2.88dsf-34
ii  install-info           4.13a.dfsg.1-10
ii  libblkid1              2.20.1-5.2
ii  libc6                  2.13-37
ii  libncurses5            5.9-10
ii  libselinux1            2.1.9-5
ii  libslang2              2.2.4-15
ii  libtinfo5              5.9-10
ii  libuuid1               2.20.1-5.2
ii  lsb-base               4.1+Debian9
ii  tzdata                 2012i-1
ii  zlib1g                 1:1.2.7.dfsg-13

util-linux recommends no packages.

Versions of packages util-linux suggests:
ii  dosfstools          3.0.13-1
ii  kbd                 1.15.3-9
pn  util-linux-locales  <none>

-- debconf information excluded


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to