Às vezes eu realmente gostaria que eles não tivessem bagunçado com o Linux muito! Eu sei que há um /etc/fstab em algum lugar, mas onde?
Eu gostaria de montar algumas partições com sistemas de arquivos alternativos (porque eu não gosto de fat32).
Às vezes eu realmente gostaria que eles não tivessem bagunçado com o Linux muito! Eu sei que há um /etc/fstab em algum lugar, mas onde?
Eu gostaria de montar algumas partições com sistemas de arquivos alternativos (porque eu não gosto de fat32).
Sometimes I really wish they hadn't messed around with Linux so much! I know there's an /etc/fstab
in there somewhere, but where?
I'd like to mount some partitions with alternative filesystems (because I don't like FAT32).
Não pense no Android como uma distribuição Linux fortemente modificada. Porque não é. A quase apenas que o Android compartilha com uma distribuição Linux é o kernel. E até mesmo este componente é modificado. Também outros componentes principais, como a libc, diferem.
android não tem /etc/fstab
Você não precisa /etc/fstab para montar uma partição. Mas existe um comando no comando.
ABCDEFGHIJKLMBCDEFGHIJKLMN2
ABCDEFGHIJKLMNABCDEFGHIJKLMN3 deve funcionar (Root Requerido). Para responder a suas perguntas Título: A montagem do sistema de inicialização é feita com o script
ABCDEFGHIJKLMNABCDEFGHIJKLMN4
.
Don't think about Android as a heavily modified Linux distribution. Because it's not. The nearly only thing that Android shares with a Linux distribution is the kernel. And even this component is modified. Also other core components, like the libc, differ.
Android has no /etc/fstab
You don't need /etc/fstab
to mount an partition. But there is IIRC no mount
command either.dev_mount
should work (root required). To answer your questions title: All startup system mounting is done with the/etc/vold.fstab
helper script.
O arquivo fstab está em / .
é chamado /fstab.$systemname.rc onde
$systemname é baseado na propriedade de impressão digital do aparelho, identificada como categoria de chipset ou monofone.
The fstab file is in /
.
It's called /fstab.$systemname.rc
where $systemname
is based on the handset's fingerprint property, either identified as category of chipset or handset itself.
Estou vendo informações conflitantes. Um recurso diz que é hardcoded , então não é algo que você pode alterar o lado do usuário :
.Programas de init específicos de Android são encontrados no dispositivo / sistema / init. Adicionar mensagens de log para ajudá-lo a depurar possíveis problemas com a macro de log definida no dispositivo / sistema / init / init.c.
O programa de inicialização monta diretamente todos os sistemas de arquivos e dispositivos usando nomes de arquivos ou nomes de dispositivos codificados com dígitos gerados desencadeando o sistema de arquivos SYSFS (eliminando a necessidade de um arquivo / etc / fstab no Android).
em outro lugar /etc/vold.fstab e
/etc/vold.conf são mencionados. Eu os tenho no meu dispositivo abaixo do CM 7.1, mas não tenho certeza de como eles são usados.
I'm seeing conflicting information. One resource says it's hardcoded, so not something you can change user-side:
Android-specific init programs are found in device/system/init. Add LOG messages to help you debug potential problems with the LOG macro defined in device/system/init/init.c.
The init program directly mounts all filesystems and devices using either hard-coded file names or device names generated by probing the sysfs filesystem (thereby eliminating the need for a /etc/fstab file in Android).
Elsewhere /etc/vold.fstab
and /etc/vold.conf
are mentioned. I have them on my device under CM 7.1 but I'm not sure of how they are used.
Você pode remontar seu armazenamento externo para ser executável executando
/etc/fstab0 Isso removerá os sinalizadores Noexec, Nosuid e NodeV, mas ainda será vfat fs. Você pode fazer links para este FS, mas não de dentro. A remonta não sobrevive a uma reinicialização, porque o arquivo vold.fstab será lido e eles serão remontados em reinicializar com os sinalizadores Noexec.
Se você reformatar qualquer um de seu armazenamento externo para qualquer outra coisa que não seja o VFAT, eles não serão remontados na reinicialização e quaisquer aplicativos que você se mudou para qualquer armazenamento externo não será utilizável. Se você não pretende usar armazenamento externo para aplicativos, então você pode desmontar seu armazenamento externo e usar /etc/fstab1 para torná-lo ext2. Use /etc/fstab2 para retorná-lo ao VFAT e torná-lo utilizável novamente.
Nota /etc/fstab3 é quebrado, você receberá algo como
. lseek: valor muito grande para o tipo de dados definido
Então não perca seu tempo. Tudo isso supõe que você está enraizado e tem um binário de trabalho de funcionamento.
You can remount your external storage to be executable by running
mount -o remount, rw /mnt/sdcard
this will remove the noexec, nosuid and nodev flags, but it will still be vfat fs. You can make links to this fs but not from within. The remount does not survive a reboot, because the vold.fstab file will be read and they will be remounted at reboot with the noexec flags.
If you reformat any of your external storage to anything other than vfat, then they will not be remounted at reboot, and any apps that you have moved to any external storage will not be usable. If you don't intend to use external storage for apps then you can unmount your external storage and use busybox mke2fs DEVICE
to make it ext2. Use busybox newfs_msdos DEVICE
to return it to vfat and make it usable again.
Note busybox mkfs.vfat
is broken, you will get something like
lseek: Value too large for defined data type
so don't waste your time. All of this assumes you are rooted, and have a working busybox binary.
Eu percebo que este é um antigo tópico, mas algumas respostas aqui realmente impediram meus esforços para aprender sobre fstab e android porque eles implicam tão fortemente que o
abcdefghijklmn1 Situação no Android é extremamente diferente de outras distribuições do Linux. Do que eu posso dizer, não é.
No entanto, ler respostas diferentes aqui me fez pensar: o que fstab - -Equivalente arquivo ou arquivos estão em meu dispositivo ?
Voltando por um momento, observando que " Android não tem / etc / fstab " provavelmente não é útil para o OP, já que eles já devem saber disso. Se isso não fosse falso, sua pergunta (perguntando o que o equivalente do Android ABCDEFGHIJKLMNABCDEFGHIJKLMN3 é) não faria nenhum sentido. Por outro lado, sabemos que o @Flow não estava tentando implicar que não havia equivalente no Android, já que mencionaram um deles, um "script auxiliar" chamado
ABCDEFGHIJKLMNABCDEFGHIJKLMN4
.
Tudo em tudo, eu acho que o takeaway do post @ flow é que em alguns sistemas, há um arquivo (possivelmente um "script auxiliar" - não consigo verificar isso no meu telefone) chamado ABCDEFGHIJKLMNABCDEFGHIJKLMN5
, e nesses sistemas, este arquivo é o equivalente mais próximo para /etc/fstab .
voltar a se perguntar sobre o meu próprio dispositivo, vou postar minhas descobertas aqui por vários motivos, apesar da idade do OP:
fstab -style arquivos que eu posso encontrar no meu telefone, um pixel 2xl.
Então deixe-me tentar resumir tudo o que aprendi de tudo isso:
Android, ou pelo menos suas variantes que tenho acesso, faz uso de fstab - arquivos de estilo. No entanto, o nome exato, o local e a função desses arquivos variam de acordo com a distribuição - significando pela versão e dispositivo Android, e também por ROM se você usar uma ROM personalizada.
Para encontrar esses arquivos no seu sistema, abra um emulador de terminal como tmux ou
fstab0
e execute algo assim: abcdefghijklmnabcdefgijklmn11 . O redirecionamento do arquivo 2 (
fstab2 ) para
fstab3 vai tornar sua saída muito limpo como você poderá ignorar o ataque de mensagens de erro que você obterá de
ABCDEFGHIJKLMNABCDEFGHIJKLMN14 , mesmo se você é
fstab5 .
no meu sistema (um pixel 2xl, nome de código "Taimen"), encontrei três arquivos candidatos:
fstab6 Os dois primeiros são arquivos separados em que nenhum dos dois é um link duro ou simbólico para o outro, mas se você fstab7 eles descobrirão que eles são idênticos. Olhando um pouco mais profundo, se você executar fstab8 nos arquivos que você verá que eles têm o mesmo dispositivo e os valores de inode:
fstab9 fstab0 relata esses nomes de arquivos como arquivos regulares com apenas um link cada (por isso não há links duros ou simbólicos estão envolvidos). Eu não sou um especialista em sistemas de arquivos, mas o que aconteceu aqui é que o mesmo dispositivo foi montado duas vezes. Você pode ver isso na saída do seguinte comando, onde as únicas diferenças entre as duas linhas de saída são os pontos de montagem (a peça imediatamente após "ON"):
fstab1 O terceiro arquivo só é visível para mim se eu fizer o login como root, por isso, se você tiver um dispositivo idêntico ao meu, você ainda não encontrará ou terá acesso a este arquivo, a menos que seu telefone esteja enraizado. Esse arquivo tem a ver com um serviço chamado Open Mobile Alliance Device Management, mas isso é um serviço que eu sei muito pouco sobre, então vou mencioná-lo aqui, e você pode o Google para detalhes sobre isso, se você quiser.
.
I realize that this is an old topic, but some of the answers here actually hindered my efforts to learn about fstab
and Android because they so strongly imply that the fstab
situation in Android is extremely different from other Linux distributions. From what I can tell, it isn't.
However, reading different responses here made me wonder: what fstab
-equivalent file or files are on my device?
Stepping back for a moment, noting that "Android has no /etc/fstab" is probably not helpful to the OP since they must have already known this. If this were untrue, their question (asking what the Android equivalent of /etc/fstab
is) would not make any sense. On the other hand, we know @Flow was not trying to imply that there was no equivalent on Android, since they mentioned one of them, a "helper script" named /etc/vold.fstab
.
All in all, I think the takeaway from @Flow's post is that on some systems, there is a file (possibly a "helper script" - I can't verify that on my phone) called /etc/vold.fstab
, and on those systems, this file is the nearest equivalent to /etc/fstab
.
Getting back to wondering about my own device, I am going to post my findings here for several reasons, in spite of the age of the OP:
fstab
-style files I can find on my phone, a Pixel 2XL.So let me try to sum up everything I have learned from all of this:
Android, or at least its variants that I have access to, does make use of fstab
-style files. However, the exact name, location, and function of these files vary by distribution - meaning by Android version and device, and also by ROM if you use a custom ROM.
To find these files on your system, open up a terminal emulator like tmux
or adb shell
and run something like this: find / -type f -iname '*fstab*' 2>/dev/null
. The redirection of file 2 (stderr
) to /dev/null
will make your output much cleaner as you will be able to ignore the onslaught of error messages you will get from find
, even if you are root
.
On my system (a Pixel 2XL, code name "taimen"), I found three candidate files:
taimen:/ # find / -type f -iname '*fstab*' 2>/dev/null /sbin/.core/mirror/vendor/etc/fstab.taimen /vendor/etc/fstab.taimen /data/data/com.android.omadm.service/files/dm/dmt_data/fstab
The first two are separate files in that neither is a hard or symbolic link to the other, but if you diff
them you will find that they are identical. Looking a little deeper, if you run stat
on the files you will see that they have the same Device and Inode values:
taimen:/ # stat /sbin/.core/mirror/vendor/etc/fstab.taimen /vendor/etc/fstab.taimen File: `/sbin/.core/mirror/vendor/etc/fstab.taimen' Size: 1326 Blocks: 16 IO Blocks: 512 regular file Device: fc00h/64512d Inode: 925 Links: 1 Access: (644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2009-01-01 02:00:00.000000000 Modify: 2009-01-01 02:00:00.000000000 Change: 2009-01-01 02:00:00.000000000 File: `/vendor/etc/fstab.taimen' Size: 1326 Blocks: 16 IO Blocks: 512 regular file Device: fc00h/64512d Inode: 925 Links: 1 Access: (644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2009-01-01 02:00:00.000000000 Modify: 2009-01-01 02:00:00.000000000 Change: 2009-01-01 02:00:00.000000000
stat
reports both of these filenames as regular files with only one link each (so no hard or symbolic links are involved). I'm not a filesystem expert but what has happened here is that the same device has been mounted twice. You can see this in the output of the following command, where the only differences between the two lines of output in are the mount points (the part immediately after "on"):
taimen:/ $ mount | grep vendor /dev/block/dm-0 on /vendor type ext4 (ro,seclabel,relatime,block_validity,delalloc,barrier,user_xattr) /dev/block/dm-0 on /sbin/.core/mirror/vendor type ext4 (ro,seclabel,relatime,block_validity,delalloc,barrier,user_xattr)
The third file is only visible to me if I login as root, so if you have a device identical to mine, you still will not find, or have access to, this file unless your phone is rooted. That file has to do with a service called Open Mobile Alliance Device Management, but that is a service I know very little about, so I will just mention it here, and you can Google for details about that if you'd like.
© 2022 pergunte.org All Rights Reserved. Casa de perguntas e respostas todos os direitos reservados