diff --git a/fsck_unshare_blocks.cpp b/fsck_unshare_blocks.cpp
index acc453c..ce6940a 100644
--- a/fsck_unshare_blocks.cpp
+++ b/fsck_unshare_blocks.cpp
@@ -121,7 +121,7 @@
 
   // Temporarily mount system so we can copy e2fsck_static.
   std::string system_root = get_system_root();
-  bool mounted = ensure_path_mounted_at(system_root.c_str(), "/mnt/system") != -1;
+  bool mounted = ensure_path_mounted_at(system_root, "/mnt/system") != -1;
   partitions.push_back(system_root);
 
   if (!mounted) {
diff --git a/install.cpp b/install.cpp
index 680937d..ce3d4f6 100644
--- a/install.cpp
+++ b/install.cpp
@@ -595,9 +595,9 @@
 
   if (needs_mount) {
     if (path[0] == '@') {
-      ensure_path_mounted(path.substr(1).c_str());
+      ensure_path_mounted(path.substr(1));
     } else {
-      ensure_path_mounted(path.c_str());
+      ensure_path_mounted(path);
     }
   }
 
diff --git a/logging.cpp b/logging.cpp
index 50642a2..283d115 100644
--- a/logging.cpp
+++ b/logging.cpp
@@ -46,7 +46,7 @@
 // fopen(3)'s the given file, by mounting volumes and making parent dirs as necessary. Returns the
 // file pointer, or nullptr on error.
 static FILE* fopen_path(const std::string& path, const char* mode) {
-  if (ensure_path_mounted(path.c_str()) != 0) {
+  if (ensure_path_mounted(path) != 0) {
     LOG(ERROR) << "Can't mount " << path;
     return nullptr;
   }
diff --git a/recovery.cpp b/recovery.cpp
index 7e1fa43..a680615 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -294,7 +294,7 @@
 
 // Returns the selected filename, or an empty string.
 static std::string browse_directory(const std::string& path, Device* device) {
-  ensure_path_mounted(path.c_str());
+  ensure_path_mounted(path);
 
   std::unique_ptr<DIR, decltype(&closedir)> d(opendir(path.c_str()), closedir);
   if (!d) {
@@ -572,7 +572,7 @@
           log_file += "." + std::to_string(i);
         }
 
-        if (ensure_path_mounted(log_file.c_str()) == 0 && access(log_file.c_str(), R_OK) == 0) {
+        if (ensure_path_mounted(log_file) == 0 && access(log_file.c_str(), R_OK) == 0) {
           entries.push_back(std::move(log_file));
         }
       };
@@ -836,7 +836,7 @@
       }
       case Device::MOUNT_SYSTEM:
         // the system partition is mounted at /mnt/system
-        if (ensure_path_mounted_at(get_system_root().c_str(), "/mnt/system") != -1) {
+        if (ensure_path_mounted_at(get_system_root(), "/mnt/system") != -1) {
           ui->Print("Mounted /system.\n");
         }
         break;
diff --git a/roots.cpp b/roots.cpp
index d448e6e..e988da0 100644
--- a/roots.cpp
+++ b/roots.cpp
@@ -29,6 +29,7 @@
 #include <unistd.h>
 
 #include <algorithm>
+#include <iostream>
 #include <string>
 #include <vector>
 
@@ -44,50 +45,48 @@
 
 #include "otautil/mounts.h"
 
-static struct fstab* fstab = nullptr;
+static Fstab fstab;
 
 extern struct selabel_handle* sehandle;
 
 void load_volume_table() {
-  fstab = fs_mgr_read_fstab_default();
-  if (!fstab) {
+  if (!ReadDefaultFstab(&fstab)) {
     LOG(ERROR) << "Failed to read default fstab";
     return;
   }
 
-  int ret = fs_mgr_add_entry(fstab, "/tmp", "ramdisk", "ramdisk");
-  if (ret == -1) {
-    LOG(ERROR) << "Failed to add /tmp entry to fstab";
-    fs_mgr_free_fstab(fstab);
-    fstab = nullptr;
-    return;
-  }
+  fstab.emplace_back(FstabEntry{
+      .mount_point = "/tmp", .fs_type = "ramdisk", .blk_device = "ramdisk", .length = 0 });
 
-  printf("recovery filesystem table\n");
-  printf("=========================\n");
-  for (int i = 0; i < fstab->num_entries; ++i) {
-    const Volume* v = &fstab->recs[i];
-    printf("  %d %s %s %s %" PRId64 "\n", i, v->mount_point, v->fs_type, v->blk_device, v->length);
+  std::cout << "recovery filesystem table" << std::endl << "=========================" << std::endl;
+  for (size_t i = 0; i < fstab.size(); ++i) {
+    const auto& entry = fstab[i];
+    std::cout << "  " << i << " " << entry.mount_point << " "
+              << " " << entry.fs_type << " " << entry.blk_device << " " << entry.length
+              << std::endl;
   }
-  printf("\n");
+  std::cout << std::endl;
 }
 
 Volume* volume_for_mount_point(const std::string& mount_point) {
-  return fs_mgr_get_entry_for_mount_point(fstab, mount_point);
+  auto it = std::find_if(fstab.begin(), fstab.end(), [&mount_point](const auto& entry) {
+    return entry.mount_point == mount_point;
+  });
+  return it == fstab.end() ? nullptr : &*it;
 }
 
 // Mount the volume specified by path at the given mount_point.
-int ensure_path_mounted_at(const char* path, const char* mount_point) {
-  return android::fs_mgr::EnsurePathMounted(fstab, path, mount_point) ? 0 : -1;
+int ensure_path_mounted_at(const std::string& path, const std::string& mount_point) {
+  return android::fs_mgr::EnsurePathMounted(&fstab, path, mount_point) ? 0 : -1;
 }
 
-int ensure_path_mounted(const char* path) {
+int ensure_path_mounted(const std::string& path) {
   // Mount at the default mount point.
-  return android::fs_mgr::EnsurePathMounted(fstab, path) ? 0 : -1;
+  return android::fs_mgr::EnsurePathMounted(&fstab, path) ? 0 : -1;
 }
 
-int ensure_path_unmounted(const char* path) {
-  return android::fs_mgr::EnsurePathUnmounted(fstab, path) ? 0 : -1;
+int ensure_path_unmounted(const std::string& path) {
+  return android::fs_mgr::EnsurePathUnmounted(&fstab, path) ? 0 : -1;
 }
 
 static int exec_cmd(const std::vector<std::string>& args) {
@@ -135,17 +134,17 @@
   return computed_size;
 }
 
-int format_volume(const char* volume, const char* directory) {
-  const Volume* v = android::fs_mgr::GetEntryForPath(fstab, volume);
+int format_volume(const std::string& volume, const std::string& directory) {
+  const FstabEntry* v = android::fs_mgr::GetEntryForPath(&fstab, volume);
   if (v == nullptr) {
     LOG(ERROR) << "unknown volume \"" << volume << "\"";
     return -1;
   }
-  if (strcmp(v->fs_type, "ramdisk") == 0) {
+  if (v->fs_type == "ramdisk") {
     LOG(ERROR) << "can't format_volume \"" << volume << "\"";
     return -1;
   }
-  if (strcmp(v->mount_point, volume) != 0) {
+  if (v->mount_point != volume) {
     LOG(ERROR) << "can't give path \"" << volume << "\" to format_volume";
     return -1;
   }
@@ -153,16 +152,16 @@
     LOG(ERROR) << "format_volume: Failed to unmount \"" << v->mount_point << "\"";
     return -1;
   }
-  if (strcmp(v->fs_type, "ext4") != 0 && strcmp(v->fs_type, "f2fs") != 0) {
+  if (v->fs_type != "ext4" && v->fs_type != "f2fs") {
     LOG(ERROR) << "format_volume: fs_type \"" << v->fs_type << "\" unsupported";
     return -1;
   }
 
   // If there's a key_loc that looks like a path, it should be a block device for storing encryption
   // metadata. Wipe it too.
-  if (v->key_loc != nullptr && v->key_loc[0] == '/') {
+  if (!v->key_loc.empty() && v->key_loc[0] == '/') {
     LOG(INFO) << "Wiping " << v->key_loc;
-    int fd = open(v->key_loc, O_WRONLY | O_CREAT, 0644);
+    int fd = open(v->key_loc.c_str(), O_WRONLY | O_CREAT, 0644);
     if (fd == -1) {
       PLOG(ERROR) << "format_volume: Failed to open " << v->key_loc;
       return -1;
@@ -174,9 +173,8 @@
   int64_t length = 0;
   if (v->length > 0) {
     length = v->length;
-  } else if (v->length < 0 ||
-             (v->key_loc != nullptr && strcmp(v->key_loc, "footer") == 0)) {
-    android::base::unique_fd fd(open(v->blk_device, O_RDONLY));
+  } else if (v->length < 0 || v->key_loc == "footer") {
+    android::base::unique_fd fd(open(v->blk_device.c_str(), O_RDONLY));
     if (fd == -1) {
       PLOG(ERROR) << "format_volume: failed to open " << v->blk_device;
       return -1;
@@ -190,7 +188,7 @@
     }
   }
 
-  if (strcmp(v->fs_type, "ext4") == 0) {
+  if (v->fs_type == "ext4") {
     static constexpr int kBlockSize = 4096;
     std::vector<std::string> mke2fs_args = {
       "/system/bin/mke2fs", "-F", "-t", "ext4", "-b", std::to_string(kBlockSize),
@@ -213,7 +211,7 @@
     }
 
     int result = exec_cmd(mke2fs_args);
-    if (result == 0 && directory != nullptr) {
+    if (result == 0 && !directory.empty()) {
       std::vector<std::string> e2fsdroid_args = {
         "/system/bin/e2fsdroid", "-e", "-f", directory, "-a", volume, v->blk_device,
       };
@@ -242,7 +240,7 @@
   }
 
   int result = exec_cmd(make_f2fs_cmd);
-  if (result == 0 && directory != nullptr) {
+  if (result == 0 && !directory.empty()) {
     cmd = "/sbin/sload.f2fs";
     // clang-format off
     std::vector<std::string> sload_f2fs_cmd = {
@@ -261,31 +259,29 @@
   return 0;
 }
 
-int format_volume(const char* volume) {
-  return format_volume(volume, nullptr);
+int format_volume(const std::string& volume) {
+  return format_volume(volume, "");
 }
 
 int setup_install_mounts() {
-  if (fstab == nullptr) {
+  if (fstab.empty()) {
     LOG(ERROR) << "can't set up install mounts: no fstab loaded";
     return -1;
   }
-  for (int i = 0; i < fstab->num_entries; ++i) {
-    const Volume* v = fstab->recs + i;
-
+  for (const FstabEntry& entry : fstab) {
     // We don't want to do anything with "/".
-    if (strcmp(v->mount_point, "/") == 0) {
+    if (entry.mount_point == "/") {
       continue;
     }
 
-    if (strcmp(v->mount_point, "/tmp") == 0 || strcmp(v->mount_point, "/cache") == 0) {
-      if (ensure_path_mounted(v->mount_point) != 0) {
-        LOG(ERROR) << "Failed to mount " << v->mount_point;
+    if (entry.mount_point == "/tmp" || entry.mount_point == "/cache") {
+      if (ensure_path_mounted(entry.mount_point) != 0) {
+        LOG(ERROR) << "Failed to mount " << entry.mount_point;
         return -1;
       }
     } else {
-      if (ensure_path_unmounted(v->mount_point) != 0) {
-        LOG(ERROR) << "Failed to unmount " << v->mount_point;
+      if (ensure_path_unmounted(entry.mount_point) != 0) {
+        LOG(ERROR) << "Failed to unmount " << entry.mount_point;
         return -1;
       }
     }
diff --git a/roots.h b/roots.h
index 314eb5f..341f905 100644
--- a/roots.h
+++ b/roots.h
@@ -19,7 +19,7 @@
 
 #include <string>
 
-typedef struct fstab_rec Volume;
+typedef struct FstabEntry Volume;
 
 // Load and parse volume data from /etc/recovery.fstab.
 void load_volume_table();
@@ -29,25 +29,25 @@
 
 // Make sure that the volume 'path' is on is mounted.  Returns 0 on
 // success (volume is mounted).
-int ensure_path_mounted(const char* path);
+int ensure_path_mounted(const std::string& path);
 
 // Similar to ensure_path_mounted, but allows one to specify the mount_point.
-int ensure_path_mounted_at(const char* path, const char* mount_point);
+int ensure_path_mounted_at(const std::string& path, const std::string& mount_point);
 
 // Make sure that the volume 'path' is on is unmounted.  Returns 0 on
 // success (volume is unmounted);
-int ensure_path_unmounted(const char* path);
+int ensure_path_unmounted(const std::string& path);
 
 // Reformat the given volume (must be the mount point only, eg
 // "/cache"), no paths permitted.  Attempts to unmount the volume if
 // it is mounted.
-int format_volume(const char* volume);
+int format_volume(const std::string& volume);
 
 // Reformat the given volume (must be the mount point only, eg
 // "/cache"), no paths permitted.  Attempts to unmount the volume if
 // it is mounted.
 // Copies 'directory' to root of the newly formatted volume
-int format_volume(const char* volume, const char* directory);
+int format_volume(const std::string& volume, const std::string& directory);
 
 // Ensure that all and only the volumes that packages expect to find
 // mounted (/tmp and /cache) are mounted.  Returns 0 on success.
