Commit Graph

1189 Commits

Author SHA1 Message Date
Mike Fleetwood ab2d4f5ee6 Create BlockSpecial class and use in LVM2_PV_Info (#767842)
In some cases creating an LVM2 Physical Volume on top of a DMRaid array
reports no usage information and this partition warning:
    Unable to read the contents of this file system!
    Because of this some operations may be unavailable.
    The cause might be a missing software package.
    The following list of software packages is required for lvm2
    pv file system support: lvm2.

For example on Ubuntu 14.04 LTS (with GParted built with
--enable-libparted-dmraid) create an LVM2 PV in a DMRaid array
partition.  GParted uses this command:
    # lvm pvcreate -M 2 /dev/mapper/isw_bacdehijbd_MyArray0p2

But LVM reports the PV having a different name:
    # lvm pvs
      PV                                                VG   Fmt  Attr PSize PFree
      /dev/disk/by-id/dm-name-isw_bacdehijbd_MyArray0p2      lvm2 a--  1.00g 1.00g

This alternate name is loaded into the LVM2_PV_Info module cache.  Hence
when GParted queries partition /dev/mapper/isw_bacdehijbd_MyArray0p2 it
has no PV information against that name and reports unknown usage.

However they are actually the same block special device; major 252,
minor 2:
    # ls -l /dev/mapper/isw_bacdehijbd_MyArray0p2
    brw-rw---- 1 root disk 252, 2 Jul  2 11:09 /dev/mapper/isw_bacdehijbd_MyArray0p2

    # ls -l /dev/disk/by-id/dm-name-isw_bacdehijbd_MyArray0p2
    lrwxrwxrwx 1 root root 10 Jul  2 11:09 /dev/disk/by-id/dm-name-isw_bacdehijbd_MyArray0p2 -> ../../dm-2
    # ls -l /dev/dm-2
    brw-rw---- 1 root disk 252, 2 Jul  2 11:09 /dev/dm-2

To determine if two names refer to the same block special device their
major, minor numbers need to be compared, instead of string comparing
their names.

Implement class BlockSpecial which encapsulates the name and major,
minor numbers for a block special device.  Also performs comparison as
needed.  See bug 767842 comments 4 and 5 for further investigation and
decision for choosing to implement a class.

Replace name strings in the LVM2_PV_Info module with BlockSpecial
objects performing correct block special device comparison.

Bug 767842 - File system usage missing when tools report alternate block
             device names
2016-08-06 09:47:58 -06:00
Balázs Úr 7745abd767 Updated Hungarian translation 2016-08-04 21:59:54 +00:00
Piotr Drąg 0778e4fdd1 Add Language headers to po files
Future versions of gettext will fail if this header is missing.
2016-07-21 22:35:03 +02:00
Andika Triwidada b8de6d0006 Updated Indonesian translation 2016-07-08 12:56:16 +00:00
Tiago Santos b2a4956d77 Updated Portuguese translation 2016-07-04 14:01:27 +00:00
Milo Casagrande 553a76abfa Updated Italian translation 2016-06-13 09:07:21 +00:00
GNOME Translation Robot a2fecf01ee Updated Scottish Gaelic translation 2016-06-11 08:02:16 +00:00
Marek Černocký 991edb9566 Updated Czech translation 2016-06-10 07:38:36 +02:00
A S Alam 7b9bf718e3 Completed Punjabi Translation 2016-06-09 15:12:12 -05:00
Daniel Șerbănescu 20706140f3 Updated Romanian translation 2016-06-09 19:42:33 +00:00
A S Alam b7613cd609 updated Punjabi Translation 2016-06-08 18:44:31 -05:00
Wolfgang Stöggl 03ad03a500 Updated German translation 2016-06-07 12:12:13 +00:00
Alexandre Franke da17e38bcd Updated French translation 2016-06-07 08:35:36 +00:00
Enrico Nicoletto 58d409787b Updated Brazilian Portuguese translation 2016-05-30 20:28:07 +00:00
Daniel Mustieles 0cc98564cf Updated Spanish translation 2016-05-30 19:15:39 +02:00
Piotr Drąg a5f1d2afec Updated Polish translation 2016-05-21 15:08:42 +02:00
Anders Jonsson 22dcc58fab Updated Swedish translation 2016-05-21 11:11:40 +00:00
Dušan Kazik 2477dffc06 Updated Slovak translation 2016-05-21 07:31:12 +00:00
Baurzhan Muftakhidinov 7bf8760346 Updated Kazakh translation 2016-05-17 10:37:49 +00:00
Daniel Șerbănescu bf00339d71 Updated Romanian translation 2016-04-22 07:54:08 +00:00
Sveinn í Felli c8bc8a81f1 Updated Icelandic translation 2016-04-19 19:58:41 +00:00
Cédric Valmary a77698c64b Updated Occitan translation 2016-04-19 17:42:52 +00:00
Rafael Fontenelle 3a8ba26937 Updated Brazilian Portuguese translation 2016-04-19 17:18:09 +00:00
Claude Paroz 3f28e5df2b Updated French translation 2016-04-19 18:52:54 +02:00
Γιάννης Κουτσούκος a93a678a7b Updated Greek translation 2016-04-17 18:39:33 +00:00
Stas Solovey 127e02cd04 Updated Russian translation 2016-04-13 18:19:30 +00:00
Cédric Valmary 50e47e41df Updated Occitan translation 2016-04-11 19:35:47 +00:00
YunQiang Su 85ab4a82df Update zh_CN translation 2016-04-06 15:00:00 +08:00
Shi Jing ce20293dda Update zh_CN translation 2016-04-06 14:56:20 +08:00
Milo Casagrande c2e1cf38e2 Updated Italian translation 2016-04-05 07:18:42 +00:00
Muhammet Kara 7cf90f9e42 Updated Turkish translation 2016-03-28 11:19:43 +00:00
Seong-ho Cho c0b14f77f6 Updated Korean translation 2016-03-16 05:37:25 +00:00
Marek Černocký 53633b4f7e Updated Czech translation 2016-03-14 03:37:27 +01:00
Aurimas Černius e36a6f0799 Updated Lithuanian translation 2016-03-13 21:44:34 +02:00
Tom Tryfonidis 7fe7983972 Updated Greek translation 2016-03-09 21:48:17 +00:00
Balázs Úr 48ca3d9420 Updated Hungarian translation 2016-03-04 22:21:44 +00:00
Rafael Fontenelle 461e5be8a8 Updated Brazilian Portuguese translation 2016-02-24 13:04:29 +00:00
Rafael Fontenelle 99cb9e6718 Updated Brazilian Portuguese translation 2016-02-24 11:41:21 +00:00
Josef Andersson 787871c4af Updated Swedish translation 2016-02-24 09:34:44 +00:00
hanniedu b04ce3e312 Update Dutch translation 2016-02-22 16:39:57 +01:00
Мирослав Николић fe97e564b0 Updated Serbian translation 2016-02-21 07:59:02 +01:00
Mike Fleetwood 0ca8ed7369 Write a generic progress bar class (#760709)
Write a generic progress bar class.  Has the following features:
* Has separate progress and target numbers, rather than a single
  completion fraction, to enable the the next feature.
* Optionally generates text reporting the amount of data copied using
  the progress and target numbers like this:
      "1.00 MiB of 16.00 MiB copied"
* After running for 5 seconds, also add estimated remaining time.
  (Waits to allow the data copying rate to settle down a little before
  estimating the remaining time).  Looks like this:
      "1.00 MiB of 16.00 MiB copied (00:01:59) remaining)"

The ProgressBar class is not driving the visual progress bar yet.  It
has just been added into the internal block copy algorithm and generates
debug messages showing the progress bar is operating correctly.
Debugging looks like this:

    DEBUG: ProgressBar::start(target=2.0636e+09, text_mode=PROGRESSBAR_TEXT_COPY_BYTES)
    DEBUG: ProgressBar::update(progress=1.30023e+08) m_fraction=0.0630081 m_text="124.00 MiB of 1.92 GiB copied"
    DEBUG: ProgressBar::update(progress=2.67387e+08) m_fraction=0.129573 m_text="255.00 MiB of 1.92 GiB copied"
    DEBUG: ProgressBar::update(progress=4.0475e+08) m_fraction=0.196138 m_text="386.00 MiB of 1.92 GiB copied"
    ...
    DEBUG: ProgressBar::update(progress=1.13351e+09) m_fraction=0.549289 m_text="1.06 GiB of 1.92 GiB copied (00:00:04 remaining)"
    DEBUG: ProgressBar::update(progress=1.26249e+09) m_fraction=0.611789 m_text="1.18 GiB of 1.92 GiB copied (00:00:04 remaining)"
    DEBUG: ProgressBar::update(progress=1.39041e+09) m_fraction=0.67378 m_text="1.29 GiB of 1.92 GiB copied (00:00:03 remaining)"
    ...
    DEBUG: ProgressBar::update(progress=1.97552e+09) m_fraction=0.957317 m_text="1.84 GiB of 1.92 GiB copied (00:00:00 remaining)"
    DEBUG: ProgressBar::update(progress=2.0636e+09) m_fraction=1 m_text="1.92 GiB of 1.92 GiB copied"
    DEBUG: ProgressBar::stop()

Bug 760709 - Add progress bars to XFS and EXT2/3/4 file system specific
             copy methods
2016-02-12 09:09:56 -07:00
Daniel Mustieles 2281ce92f4 Updated Spanish translation 2016-02-07 13:18:01 +01:00
Mario Blättermann da08094f95 Updated German translation 2016-01-31 19:45:43 +01:00
Piotr Drąg b5a204d7ca Updated Polish translation 2016-01-31 16:37:48 +01:00
Dušan Kazik 3b239c3cbd Updated Slovak translation 2016-01-30 18:21:01 +00:00
Mike Fleetwood 99ff0c7628 Add PartitionLUKS class and create objects (#760080)
Absolute minimum implementation of a PartitionLUKS class which can be
constructed, polymorphically copied and destroyed.  Contains an
"encrypted" member of type Partition to represent the encrypted file
system within the LUKS format.

Create PartitionLUKS objects instead of base Partition objects when a
LUKS formatted partition is found.  Only the base Partition object
member values have been populated, and the "encrypted" member remains
blank at this point.

Bug 760080 - Implement read-only LUKS support
2016-01-29 13:41:40 -07:00
Mike Fleetwood 070d734e57 Add busy detection of LUKS mapping (#760080)
Provide a minimal implementation of a luks file system class which only
does busy detection.

NOTE:
For now, read-only LUKS support, a LUKS partition will be busy when a
dm-crypt mapping exists.  Later when read-write LUKS support is added
GParted will need to look at the busy status of the encrypted file
system within the open LUKS partition and map LUKS partition busy status
to encryption being open or closed.

Bug 760080 - Implement read-only LUKS support
2016-01-29 13:41:40 -07:00
Mike Fleetwood b77a6be76b Add initial loading of LUKS mapping details (#760080)
Load basic details of active Device-mapper encryption mappings from the
kernel.  Use dmsetup active targets.

    # cryptsetup luksFormat /dev/sdb5
    # cryptsetup luksFormat /dev/sdb6
    # cryptsetup luksOpen /dev/sdb6 sdb6_crypt
    # ls -l /dev/mapper/sdb6_crypt /dev/dm-0
    lrwxrwxrwx. 1 root root 7 Nov 15 09:03 /dev/mapper/sdb6_crypt -> ../dm-0
    brw-rw----. 1 root disk 253, 0 Nov 15 09:03 /dev/dm-0
    # ls -l /dev/sdb6
    brw-rw----. 1 root disk 8, 22 Nov 15 09:02 /dev/sdb6
    # dmsetup table --target crypt
    sdb6_crypt: 0 1044480 crypt aes-cbc-essiv:sha256 0000000000000000000000000000000000000000000000000000000000000000 0 8:22 4096

So far just load the mapping name and underlying block device reference
(path or major, minor pair).

Note that all supported kernels appear to report the underlying block
device as major, minor pair in the dmsetup output.  Underlying block
device paths are added to the cache when found during a search to avoid
stat(2) call on subsequent searches for the same path.

Prints debugging to show results, like this:

    # ./gpartedbin
    ======================
    libparted : 2.4
    ======================
    DEBUG: /dev/sdb5: LUKS closed
    DEBUG: /dev/sdb6: LUKS open mapping /dev/mapper/sdb6_crypt

Bug 760080 - Implement read-only LUKS support
2016-01-29 13:41:40 -07:00
Mike Fleetwood 06b8a3a14a Use pointers to Partitions in PartitionVector class (#759726)
The PartitionVector class is now internally using pointers to Partition
objects and taking on management of their lifetimes.  It therefore has
to implement the Big 3: destructor, copy constructor and copy assignment
operator [1][2].  This is because the implicitly-defined copy
constructor and assignment operator perform memberwise "shallow copying"
and the destructor does nothing.  This not correct for classes which
contain non-class types such as raw pointers.

The semantics of the interface still copies each Partition object into
the PartitionVector when they are added with push_back() and insert().

Note that a PartitionVector object is explicitly copy assigned in
Win_GParted::Refresh_Visual().  They are also implicitly copied when
(1) the implementing vector is resized larger to allow it to hold more
pointers to Partition objects than it previously had capacity for; and
(2) a Partition object is copied including the logicals PartitionVector
member.

[1] The rule of three/five/zero
    http://en.cppreference.com/w/cpp/language/rule_of_three
[2] Rule of Three
    https://en.wikipedia.org/wiki/Rule_of_three_%28C%2B%2B_programming%29

Bug 759726 - Implement Partition object polymorphism
2016-01-26 10:11:35 -07:00