Skip to content

Instantly share code, notes, and snippets.

@joseivanlopez
Last active April 11, 2019 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joseivanlopez/06e92d5784da7efad7a6feeeb8e2eac6 to your computer and use it in GitHub Desktop.
Save joseivanlopez/06e92d5784da7efad7a6feeeb8e2eac6 to your computer and use it in GitHub Desktop.

Partitioner with multidevice BTRFS

  • Show multidevice BTRFS in the general list of devices.
  • Mount point and label is empty for the devices belonging to a multidevice BTRFS.

New Type column

Columns Type and Fs Type will be merged into a new Type column on steroids:

  • Blk Device without fs:

    • not used:
      • Disk: vendor
      • Partition: partition id
      • RAID: RAID
      • LV: LV
      • Bcache: Bcache
    • used as PV: PV vg1
    • used by RAID: part of md0
    • used as backing Bcache: part of bcache0
    • used as caching Bcache: Bcache caching
  • Blk Device with fs:

    • no multidevice fs:
      • Disk: EXT3 disk
      • Partition: EXT3 partition [1]
      • RAID: EXT3 RAID
      • LV: EXT3 LV
      • Bcache: EXT3 Bcache
    • multidevice fs: part of BTRFS (/)
  • LVM VG:

    • always: LVM
  • Multidevice BTRFS:

    • always: BTRFS

[1] for some cases, the filesystem type is not enough (e.g., ESP).

Questions

  • Can a device belonging to Btrfs be encrypted?
<?xml version="1.0"?>
<!-- generated by libstorage-ng version 4.1.96, linux-rijh.(none), 2019-04-11 13:55:37 GMT -->
<Devicegraph>
<Devices>
<Disk>
<sid>42</sid>
<name>/dev/sda</name>
<region>
<length>419430400</length>
<block-size>512</block-size>
</region>
<topology/>
<range>256</range>
</Disk>
<Msdos>
<sid>43</sid>
</Msdos>
<Partition>
<sid>44</sid>
<name>/dev/sda1</name>
<region>
<start>2048</start>
<length>209715200</length>
<block-size>512</block-size>
</region>
<type>primary</type>
<id>7</id>
</Partition>
<Partition>
<sid>46</sid>
<name>/dev/sda2</name>
<region>
<start>213911552</start>
<length>205518848</length>
<block-size>512</block-size>
</region>
<type>primary</type>
<id>131</id>
</Partition>
<Disk>
<sid>48</sid>
<name>/dev/sdb</name>
<region>
<length>2147483648</length>
<block-size>512</block-size>
</region>
<topology/>
<range>256</range>
</Disk>
<Msdos>
<sid>49</sid>
</Msdos>
<Partition>
<sid>50</sid>
<name>/dev/sdb1</name>
<region>
<start>2048</start>
<length>8388608</length>
<block-size>512</block-size>
</region>
<type>primary</type>
<id>130</id>
</Partition>
<Swap>
<sid>51</sid>
<label>swap</label>
</Swap>
<MountPoint>
<sid>52</sid>
<path>swap</path>
<mount-by>uuid</mount-by>
<mount-type>swap</mount-type>
<active>true</active>
<in-etc-fstab>true</in-etc-fstab>
<freq>0</freq>
<passno>0</passno>
</MountPoint>
<Partition>
<sid>53</sid>
<name>/dev/sdb2</name>
<region>
<start>8390656</start>
<length>125829120</length>
<block-size>512</block-size>
</region>
<type>primary</type>
<id>131</id>
</Partition>
<Btrfs>
<sid>54</sid>
<label>suse_root</label>
</Btrfs>
<BtrfsSubvolume>
<sid>55</sid>
<id>5</id>
<path></path>
<default-btrfs-subvolume>true</default-btrfs-subvolume>
</BtrfsSubvolume>
<MountPoint>
<sid>56</sid>
<path>/</path>
<mount-by>uuid</mount-by>
<mount-type>btrfs</mount-type>
<active>true</active>
<in-etc-fstab>true</in-etc-fstab>
<freq>0</freq>
<passno>0</passno>
</MountPoint>
<Partition>
<sid>57</sid>
<name>/dev/sdb3</name>
<region>
<start>134219776</start>
<length>125829120</length>
<block-size>512</block-size>
</region>
<type>primary</type>
<id>253</id>
</Partition>
<Partition>
<sid>59</sid>
<name>/dev/sdb4</name>
<region>
<start>260048896</start>
<length>1698693120</length>
<block-size>512</block-size>
</region>
<type>extended</type>
<id>15</id>
</Partition>
<Partition>
<sid>60</sid>
<name>/dev/sdb5</name>
<region>
<start>260050944</start>
<length>629145600</length>
<block-size>512</block-size>
</region>
<type>logical</type>
<id>131</id>
</Partition>
<Xfs>
<sid>61</sid>
<label>home</label>
</Xfs>
<MountPoint>
<sid>62</sid>
<path>/home</path>
<mount-by>uuid</mount-by>
<mount-type>xfs</mount-type>
<active>true</active>
<in-etc-fstab>true</in-etc-fstab>
<freq>0</freq>
<passno>0</passno>
</MountPoint>
<Partition>
<sid>63</sid>
<name>/dev/sdb6</name>
<region>
<start>889198592</start>
<length>1048576000</length>
<block-size>512</block-size>
</region>
<type>logical</type>
<id>131</id>
</Partition>
<Xfs>
<sid>64</sid>
<label>data</label>
</Xfs>
<Partition>
<sid>65</sid>
<name>/dev/sdb7</name>
<region>
<start>1937776640</start>
<length>20965376</length>
<block-size>512</block-size>
</region>
<type>logical</type>
<id>253</id>
</Partition>
<Disk>
<sid>66</sid>
<name>/dev/sdc</name>
<region>
<length>1048576000</length>
<block-size>512</block-size>
</region>
<topology/>
<range>256</range>
</Disk>
<LvmVg>
<sid>68</sid>
<vg-name>vg1</vg-name>
<uuid></uuid>
<region>
<length>127999</length>
<block-size>4194304</block-size>
</region>
<reserved-extents>0</reserved-extents>
</LvmVg>
<LvmPv>
<sid>69</sid>
<uuid></uuid>
</LvmPv>
<LvmLv>
<sid>70</sid>
<name>/dev/vg1/lv1</name>
<region>
<length>127999</length>
<block-size>4194304</block-size>
</region>
<dm-table-name>vg1-lv1</dm-table-name>
<lv-name>lv1</lv-name>
<lv-type>normal</lv-type>
<uuid></uuid>
<stripes>1</stripes>
<stripe-size>4096</stripe-size>
</LvmLv>
<Btrfs>
<sid>73</sid>
</Btrfs>
<BtrfsSubvolume>
<sid>74</sid>
<id>5</id>
<path></path>
<default-btrfs-subvolume>true</default-btrfs-subvolume>
</BtrfsSubvolume>
<MountPoint>
<sid>75</sid>
<path>/srv</path>
<mount-by>device</mount-by>
<mount-type>btrfs</mount-type>
<active>true</active>
<in-etc-fstab>true</in-etc-fstab>
<freq>0</freq>
<passno>0</passno>
</MountPoint>
<BtrfsSubvolume>
<sid>76</sid>
<id>-1</id>
<path>tmp</path>
</BtrfsSubvolume>
<MountPoint>
<sid>77</sid>
<path>/srv/tmp</path>
<mount-by>device</mount-by>
<mount-options>subvol=/tmp</mount-options>
<mount-type>btrfs</mount-type>
<active>true</active>
<in-etc-fstab>true</in-etc-fstab>
<freq>0</freq>
<passno>0</passno>
</MountPoint>
<BtrfsSubvolume>
<sid>78</sid>
<id>-1</id>
<path>home</path>
</BtrfsSubvolume>
<MountPoint>
<sid>79</sid>
<path>/srv/home</path>
<mount-by>device</mount-by>
<mount-options>subvol=/home</mount-options>
<mount-type>btrfs</mount-type>
<active>true</active>
<in-etc-fstab>true</in-etc-fstab>
<freq>0</freq>
<passno>0</passno>
</MountPoint>
<Bcache>
<sid>80</sid>
<name>/dev/bcache0</name>
<sysfs-name>bcache0</sysfs-name>
<sysfs-path>/devices/virtual/block/bcache0</sysfs-path>
<region>
<length>209715184</length>
<block-size>512</block-size>
</region>
<topology/>
<range>256</range>
<type>backed</type>
<cache-mode>writethrough</cache-mode>
<writeback-percent>10</writeback-percent>
<sequential-cutoff>8388608</sequential-cutoff>
</Bcache>
<BcacheCset>
<sid>81</sid>
<uuid></uuid>
</BcacheCset>
<Md>
<sid>107</sid>
<name>/dev/md0</name>
<sysfs-name>md0</sysfs-name>
<sysfs-path>/devices/virtual/block/md0</sysfs-path>
<region>
<length>146269952</length>
<block-size>512</block-size>
</region>
<topology>
<optimal-io-size>131072</optimal-io-size>
</topology>
<range>256</range>
<md-level>RAID0</md-level>
<chunk-size>65536</chunk-size>
</Md>
</Devices>
<Holders>
<User>
<source-sid>42</source-sid>
<target-sid>43</target-sid>
</User>
<Subdevice>
<source-sid>43</source-sid>
<target-sid>44</target-sid>
</Subdevice>
<Subdevice>
<source-sid>43</source-sid>
<target-sid>46</target-sid>
</Subdevice>
<User>
<source-sid>48</source-sid>
<target-sid>49</target-sid>
</User>
<Subdevice>
<source-sid>49</source-sid>
<target-sid>50</target-sid>
</Subdevice>
<FilesystemUser>
<source-sid>50</source-sid>
<target-sid>51</target-sid>
</FilesystemUser>
<User>
<source-sid>51</source-sid>
<target-sid>52</target-sid>
</User>
<Subdevice>
<source-sid>49</source-sid>
<target-sid>53</target-sid>
</Subdevice>
<Subdevice>
<source-sid>54</source-sid>
<target-sid>55</target-sid>
</Subdevice>
<FilesystemUser>
<source-sid>53</source-sid>
<target-sid>54</target-sid>
</FilesystemUser>
<User>
<source-sid>54</source-sid>
<target-sid>56</target-sid>
</User>
<Subdevice>
<source-sid>49</source-sid>
<target-sid>57</target-sid>
</Subdevice>
<Subdevice>
<source-sid>49</source-sid>
<target-sid>59</target-sid>
</Subdevice>
<Subdevice>
<source-sid>59</source-sid>
<target-sid>60</target-sid>
</Subdevice>
<FilesystemUser>
<source-sid>60</source-sid>
<target-sid>61</target-sid>
</FilesystemUser>
<User>
<source-sid>61</source-sid>
<target-sid>62</target-sid>
</User>
<Subdevice>
<source-sid>59</source-sid>
<target-sid>63</target-sid>
</Subdevice>
<FilesystemUser>
<source-sid>63</source-sid>
<target-sid>64</target-sid>
</FilesystemUser>
<Subdevice>
<source-sid>59</source-sid>
<target-sid>65</target-sid>
</Subdevice>
<User>
<source-sid>66</source-sid>
<target-sid>69</target-sid>
</User>
<Subdevice>
<source-sid>69</source-sid>
<target-sid>68</target-sid>
</Subdevice>
<Subdevice>
<source-sid>68</source-sid>
<target-sid>70</target-sid>
</Subdevice>
<Subdevice>
<source-sid>73</source-sid>
<target-sid>74</target-sid>
</Subdevice>
<FilesystemUser>
<source-sid>70</source-sid>
<target-sid>73</target-sid>
</FilesystemUser>
<User>
<source-sid>73</source-sid>
<target-sid>75</target-sid>
</User>
<Subdevice>
<source-sid>74</source-sid>
<target-sid>76</target-sid>
</Subdevice>
<User>
<source-sid>76</source-sid>
<target-sid>77</target-sid>
</User>
<Subdevice>
<source-sid>74</source-sid>
<target-sid>78</target-sid>
</Subdevice>
<User>
<source-sid>78</source-sid>
<target-sid>79</target-sid>
</User>
<User>
<source-sid>44</source-sid>
<target-sid>80</target-sid>
</User>
<User>
<source-sid>46</source-sid>
<target-sid>81</target-sid>
</User>
<User>
<source-sid>81</source-sid>
<target-sid>80</target-sid>
</User>
<MdUser>
<source-sid>57</source-sid>
<target-sid>107</target-sid>
<sort-key>1</sort-key>
</MdUser>
<MdUser>
<source-sid>65</source-sid>
<target-sid>107</target-sid>
<sort-key>2</sort-key>
</MdUser>
</Holders>
</Devicegraph>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment