adoptable storage -android存储子系统中的adoptable概念
可采用的存储-安卓存储子系统中的可领养的概念
(资料图)
When external storage media is adopted, it’s formatted and encrypted to only work with a single Android device at a time. Because the media is strongly tied to the Android device that adopted it, it can safely store both apps and private data for all users.
当采用外部存储介质时,它经过格式化和加密,一次只能使用单个Android设备。由于媒体与采用它的安卓设备紧密相连,它可以安全地为所有用户存储应用程序和私人数据。
Adoptable Storage
可采用的存储
IN THIS DOCUMENT
在本文件中
Security
安全
Performance and stability
性能和稳定性
Android has always supported external storage accessories (such as SD cards), but these accessories were historically limited to simple file storage, due to their expected impermanence and the minimal data protection offered to traditional external storage. Android 6.0 introduces the ability to adopt external storage media to act like internal storage.
安卓一直支持外部存储配件(如SD卡),但这些配件在历史上仅限于简单的文件存储,因为它们的预期短暂性和对传统外部存储的最低数据保护。安卓6.0引入了采用外部存储介质来充当内部存储的能力。
When external storage media is adopted, it’s formatted and encrypted to only work with a single Android device at a time. Because the media is strongly tied to the Android device that adopted it, it can safely store both apps and private data for all users.
当采用外部存储介质时,它经过格式化和加密,一次只能使用单个Android设备。由于媒体与采用它的安卓设备紧密相连,它可以安全地为所有用户存储应用程序和私人数据。
When users insert new storage media (such as an SD card) in an adoptable location, Android asks them how they want to use the media. They can choose to adopt the media, which formats and encrypts it, or they can continue using it as-is for simple file storage. If they choose to adopt, the platform offers to migrate the primary shared storage contents (typically mounted at /sdcard) to the newly adopted media, freeing up valuable space on internal storage. Unlike traditional storage, which is limited to 2TB due to its use of MBR, adoptable storage usesGPT and therefore has file storage limit of ~9ZB.
当用户在可采用的位置插入新的存储介质(如SD卡)时,Android会询问他们希望如何使用该介质。他们可以选择采用格式化和加密的介质,也可以继续使用它进行简单的文件存储。如果他们选择采用,该平台提供将主要共享存储内容(通常安装在/sdcard)迁移到新采用的介质,从而释放内部存储上的宝贵空间。与传统存储不同,传统存储由于使用MBR而被限制为2TB,可采用的存储使用GPT,因此文件存储限制为~9ZB。
Apps can be placed on adopted storage media only when the developer has indicated support through theandroid:installLocation attribute. New installs of supported apps are automatically placed on the storage device with the most free space, and users can move supported apps between storage devices in the Settingsapp. Apps moved to adopted media are remembered while the media is ejected, and return when the media is reinserted.
只有当开发人员通过droid:installLocation属性表示支持时,应用程序才能放置在采用的存储介质上。新安装的受支持应用程序会自动放置在具有最大可用空间的存储设备上,用户可以在Settingsapp中的存储设备之间移动受支持的应用程序。当介质弹出时,移动到已采用介质的应用程序会被记住,当介质重新插入时,应用程序会返回。
Security
安全
The platform randomly generates an encryption key for each adopted device, and that key is stored on the internal storage of the Android device. This effectively makes the adopted media as secure as internal storage. Keys are associated with adopted devices based on the adopted partition GUID. The adopted device is encrypted using dm-crypt configured with the aes-cbc-essiv:sha256 algorithm and a 128-bit key size.
该平台为每个采用的设备随机生成一个加密密钥,该密钥存储在安卓设备的内部存储器中。这有效地使所采用的介质与内部存储一样安全。密钥基于所采用的分区GUID与所采用的设备相关联。所采用的设备使用dm crypt进行加密,该crypt配置有aes-cbc-essiv:sha256算法和128位密钥大小。
The on-disk layout of the adopted device closely mirrors the internal data partition, including SELinux labels, etc. When multi-user is supported on the Android device, the adopted storage device also supports multi-user with the same level of isolation as internal storage.
所采用设备的磁盘布局紧密反映了内部数据分区,包括SELinux标签等。当Android设备支持多用户时,所采用的存储设备也支持与内部存储具有相同隔离级别的多用户。
Because the contents of an adopted storage device are strongly tied to the Android device that adopted it, the encryption keys should not be extractable from the parent device, and therefore the storage device can"t be mounted elsewhere.
由于采用的存储设备的内容与采用它的安卓设备紧密相连,因此加密密钥不应从父设备中提取,因此存储设备不能安装在其他地方。
Performance and stability
性能和稳定性
Only external storage media in stable locations, such as a slot inside a battery compartment or behind a protective cover, should be considered for adoption to help avoid accidental data loss or corruption. In particular, USB devices connected to a phone or tablet should never be considered for adoption. One common exception would be an external USB drive connected to a TV-style device, because the entire TV is typically installed in a stable location.
只有位于稳定位置的外部存储介质,如电池舱内的插槽或保护罩后面的插槽,才应考虑采用,以帮助避免意外的数据丢失或损坏。特别是,连接到手机或平板电脑的USB设备永远不应该被考虑采用。一个常见的例外是连接到电视式设备的外部USB驱动器,因为整个电视通常安装在稳定的位置。
When a user adopts a new storage device, the platform runs a benchmark and compares its performance against internal storage. If the adopted device is significantly slower than internal storage, the platform warns the user about a possibly degraded experience. This benchmark was derived from the actual I/O behavior of popular Android apps. Currently, the AOSP implementation will only warn users beyond a single threshold, but device manufacturers may adapt this further, such as rejecting adoption completely if the card is extremely slow.
当用户采用新的存储设备时,平台会运行一个基准测试,并将其性能与内部存储进行比较。如果采用的设备明显慢于内部存储,平台会警告用户可能会降低体验。这个基准测试源于流行的Android应用程序的实际I/O行为。目前,AOSP的实现只会警告用户超过一个阈值,但设备制造商可能会进一步调整这一点,例如如果卡速度非常慢,则完全拒绝采用。
Adopted devices must be formatted with a filesystem that supports POSIX permissions and extended attributes, such as ext4 or f2fs. For optimal performance, the f2fs filesystem is recommended for flash-based storage devices.
采用的设备必须使用支持POSIX权限和扩展属性(如ext4或f2fs)的文件系统进行格式化。为了获得最佳性能,建议将f2fs文件系统用于基于闪存的存储设备。
When performing periodic idle maintenance, the platform issues FI_TRIM to adopted media just like it does for internal storage. The current SD card specification does not support the DISCARD command; but the kernel instead falls back to the ERASE command, which SD card firmware may choose to use for optimization purposes.
当执行定期空闲维护时,平台向采用的介质发出FI_TRIM,就像对内部存储一样。当前SD卡规格不支持DISCARD命令;但是内核转而回到SD卡固件可以选择用于优化目的的ERASE命令。
可采用的存储-安卓存储子系统中的可领养的概念
当采用外部存储介质时,它经过格式化和加密,一次只能使用单个Android设备。由于媒体与采用它的安卓设备紧密相连,它可以安全地为所有用户存储应用程序和私人数据。
可采用的存储
在本文件中
安全
性能和稳定性
安卓一直支持外部存储配件(如SD卡),但这些配件在历史上仅限于简单的文件存储,因为它们的预期短暂性和对传统外部存储的最低数据保护。安卓6.0引入了采用外部存储介质来充当内部存储的能力。
当采用外部存储介质时,它经过格式化和加密,一次只能使用单个Android设备。由于媒体与采用它的安卓设备紧密相连,它可以安全地为所有用户存储应用程序和私人数据。
当用户在可采用的位置插入新的存储介质(如SD卡)时,Android会询问他们希望如何使用该介质。他们可以选择采用格式化和加密的介质,也可以继续使用它进行简单的文件存储。如果他们选择采用,该平台提供将主要共享存储内容(通常安装在/sdcard)迁移到新采用的介质,从而释放内部存储上的宝贵空间。与传统存储不同,传统存储由于使用MBR而被限制为2TB,可采用的存储使用GPT,因此文件存储限制为~9ZB。
只有当开发人员通过droid:installLocation属性表示支持时,应用程序才能放置在采用的存储介质上。新安装的受支持应用程序会自动放置在具有最大可用空间的存储设备上,用户可以在Settingsapp中的存储设备之间移动受支持的应用程序。当介质弹出时,移动到已采用介质的应用程序会被记住,当介质重新插入时,应用程序会返回。
安全
该平台为每个采用的设备随机生成一个加密密钥,该密钥存储在安卓设备的内部存储器中。这有效地使所采用的介质与内部存储一样安全。密钥基于所采用的分区GUID与所采用的设备相关联。所采用的设备使用dm crypt进行加密,该crypt配置有aes-cbc-essiv:sha256算法和128位密钥大小。
所采用设备的磁盘布局紧密反映了内部数据分区,包括SELinux标签等。当Android设备支持多用户时,所采用的存储设备也支持与内部存储具有相同隔离级别的多用户。
由于采用的存储设备的内容与采用它的安卓设备紧密相连,因此加密密钥不应从父设备中提取,因此存储设备不能安装在其他地方。
性能和稳定性
只有位于稳定位置的外部存储介质,如电池舱内的插槽或保护罩后面的插槽,才应考虑采用,以帮助避免意外的数据丢失或损坏。特别是,连接到手机或平板电脑的USB设备永远不应该被考虑采用。一个常见的例外是连接到电视式设备的外部USB驱动器,因为整个电视通常安装在稳定的位置。
当用户采用新的存储设备时,平台会运行一个基准测试,并将其性能与内部存储进行比较。如果采用的设备明显慢于内部存储,平台会警告用户可能会降低体验。这个基准测试源于流行的Android应用程序的实际I/O行为。目前,AOSP的实现只会警告用户超过一个阈值,但设备制造商可能会进一步调整这一点,例如如果卡速度非常慢,则完全拒绝采用。
采用的设备必须使用支持POSIX权限和扩展属性(如ext4或f2fs)的文件系统进行格式化。为了获得最佳性能,建议将f2fs文件系统用于基于闪存的存储设备。
当执行定期空闲维护时,平台向采用的介质发出FI_TRIM,就像对内部存储一样。当前SD卡规格不支持DISCARD命令;但是内核转而回到SD卡固件可以选择用于优化目的的ERASE命令。
adoptable storage -android存储子系统中的adoptable概念
简单并快乐着 于2017-05-03 18:15:24发布 1671 收藏 1 分类专栏: android android 专栏收录该内容 211 篇文章 2 订阅订阅专栏 When external storage media is adopted, it’s formatted and encrypted to only work with a single Android device at a time. Because the media is strongly tied to the Android device that adopted it, it can safely store both apps and private data for all users.DiskInfo.Java有判断SD卡和USB的接口isSd()
isAdoptable()方法是判断SD卡是否可以用作内部存储
弹出框的两个选项,选择第二个就是adoptable设备
Adoptable Storage
IN THIS DOCUMENT
Security
Performance and stability
Androidhas always supported external storage accessories (such as SD cards), but these accessories were historically limited to simple file storage, due to their expected impermanence and the minimal data protection offered totraditional external storage. Android 6.0 introduces the ability toadoptexternal storage media to act like internal storage.
When external storage media is adopted, it’s formatted and encrypted to only work with a single Android device at a time. Because the media is strongly tied to the Android device that adopted it, it can safely store both apps and private data for all users.
When users insert new storage media (such as an SD card) in an adoptable location, Android asks them how they want to use the media. They can choose to adopt the media, which formats and encrypts it, or they can continue using it as-is for simple file storage. If they choose to adopt, the platform offers to migrate the primary shared storage contents (typically mounted at/sdcard
) to the newly adopted media, freeing up valuable space on internal storage. Unlike traditional storage, which is limited to 2TB due to its use ofMBR, adoptable storage usesGPTand therefore has file storage limit of ~9ZB.
Apps can be placed on adopted storage media only when the developer has indicated support through theandroid:installLocation
attribute. New installs of supported apps are automatically placed on the storage device with the most free space, and users can move supported apps between storage devices in theSettingsapp. Apps moved to adopted media are remembered while the media is ejected, and return when the media is reinserted.
Security
The platform randomly generates an encryption key for each adopted device, and that key is stored on the internal storage of the Android device. This effectively makes the adopted media as secure as internal storage. Keys are associated with adopted devices based on the adopted partition GUID. The adopted device is encrypted usingdm-crypt
configured with theaes-cbc-essiv:sha256
algorithm and a 128-bit key size.
The on-disk layout of the adopted device closely mirrors the internal data partition, including SELinux labels, etc. When multi-user is supported on the Android device, the adopted storage device also supports multi-user with the same level of isolation as internal storage.
Because the contents of an adopted storage device are strongly tied to the Android device that adopted it, the encryption keys should not be extractable from the parent device, and therefore the storage device can"t be mounted elsewhere.
Performance and stability
Only external storage media in stable locations, such as a slot inside a battery compartment or behind a protective cover, should be considered for adoption to help avoid accidental data loss or corruption. In particular, USB devices connected to a phone or tablet should never be considered for adoption. One common exception would be an external USB drive connected to a TV-style device, because the entire TV is typically installed in a stable location.
When a user adopts a new storage device, the platform runs a benchmark and compares its performance against internal storage. If the adopted device is significantly slower than internal storage, the platform warns the user about a possibly degraded experience. This benchmark was derived from the actual I/O behavior of popular Android apps. Currently, the AOSP implementation will only warn users beyond a single threshold, but device manufacturers may adapt this further, such as rejecting adoption completely if the card is extremely slow.
Adopted devices must be formatted with a filesystem that supports POSIX permissions and extended attributes, such asext4
orf2fs
. For optimal performance, thef2fs
filesystem is recommended for flash-based storage devices.
When performing periodic idle maintenance, the platform issuesFI_TRIM
to adopted media just like it does for internal storage. The current SD card specification does not support theDISCARD
command; but the kernel instead falls back to theERASE
command, which SD card firmware may choose to use for optimization purposes.
关键词: