Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Suggestions for efficient way to repopulate a new larger sdcard connected between Windows 10 & Android 7

5 views
Skip to first unread message

Arlen Holder

unread,
Nov 24, 2020, 12:20:42 AM11/24/20
to
Suggestions for efficient way to repopulate a new larger sdcard connected
between Windows 10 & Android 7

1. I gave away a handful of $130 LG Stylo 3 Plus Android phones years ago
o Phablet stocking stuffers: iPhone 7 versus LG Stylo 3 Plus price/performance hardware comparison
<https://groups.google.com/forum/#!topic/comp.mobile.android/ls71mnkj4jk>

2. I also provided each of the recipients a $16 64GB sdcard for expansion:
o Advise me (& everyone) about the use of inexpensive $16 64GB flash cards on Android 7.0 Nougat phones
<https://groups.google.com/g/comp.mobile.android/c/SM1XWLJb_RY>

3. They're now running out of storage so I bought $20 128GB sdcards with adapters:
o <https://i.postimg.cc/d1rDJPhn/sdcard01.jpg>

My question:
What is the most efficient way for non-technical users to repopulate the
new 128 GB sdcard with the old data from the 64GB sdcard?

One would "think" that you can just copy the old data to the new card
a. Connect the phone with the old 64GB card in it into the USB port
b. Connect the new 128GB sdcard into the computer laptop sdcard port
c. Copy everything from the old 64GB sdcard to the new 128GB sdcard
d. Put the newly populated 128GB sdcard into the phone

But that's doing _everything_ from Windows 10 and not from Android.
o Will that method work?

Or do we need to do the move from Android itself with Windows in between?
o I need to be able to explain to them, over the phone, how to do this.

I haven't tested anything directly as I picked up a $100 Moto G7 since,
which has a 64GB card in it that isn't in need of a 128GB sdcard just yet.
--
See also:
o Do you keep the mess in the external sdcard or do you change it?
<https://groups.google.com/g/comp.mobile.android/c/gmI-kNbakmA/m/zCT4gBh3AwAJ>

Paul

unread,
Nov 24, 2020, 2:04:54 AM11/24/20
to
Why wouldn't you just unplug the 64GB adjunct storage and
plug in the empty 128GB adjunct storage, format it, and use it ?

SD cards should be for transport, not archival storage. A person
could load their 64GB SD into the USB-to-SD adapter and offload
or make a backup to some other machine, while surfing the phone
with the 128GB plugged in.

It's not clear, which flash storage devices have actual working
wear leveling. If media has TLC in it, it should really have good
wear leveling, to ensure a decent life. This is why I have a couple
dead USB flash sticks with TLC chips in them (I checked and looked
them up and they're TLC). And those sticks were hardly used.

I read lots of bumpf, and I can't really be sure when some
Chinese vendor claims to have wear leveling, that they
really do. It could be words they copied off a milk carton.

Paul

Arlen Holder

unread,
Nov 24, 2020, 2:29:34 AM11/24/20
to
On Tue, 24 Nov 2020 02:04:52 -0500, Paul wrote:

> Why wouldn't you just unplug the 64GB adjunct storage and
> plug in the empty 128GB adjunct storage, format it, and use it ?

Hi Paul,

I appreciate that question because you're purposefully helpful, and by you
asking that question, I realized I wasn't clear on the problem set.

Of course, if the users simply plugged in the new 128GB card it would
almost certainly work just fine out of the box and into the phone.

But then they wouldn't have the _existing_ data (whatever that might be,
but certainly it includes their camera output of photos & videos) on the
new 128GB sdcard.

Of course, they could then just insert the old 64GB sdcard into the flash
card adapter and _then_ copy everything from the 64GB card to the 128GB
card, which is simply the opposite of what I was asking about.

Essentially, the question is whether Windows can populate an sdcard that is
being _used_ by Android (e.g., the old sdcard will have maps, and photos,
and other files which are _directly_ managed by Android apps).

> SD cards should be for transport, not archival storage. A person
> could load their 64GB SD into the USB-to-SD adapter and offload
> or make a backup to some other machine, while surfing the phone
> with the 128GB plugged in.

Agreed that the sdcard "can" be used for archival storage.

Also I should mention none of them are being used as primary storage, in
that Android "can" use the sdcard instead of the built-in storage, but none
of these are set up that way.

The thing I'm wondering about is that I know that for some of these users
they have set the camera app to store _directly_ onto the external sdcard.

I think some of them have set the mapping apps to also store the maps and
waypoints and other map-like data _directly_ onto the sdcard in the slot.

That means Android is "managing" these sdcards, which is why I ask if
simply copying one card to another via Windows (and not Android) will work.

I "think" it will work - but I haven't tested it to work
o Which is why I ask.

Because I'm gonna have to explain it to non-technical people so I want to
line up my ducks first. I don't want them to have problems I didn't
foresee, which is why I ask for advice from those who have done it.

I guess I could use one of the cards on my phone and test it out though.
o I might have to do that, but I was keeping the cards pristine as gifts.

> It's not clear, which flash storage devices have actual working
> wear leveling. If media has TLC in it, it should really have good
> wear leveling, to ensure a decent life. This is why I have a couple
> dead USB flash sticks with TLC chips in them (I checked and looked
> them up and they're TLC). And those sticks were hardly used.
>
> I read lots of bumpf, and I can't really be sure when some
> Chinese vendor claims to have wear leveling, that they
> really do. It could be words they copied off a milk carton.

I hadn't even thought about "wear leveling", but these 64GB sdcards are, at
most, two years old, and only used in an Android phone as camera storage
(and perhaps map database storage), so I don't think it's excessive use.

Mostly I was just asking if anyone had swapped a smaller card for a bigger
card and then, using Windows, copied the old data to the new card, and then
the Android apps "just worked" or not (using the copied data).

The _reason_ I ask is that I had planned to _explain_ it to the users over
the phone so I just wanted to do a sanity check before I did that.

I could try it with my phone, and temporarily use one of the cards to test
it out, but I figured I'd ask first as I have no need to do it for mine.

Frank Slootweg

unread,
Nov 24, 2020, 10:40:53 AM11/24/20
to
Arlen Holder <arlen_...@newmachines.com> wrote:
[...]

> Mostly I was just asking if anyone had swapped a smaller card for a bigger
> card and then, using Windows, copied the old data to the new card, and then
> the Android apps "just worked" or not (using the copied data).

I have done it in the past, but I did it completely on Windows. I
think it's not wise to - try to - copy a 'live' Android filesystem.
One has to use Windows anyway, so why not do the whole job on Windows?
And one has to remove the small capacity card at some point, so why not
do it straight away?

Basically change the question to: How would you copy a MicroSD card on
a Windows system? And the add the Android card-removal/card-insertion
bits.

[I hope I got this right (but you get the idea):]

- Power down the Android device.

- Remove the small capacity card from the Android device, put it in the
MicroSD-to-SD adapter and insert it in the SD-card reader of the
Windows system.

- Copy all folders from the SD-card to the computer's HDD.

- 'Safely remove' the SD-card.

- Remove small capacity card. Insert large capacity card. Insert SD-card
in SD-card reader.

- Copy all the folders from the HDD to the large capacity card.

- 'Safely remove' the SD-card.

- Remove large capacity card and insert it in the Android device.

- Power up the Android device.

> The _reason_ I ask is that I had planned to _explain_ it to the users over
> the phone so I just wanted to do a sanity check before I did that.
>
> I could try it with my phone, and temporarily use one of the cards to test
> it out, but I figured I'd ask first as I have no need to do it for mine.

Given the scenario an circumstances, I advise to try it yourself and
document the steps for them.

Arlen Holder

unread,
Nov 24, 2020, 10:54:19 AM11/24/20
to
On 24 Nov 2020 15:40:51 GMT, Frank Slootweg wrote:

> I have done it in the past, but I did it completely on Windows.

Hi Frank,

The question here is a tough question which takes intelligence to resolve.
o And it will take a thorough knowledge of both Windows & Android printing

I'm not sure what it means if you said you did it, but you did it
"completely" on Windows.

If I have to guess, it means you copied (or emailed, or used the net) to
get the file over to Windows and then you printed wholly from Windows.

If that assumption is correct, it won't work for Android file types that
are not viewable in Windows, nor is that the point of the question anyway.

We all know we can print "most" Android files directly from Windows.
o We all also know we can use the Internet in some fashion to print.

The question here is how to use what we have on the LAN, to print.
o From Android to the printer (perhaps through a Windows CUPS/SMB server?)
I
> think it's not wise to - try to - copy a 'live' Android filesystem.

Again, I don't understand you; but you just brought up an interesting test.
o I could try genymotion emulation with Android on top to see if it prints!

> One has to use Windows anyway, so why not do the whole job on Windows?

Some Android files don't view on Windows.
o And that isn't the point anyway.

The point is to be efficient (always!).
o The point is to print _directly_ from Android to the printer.

As a workaround, it's ok if that print process uses a Windows server as an
intermediary (e.g., a Windows' shared printer perhaps?).

To solve this problem, as we solve many problems, will take intelligence.

> And one has to remove the small capacity card at some point, so why not
> do it straight away?

See above.

> Basically change the question to: How would you copy a MicroSD card on
> a Windows system? And the add the Android card-removal/card-insertion
> bits.

As you are well aware, we can "mount" (for some definitions of "mount") the
entire Android filesystem onto Windows; but that isn't the question here.

The question here will take intelligence to resolve.
o And it will take a thorough knowledge of both Windows & Android printing

> [I hope I got this right (but you get the idea):]
> - Power down the Android device.
> - Remove the small capacity card from the Android device, put it in the
> MicroSD-to-SD adapter and insert it in the SD-card reader of the
> Windows system.
> - Copy all folders from the SD-card to the computer's HDD.
> - 'Safely remove' the SD-card.
> - Remove small capacity card. Insert large capacity card. Insert SD-card
> in SD-card reader.
> - Copy all the folders from the HDD to the large capacity card.
> - 'Safely remove' the SD-card.
> - Remove large capacity card and insert it in the Android device.
> - Power up the Android device.

It's even easier than that, which, summarized is:
a. Mount the entire Android visible file system on Windows
b. Open/view/edit the Android file from Windows & hit "File > Print"

The problem is that's not the question...
o And that doesn't solve the problem for filetypes not viewable on Windows.

But more than that, it's not the solution (but it is a workaround).

The question here is a tough question which takes intelligence to resolve.
o I wouldn't have asked the question if it were easy to resolve.

> Given the scenario an circumstances, I advise to try it yourself and
> document the steps for them.

As you know, I love to leverage what we learn to a step-by-step tutorial.
o But we are nowhere near that stage at this early point in learning time

In the end, I hope to resolve this problem, as we resolve 99% (or so) of
all the questions we ask on Usenet (less so on iOS than on Android, and
Windows is about even with Linux nowadays).

It will take two things to resolve this problem set:
o Intelligence & knowledge of both Android & Windows network printing

BTW, it's a pain to make screenshots, but here's what I documented so far:
o <https://i.postimg.cc/zD0CDJZz/printing01.jpg> Android10 ConnectionPrefs
o <https://i.postimg.cc/xdvmwQ3S/printing02.jpg> ConnectionPrefs > Printing
o <https://i.postimg.cc/PxdDh7Sv/printing03.jpg> Search > Print > Services
o <https://i.postimg.cc/pTkFdBSG/printing04.jpg> ? > Print > Documentation
o <https://i.postimg.cc/5N8c5d9T/printing05.jpg> Added free IPP print apps
o <https://i.postimg.cc/Y9TVg85t/printing06.jpg> 11 print services on

Arlen Holder

unread,
Nov 24, 2020, 10:57:40 AM11/24/20
to
On Tue, 24 Nov 2020 15:54:18 -0000 (UTC), Arlen Holder wrote:

> The question here is a tough question which takes intelligence to resolve.
> o And it will take a thorough knowledge of both Windows & Android printing

Yikes!!!!!!!!!

Mea culpa!

I'm sorry....

I apologize!

I apologize to both Frank and to the newsgroups at large.

I made a boo boo.

I was deep into debugging the Android printing when I saw Frank's
purposefully helpful response, and I simply blitzed out on it.

For some strange reason, I was so _deeeeeep_ into trying to figure out why
PRINTING didn't work, that every word from Frank "seemed" to be about
printing.

And yet it was not at all about printing.

I don't think I've blacked out that much in a looooooong time.
I'm sorry Frank.

Please ignore my entire post as my brain was only deeply thinking about
PRINTING (as I'm struggling to resolve the printing problem).

I apologize.
The entire post was a mistake that is my fault and my fault alone.

You were trying to be purposefully helpful on the sdcard topic.
o I'm sorry.

Arlen Holder

unread,
Nov 24, 2020, 11:18:59 AM11/24/20
to
On 24 Nov 2020 15:40:51 GMT, Frank Slootweg wrote:

> I have done it in the past, but I did it completely on Windows. I
> think it's not wise to - try to - copy a 'live' Android filesystem.
> One has to use Windows anyway, so why not do the whole job on Windows?
> And one has to remove the small capacity card at some point, so why not
> do it straight away?

Hi Frank,
Now I know why I didn't understand your post! I was extremely deep into juggling a whole bunch of tests to print to Android, and, for some brain-fart-related reason, it seemed EVERYTHING was about printing.

Anyway, I apologize for my prior response, and now, with my brain reset on solving how to move "stuff" from one sdcard to another, I too would _first_ try to do the whole thing on Windows (it's so much easier to move stuff).

> Basically change the question to: How would you copy a MicroSD card on
> a Windows system? And the add the Android card-removal/card-insertion
> bits.

Yes! You get it. Thanks.
o It's a copy - but - a copy that has the Android bits (if any).

A straight "dd" might work (if it exists on Windows, and it should), but even then, we want the entire 128GB of the new sdcard to be useful.

Googling for "dd" I found a few hits that seem to be the exact question
o Even as they all seem to be mere shills for the software being suggested.

o How to Clone Android SD Card to A Larger One?
<https://www.diskpart.com/clone/clone-android-sd-card-to-a-larger-one-4125.html>
"AOMEI Partition Assistant Standard should be the best free Android SD
card cloning software that can help you clone your Android SD card
safely. It supports you to clone SD card to other places including
internal hard drive, external hard drive, a USB flash drive, or another
SD card. What's the important, with this Android SD card cloning
software, you can upgrade your small SD to larger SD card without
losing data."

o How to Clone Android SD Card to A Larger One
<https://www.easeus.com/todo-backup-resource/clone-android-sd-card-to-a-larger-one.html>
"If you are looking for a secure but effective solution to clone SD card
or clone hard disk without losing any data, EaseUS software can help.
It provides you a free & professional disk clone software, EaseUS Todo
Backup Free to assist you migrating old data to a new storage device
thoroughly without any obstacles."

o How To Clone And Backup Your SD Card For Android And Windows
<https://www.faceofit.com/how-to-clone-and-backup-your-sd-card-for-android-and-windows/>
"Cloning an Android SD Card using EaseUS Todo Backup Free Tool"
(Also see Windows command-prompt method below)

If necessary, we can use Linux but I prefer Windows 10 lately:
o SD card cloning using the dd command
<https://askubuntu.com/questions/227924/sd-card-cloning-using-the-dd-command>

> [I hope I got this right (but you get the idea):]
> - Power down the Android device.
> - Remove the small capacity card from the Android device, put it in the
> MicroSD-to-SD adapter and insert it in the SD-card reader of the
> Windows system.
> - Copy all folders from the SD-card to the computer's HDD.
> - 'Safely remove' the SD-card.
> - Remove small capacity card. Insert large capacity card. Insert SD-card
> in SD-card reader.
> - Copy all the folders from the HDD to the large capacity card.
> - 'Safely remove' the SD-card.
> - Remove large capacity card and insert it in the Android device.
> - Power up the Android device.

Yes. I get the idea. It would likely work "if" the Android bits are set.
o Maybe there are no Android bits to set though (how would I know?)

Looking it up, this "implies" there aren't any "android bits" to set:
o Backup and Clone your SD Card using the Windows Command Prompt
<https://www.faceofit.com/how-to-clone-and-backup-your-sd-card-for-android-and-windows/>
1. Open command prompt and run as Administrator (Elevated Privileges)
2. Ensure that the old SD Card is in the card slot
3. Type C:>Enter (Change Driver Letter Path as per your Installation and Preferences)
4. Type cd / Enter (Change Directory)
5. md sd-cardbackup (Make Directory)
6. cd sd-cardbackup (Change to the new directory)
7. xcopy G:*.* /S /E /V (Copy All contents, time taken depends upon content size)
8. Eject the Old SD Card and replace with the new one.
9. Type C:
10. cd /
11. cd sd-cardbackup
12. xcopy *.* G: /S /E /V

This also implies there are no "android bits" to set:
o Clone SD card to SD card
<https://www.bleepingcomputer.com/forums/t/698064/clone-sd-card-to-sd-card>
"I attached cell to PC via USB and the new SD card to the PC
using a SD/USB interface device. Transfer worked fine as
did new SD card once installed in phone."

So maybe it is just a mere copy, even as I personally have camera
apps saving directly to the sdcard, linkers which link to the sdcard,
apps that automagically move things like screenshots to the sdcard,
maps and other programs running off the sdcard itself, etc.

Who knows what other people have done by way of "android bits" set.

I would have thought all those "android bits" might be a hurdle.
o But maybe not.

> Given the scenario an circumstances, I advise to try it yourself and
> document the steps for them.

Everything you said (all of which was purposefully helpful) makes sense.
o I think I'll try one of the sdcards and "ruin it" and try it out.

While I have a different phone, with a different setup, it's worth a try:
--
Mine is a $100 Moto G7 with 64GB/4GB+64GB sdcard
o Theirs are the $130 LG Stylo 3 Plus with 32GB/2GB+64GB sdcard

Frank Slootweg

unread,
Nov 24, 2020, 11:40:33 AM11/24/20
to
Arlen Holder <arlen_...@newmachines.com> wrote:
> On 24 Nov 2020 15:40:51 GMT, Frank Slootweg wrote:
>
> > I have done it in the past, but I did it completely on Windows. I
> > think it's not wise to - try to - copy a 'live' Android filesystem.
> > One has to use Windows anyway, so why not do the whole job on Windows?
> > And one has to remove the small capacity card at some point, so why not
> > do it straight away?
>
> Hi Frank,
[...]
> Anyway, I apologize for my prior response, and now, with my brain
> reset on solving how to move "stuff" from one sdcard to another, I too
> would _first_ try to do the whole thing on Windows (it's so much
> easier to move stuff).
>
> > Basically change the question to: How would you copy a MicroSD card on
> > a Windows system? And the add the Android card-removal/card-insertion
> > bits.
>
> Yes! You get it. Thanks.
> o It's a copy - but - a copy that has the Android bits (if any).

You said the MicroSD cards are not (part of) primary storage, so they
should have a FAT file system on them and a FAT file system has no
(read: cannot have any) 'Android bits'.

[More of the same deleted.]

Arlen Holder

unread,
Nov 24, 2020, 2:44:06 PM11/24/20
to
On 24 Nov 2020 16:40:31 GMT, Frank Slootweg wrote:

> You said the MicroSD cards are not (part of) primary storage, so they
> should have a FAT file system on them and a FAT file system has no
> (read: cannot have any) 'Android bits'.

Hi Frank,

Thanks again for your purposefully helpful & cheerful clarifications.

o I took your well-meant advice by running a test following this:
o Backup and Clone your SD Card using the Windows Command Prompt
<https://www.faceofit.com/how-to-clone-and-backup-your-sd-card-for-android-and-windows/>

Moving from a $16 64GB Lexar JumpDrive S75 USB3.0 150MB/s-read 60MB/s-write
o Costco item #1027004 <https://i.postimg.cc/j2VCtRPX/sdcard02.jpg>

To a $20 128GB SanDisk Extreme PLUS microSDXC UHS-1 170MB/s-read 90MB/s-write
o Costco item #1320128 <https://i.postimg.cc/d1rDJPhn/sdcard01.jpg>

Here is a log of me taking your suggestions to heart:
0. Realizing, there are ways people "could" have set Android bits:
<https://support.motorola.com/us/en/products/cell-phones/moto-g-family/moto-g7/documents/MS135867>
1. I plugged the 128GB card into the "SD/Mini/MMC/RS/Plus/Mobile" slot.
2. It took a while but that finally mounted after about a minute.
It mounted as "WTF2 (F:)" 119GB free of 119GB, icon is "SD/XC".
3. On Android 10, I ejected & removed the 64GB sdcard as shown here:
<https://support.motorola.com/us/en/Solution/MS135824>
Android10:Settings > Storage > {select portable storage} > eject
4. I moved the write slider on the sdcard away from the gold pins.
5. I plugged the 64GB card into the "SD/Mini/MMC/RS/Plus/Mobile" slot.
This time it mounted faster (probably was loading drivers last time).
6. That mounted as "sdcard1 (F:)" 12.2GB free of 59.6 GB
(A rightclick > Properties on the drive shows about ~50GB.)
7. Win+R > cmd {control+shift+enter}
8. In the Administrator window: cd c:\data\bck\
9. In the Administrator window: md 20201124_sdcard_motog7
10. In the Administrator window: cd 20201124_sdcard_motog7
11. In the Administrator window: xcopy F:*.* /S /E /V
(Note that your drive letter may differ.)
12. In a separate command window: time
The current time is: 6:58:51.45
(Wait for it to complete: ... 3964 File(s) copied ...
The current time is: 7:39:30.22 (i.e., ~41 minutes)
Note it took roughly about ~1 minute for each gigabyte of data.
13. In Windows Explorer, right click to "Eject" the card in the F: drive.
14. Replace the old 64GB card with the new 128GB card
15. Move the write-slider toward the gold pins & plug it into the computer
16. In the Administrator window: cd c:\data\bck\20201124_sdcard_motog7
17. xcopy *.* F: /S /E /V
18. In a separate command window: time
The current time is: 7:52:20.87
(Wait for it to complete: ... 3964 File(s) copied ...
The current time is: 9:14:55.04 (i.e., ~92 minutes)
Note it took roughly about ~2 minutes for each gigabyte of data.
(A rightclick > Properties on the drive shows about ~50GB.)
19. In Windows, rightclick on the "F:" drive to "Eject".
20. Insert the new 128GB sdcard into the Moto G7 sim/sdcard tray.
21. Power up the Android phone and test it out to see if all works.

Drat! I forgot (at least) one step!

In hindsight, I should have _named_ it while it was on Windows.
o I don't know why but it's a PITA sometimes to rename a card in Android.

If this were for real, I would have wanted the name to be "sdcard1"
o Not "SanDisk SD card" (why would I want spaces & to type advertisements?)
--
Given I've had plenty of trouble trying to rename an sdcard while it's
mounted on an Android phone, and even after removing it, renaming it in
Windows, have you much experience with the best way to rename sdcards?

Arlen Holder

unread,
Nov 25, 2020, 2:01:49 AM11/25/20
to
On Tue, 24 Nov 2020 19:44:05 -0000 (UTC), Arlen Holder wrote:

> In hindsight, I should have _named_ it while it was on Windows.
> o I don't know why but it's a PITA sometimes to rename a card in Android.
> If this were for real, I would have wanted the name to be "sdcard1"
> o Not "SanDisk SD card" (why would I want spaces & to type advertisements?)

UPDATE:
o <https://i.postimg.cc/d1rDJPhn/sdcard01.jpg> $16 64GB Lexar sdcard
o <https://i.postimg.cc/j2VCtRPX/sdcard02.jpg> $20 128GB SanDisk sdcard
o <https://i.postimg.cc/cH31wPy2/sdcard03.jpg> Android sdcard filesystem

Thanks for all the kind help, where I hope to give back in details
o So that, as always, others benefit from every action we each take.

I don't understand (yet anyway) how sdcards are "named" while in Android.
o However, I'm pleasantly surprised that, so far, everything is working.

Nor do I understand (nor may I ever) why Android creates these new folders
o However, I avoid those folders by creating a "data1" hierarchy of my own

Everything else was created by the phone (which I leave alone if I can):
o /sdcard1/Alarms
o /sdcard1/Android
o /sdcard1/DCIM
o /sdcard1/Download
o /sdcard1/LOST.DIR
o /sdcard1/Movies
o /sdcard1/Music
o /sdcard1/Notifications
o /sdcard1/Pictures
o /sdcard1/Podcasts
o /sdcard1/Ringtones

My rule, on Windows & Android, is to create a single hierarchy that I
control and that the operation system doesn't know about (so to speak).

Then I put the data I care about in _that_ folder (if possible).
o And that's the only folder (in general) I need to back up & restore.

I'm guessing Android has a built-in internal name for the sdcard
o Such that it doesn't matter what the sd card "thinks" it's named.

Is that right?

Frank Slootweg

unread,
Nov 25, 2020, 11:36:47 AM11/25/20
to
Arlen Holder <arlen_...@newmachines.com> wrote:
> On Tue, 24 Nov 2020 19:44:05 -0000 (UTC), Arlen Holder wrote:
>
> > In hindsight, I should have _named_ it while it was on Windows.
> > o I don't know why but it's a PITA sometimes to rename a card in Android.
> > If this were for real, I would have wanted the name to be "sdcard1"
> > o Not "SanDisk SD card" (why would I want spaces & to type advertisements?)
>
> UPDATE:
> o <https://i.postimg.cc/d1rDJPhn/sdcard01.jpg> $16 64GB Lexar sdcard
> o <https://i.postimg.cc/j2VCtRPX/sdcard02.jpg> $20 128GB SanDisk sdcard
> o <https://i.postimg.cc/cH31wPy2/sdcard03.jpg> Android sdcard filesystem
>
> Thanks for all the kind help, where I hope to give back in details
> o So that, as always, others benefit from every action we each take.
>
> I don't understand (yet anyway) how sdcards are "named" while in Android.
> o However, I'm pleasantly surprised that, so far, everything is working.
[...]
> I'm guessing Android has a built-in internal name for the sdcard
> o Such that it doesn't matter what the sd card "thinks" it's named.
>
> Is that right?

I don't know how Android names the mounted SD-cards. AFAIK, all my
mounted SD-cards are just named "SD card", i.e. not with a vendor name
(SanDisk) such as yours. Note that this 'name' is not the Unix
*mountpoint* name, because that's for example sdcard0, sdcard, etc..

I think that 'SD card' and 'Internal Storage' are just extra internal
Android names to - try to - hide the user-unfriendly, confusing and
triplicate (/mnt/* , /sdcard and /storage/*) 'mountpoint' names.

In any case, yours is not named after the 'volume label' of the FAT
file system on the card, because that is "WTF2" (see your other post).

Arlen Holder

unread,
Nov 27, 2020, 12:08:06 AM11/27/20
to
On 25 Nov 2020 16:36:45 GMT, Frank Slootweg wrote:

> I don't know how Android names the mounted SD-cards. AFAIK, all my
> mounted SD-cards are just named "SD card", i.e. not with a vendor name
> (SanDisk) such as yours. Note that this 'name' is not the Unix
> *mountpoint* name, because that's for example sdcard0, sdcard, etc..
>
> I think that 'SD card' and 'Internal Storage' are just extra internal
> Android names to - try to - hide the user-unfriendly, confusing and
> triplicate (/mnt/* , /sdcard and /storage/*) 'mountpoint' names.
>
> In any case, yours is not named after the 'volume label' of the FAT
> file system on the card, because that is "WTF2" (see your other post).

Hi Frank Slootweg,

Thank you for that purposefully helpful advice on sdcard naming.
o I don't claim to understand _how_ Android names these things.

Interestingly, look at this picture I just took of my new sdcard naming:
o <https://i.postimg.cc/CMzvhP9r/nitroshare03.jpg>

Notice that new 128GB sdcard appears to be named (3661-3535).
o Have any of you seen those kind of funky numbers for sdcards before?

I "think" that's the _real_ internal name for that sdcard...
o But I'm not sure what it is...
--
The screenshot came from this tutorial I just published moments ago:
o Tutorial NitroShare FOSS cross-platform file & folder transfer over Wi-Fi between any desktop & Android
<https://groups.google.com/g/comp.mobile.android/c/mbOyLNcrCK4>

Alan Baker

unread,
Nov 27, 2020, 3:01:47 AM11/27/20
to
On 2020-11-26 9:08 p.m., Arlen Holder wrote:
> On 25 Nov 2020 16:36:45 GMT, Frank Slootweg wrote:
>
>> I don't know how Android names the mounted SD-cards. AFAIK, all my
>> mounted SD-cards are just named "SD card", i.e. not with a vendor name
>> (SanDisk) such as yours. Note that this 'name' is not the Unix
>> *mountpoint* name, because that's for example sdcard0, sdcard, etc..
>>
>> I think that 'SD card' and 'Internal Storage' are just extra internal
>> Android names to - try to - hide the user-unfriendly, confusing and
>> triplicate (/mnt/* , /sdcard and /storage/*) 'mountpoint' names.
>>
>> In any case, yours is not named after the 'volume label' of the FAT
>> file system on the card, because that is "WTF2" (see your other post).
>
> Hi Frank Slootweg,
>
> Thank you for that purposefully helpful advice on sdcard naming.
> o I don't claim to understand _how_ Android names these things.

And yet, there is so much you DO claim to understand that you clearly do
not.

Arlen Holder

unread,
Nov 27, 2020, 10:40:11 AM11/27/20
to
On Fri, 27 Nov 2020 05:08:06 -0000 (UTC), Arlen Holder wrote:

> Notice that new 128GB sdcard appears to be named (3661-3535).
> o Have any of you seen those kind of funky numbers for sdcards before?

Update: [It's not as simple as one might at first think it should be.]

1. I mailed all the 128GB gift sdcards after running a quick format
2. During the exFat format process, I named each sdcard 'sd1'
3. I asked each person to read this thread for how to set it up

Interestingly, in the interest of learning more, look at this shot:
<https://i.postimg.cc/SKXTMVfx/sdcard04.jpg>

That's the old & new sdcard showing they have different "serials".
o What's interesting is the question of how these filespecs really work.

If someone who knows can explain how the filespec works for Android sdcards
o That would be actually adding value which everyone can benefit from.

Running a search, it turns out to be a more complex answer than
it at first may appear based on the seeming simplicity of the question:
o <https://forums.androidcentral.com/samsung-galaxy-s7/668364-whats-external-sdcard-path.html>
o <https://stackoverflow.com/questions/5858107/how-to-get-file-path-from-sd-card-in-android>
o <https://stackoverflow.com/questions/23123461/external-sdcard-file-path-for-android>
o <https://stackoverflow.com/questions/11281010/how-can-i-get-the-external-sd-card-path-for-android-4-0/18871043#18871043>
o <https://stackoverflow.com/questions/13361024/how-to-get-the-internal-and-external-sdcard-path-in-android>

Some notable quotes:
"The Internal and External Storage terminology according to
Google/official Android docs is quite different from what we think."
"Android does not have a full-proof public method to query external sdcard,
and since each manufacturer has their own way of defining "external" sdcard,
you'll need to get different devices and test them to determine
how external sdcard is defined for each"

o sdcardpath = Environment.getExternalStorageDirectory().getAbsolutePath();
o sdcardpath = "/mnt/extcard"
o sdcardpath = "/mnt/sdcard/"
o sdcardpath = "/storage/????-????" <== arbitrary letters & numbers
o sdcardpath = "/storage/extSdCard/"
o sdcardpath = "/storage/ext_sd/"
o sdcardpath = "/storage/external_SD/"
o sdcardpath = "/storage/removable/sdcard1/"
o sdcardpath = "/storage/sdcard1/"
o sdcardpath = "/storage/extSdCard"
o sdcardpath = "/storage/usbcard1/"
o sdcardpath = "mnt/emmc/"
o sdcardpath = "mnt/external_sd/"
o sdcardpath = "mnt/extsdcard/"
o sdcardpath = "mnt/sdcard/"
o sdcardpath = "mnt/sdcard/external_sd/"
o sdcardpath = "mnt/sdcard1/"
etc.

Worse, this is a different supposedly comprehensive list!
o <https://gist.github.com/PauloLuan/4bcecc086095bce28e22>
/storage/sdcard1 //!< Motorola Xoom
/storage/extsdcard //!< Samsung SGS3
/storage/sdcard0/external_sdcard // user request
/mnt/extsdcard
/mnt/sdcard/external_sd //!< Samsung galaxy family
/mnt/external_sd
/mnt/media_rw/sdcard1 //!< 4.4.2 on CyanogenMod S3
/removable/microsd //!< Asus transformer prime
/mnt/emmc
/storage/external_SD //!< LG
/storage/ext_sd //!< HTC One Max
/storage/removable/sdcard1 //!< Sony Xperia Z1
/data/sdext
/data/sdext2
/data/sdext3
/data/sdext4

To find what my external sdcard filespec is, I ran the following:
Termux: ls /storage
Reports: B31E-4294 emulated self
Termux: ls /storage/B31E-4294 (reports "Permission denied")
Termux: ls /storage/emulated (reports "Permission denied")

Then I ran "AIDA64 > Directories", which reported:
o Primary external storage = /storage/B31E-4294
o Runtime mnt = /mnt/media_rw/B31E-4294

Then I used SimpleMobileTools "File Manager" to "copy path"
o Path = /storage/B31E-4294

I tried "Amaze file manager" which showed the same.
o As did "OI File Manager"

And yet, the Google File Manager shows it as:
o Path = /storage/sdcard1

Go figure.

In summary, it's easy to identify the unique filespec of the sdcard
on any device, but if you know how to _change_ that filespec from
/storage/????-???? to something easier to type (& remember) such as
/storage/sd1 on non-rooted Android, please let us all know,
as that would benefit many.
--
Morons with an IQ of about 50 like Snit & Diesel always pretend to know the answer;
while intelligent people aren't at all afraid to openly admit they don't (yet).

Frank Slootweg

unread,
Nov 27, 2020, 11:15:08 AM11/27/20
to
Arlen Holder <arlen_...@newmachines.com> wrote:

[Lots deleted.]

> Go figure.
>
> In summary, it's easy to identify the unique filespec of the sdcard
> on any device, but if you know how to _change_ that filespec from
> /storage/????-???? to something easier to type (& remember) such as
> /storage/sd1 on non-rooted Android, please let us all know,
> as that would benefit many.

As I hinted at in an earlier response, have a look if there are
*other* *simple* paths, which also point to the SD-card.

For example on one of my devices, all these paths point to the
SD-card:

/storage/sdcard0
/mnt/sdcard
/sdcard

The first one isn't handy, because the '0' might be another number on
another device.

The second one is not great either, because it's the name of a mount
point, not the pathname of a mounted filesystem.

The third one is perfect, because it doesn't get any simpler and
unambiguous than '/sdcard', does it!?

AFAICT, /mnt/sdcard and /sdcard are just symbolic links to
/storage/sdcard0. ES File Explorer shows these with a bent arrow in the
lower-left corner (much like Windows shows for a shortcut on the
Desktop).

How did I find these? Just by using ES File Explorer and browsing the
(root) file system with basic Unix knowledge. I.e. for example mounted
file systems should mount 'over' /mnt. And /storage is (AFAIK) an
Android thing.

HTH.

Arlen Holder

unread,
Nov 27, 2020, 11:21:35 AM11/27/20
to
SOLVED:
(together, we almost never, if ever, fail to solve the key issues)

Here is a log of me taking your suggestions to heart:
0. This assumes you have not set too many Android "bits" as shown here:
<https://support.motorola.com/us/en/products/cell-phones/moto-g-family/moto-g7/documents/MS135867>
1. Plug the new 128GB card into the PC "SD/Mini/MMC/RS/Plus/Mobile" slot.
2. Mine mounted as "WTF2 (F:)" 119GB free of 119GB, icon is "SD/XC".
3. On Android 10, I ejected & removed the old 64GB sdcard as shown here:
<https://support.motorola.com/us/en/Solution/MS135824>
Android10:Settings > Storage > {select portable storage} > eject
4. Move the write slider on the sdcard away from the gold pins.
5. I plugged the 64GB card into the PC "SD/Mini/MMC/RS/Plus/Mobile" slot.
6. That mounted as "sdcard1 (F:)" 12.2GB free of 59.6 GB
(A rightclick > Properties on the drive shows about ~50GB.)
Note the name of the card as you may wish to reproduce or change it.
(although that change is problematic, and hasn't yet been solved)
7. Win+R > cmd {control+shift+enter} <== this gets you an admin prompt
8. In the Administrator window: cd c:\data\bck\ <== whatever you use
9. In the Administrator window: md 20201124_sdcard_bck
10. In the Administrator window: cd 20201124_sdcard_bck
11. In the Administrator window: xcopy F:*.* /S /E /V
(Note that your drive letter may differ.)
Note it took roughly about ~1 minute/GB to copy the data.
12. In Windows Explorer, right click to "Eject" the card in the F: drive.
13. Replace the old 64GB card with the new 128GB card
14. Move the write-slider toward the gold pins & plug it into the computer
15. Format the new 128GB card & give it the desired name
exFAT is ok, quick format is ok
Name = sd1 (or whatever you want the name to be)
(although that change is problematic, and hasn't yet been solved)
16. In the Administrator window: cd c:\data\bck\20201124_sdcard_bck
17. xcopy *.* F: /S /E /V
Note it took roughly about ~2 minutes/GB to write the data.
18. In Windows, rightclick on the "F:" drive to "Eject".
19. Insert the new 128GB sdcard into the Moto G7 sim/sdcard tray.
20. Power up the Android phone and test it out to see if all works.

One open question is how to _change_ the unique external sdcard name
as it shows up inside of Android, from /storage/????-???? to something
easier to type (& remember) such as /storage/sd1 on non-rooted Android.
o If you can do that, please let us all know how, as all would benefit.

Note the path to the sdcard can be any of the following, unfortunately:
o sdcardpath = "/mnt/extcard"
o sdcardpath = "/mnt/sdcard/"
o sdcardpath = "/storage/????-????" <== arbitrary letters & numbers
o sdcardpath = "/storage/extSdCard/"
o sdcardpath = "/storage/ext_sd/"
o sdcardpath = "/storage/external_SD/"
o sdcardpath = "/storage/removable/sdcard1/"
o sdcardpath = "/storage/sdcard1/"
o sdcardpath = "/storage/extSdCard"
o sdcardpath = "/storage/usbcard1/"
o sdcardpath = "mnt/emmc/"
o sdcardpath = "mnt/external_sd/"
o sdcardpath = "mnt/extsdcard/"
o sdcardpath = "mnt/sdcard/"
o sdcardpath = "mnt/sdcard/external_sd/"
o sdcardpath = "mnt/sdcard1/"
etc.

To find what my external sdcard filespec is, I ran the following:
Termux: ls /storage
Reports: B31E-4294 emulated self
Termux: ls /storage/B31E-4294 (reports "Permission denied")
Termux: ls /storage/emulated (reports "Permission denied")

Then I ran "AIDA64 > Directories", which reported:
o Primary external storage = /storage/B31E-4294
o Runtime mnt = /mnt/media_rw/B31E-4294

Then I used SimpleMobileTools "File Manager" to "copy path"
o Path = /storage/B31E-4294

I tried "Amaze file manager" which showed the same.
o As did "OI File Manager"

And yet, the Google File Manager shows it as:
o Path = /storage/sdcard1

What we need is a foolproof way to _change_ the path from,
for example, /storage/B31E-4294, to something easier to
remember such as /storage/sd1 on non-rooted Android.

This is especially useful for those apps which require
you to manually enter in a path (such as backup programs).

If you know how to make that change permanent, please advise.
o e.g., I changed mine to "sd1" in Windows; but it made no difference.
--
People who don't know the answer, like Snit, always pretend they do.
(and yet, they never come up with the answer; it's all make believe)

joe

unread,
Nov 27, 2020, 11:38:50 AM11/27/20
to
On 11/26/2020 11:08 PM, Arlen Holder wrote:
>
> Notice that new 128GB sdcard appears to be named (3661-3535).
> o Have any of you seen those kind of funky numbers for sdcards before?
>
> I "think" that's the _real_ internal name for that sdcard...
> o But I'm not sure what it is...
>

Could this be what you are looking at?
https://en.wikipedia.org/wiki/Volume_serial_number


Arlen Holder

unread,
Nov 27, 2020, 12:04:09 PM11/27/20
to
On 27 Nov 2020 16:15:06 GMT, Frank Slootweg wrote:

> As I hinted at in an earlier response, have a look if there are
> *other* *simple* paths, which also point to the SD-card.
>
> For example on one of my devices, all these paths point to the
> SD-card:
>
> /storage/sdcard0
> /mnt/sdcard
> /sdcard
>
> The first one isn't handy, because the '0' might be another number on
> another device.
>
> The second one is not great either, because it's the name of a mount
> point, not the pathname of a mounted filesystem.
>
> The third one is perfect, because it doesn't get any simpler and
> unambiguous than '/sdcard', does it!?
>
> AFAICT, /mnt/sdcard and /sdcard are just symbolic links to
> /storage/sdcard0. ES File Explorer shows these with a bent arrow in the
> lower-left corner (much like Windows shows for a shortcut on the
> Desktop).
>
> How did I find these? Just by using ES File Explorer and browsing the
> (root) file system with basic Unix knowledge. I.e. for example mounted
> file systems should mount 'over' /mnt. And /storage is (AFAIK) an
> Android thing.

Hi Frank,

Thank you for your purposefully helpful hints, where I have run into this
filespec of the external sdcard (not the internal storage!) for a while.

If we can solve this problem set for everyone, that would be worthwhile.
o But it's not going to be easy because each OEM is different (AFAIK).

A lot of people get confused about the "internal" memory designation
o Versus the _external_ memory card designation (they're similarly named)

I'm not completely sure, but I "think" sdcard0 is the _internal_ storage
"card" (in Android terminology); where what we want is the _external_ card.

I just checked in SimpleMobileTools File Manager, which has a function
to "copy path to clipboard" for any file that I select, and where I have
a "0data" folder & "1data" folder on the respective sdcard positions.
o The "0data" filespec is "/storage/emulated/0/0data" <== internal memory
o The "1data" filespec is "/storage/B31E-4294/1data" <== external storage
Where the goal is to get that external 1data filespec to permanently be:
o /storage/sd1/1data

I repeat since there's some confusion - we're not asking about the filespec
to the internal (built-in) storage memory; we're asking about the
_external_ (i.e., physically removable) sdcard (in a physical sdcard slot).

Doublechecking in Termux, these horrid filespecs exist on my Moto G7:
o Termux: cd /storage/emulated/0/0data => works
o Termux: cd /storage/B31E-4294/1data => works

But this failed on my Android 10 Moto G7 just now:
o Termux: cd /storage/sdcard0/0data => no such file or directory
o Termux: cd /storage/sdcard0/1data => no such file or directory

However this worked (which proves "/mnt/sdcard" is the _internal_ memory):
o Termux: cd /mnt/sdcard/0data => works
Yet this said "No such file or directory" (showing external is different):
o Termux: cd /mnt/sdcard/1data => no such file or directory

Likewise, the same thing happened with "/sdcard":
o Termux: cd /sdcard/0data => works
o Termux: cd /sdcard/1data => no such file or directory

Testing everything you suggested, all these failed in my tests:
o Termux: cd /storage/sdcard0/0data => no such file or directory
o Termux: cd /storage/sdcard0/1data => no such file or directory
o Termux: cd /storage/sdcard1/0data => no such file or directory
o Termux: cd /storage/sdcard1/1data => no such file or directory

Interestingly, as you hinted, there should be "simpler" paths
to the _external_ sdcard; but they're not easy to find:
o Termux: cd /mnt/sdcard1/1data => no such file or directory
o Termux: cd /mnt/sd1/1data => no such file or directory
o Termux: cd /storage/sdcard1/1data => no such file or directory
o Termux: cd /storage/emulated/1/1data => no such file or directory
etc.

In summary, it's easy to find simple paths to the "internal" sdcard
(i.e., the built-in storage); but it's not so easily done for the
_external_ sdcard (i.e., the physically removable sdcard).

If anyone can find the solution to these two problems
o Everyone will greatly benefit from the simplification

Problem 1: Find the simplest path to the _external_ sdcard, and,
Problem 2: Tell us how to _change_ it to be simpler (e.g., /mnt/sd1/1data)
(for non-rooted Android)
--
Some problem sets seem so simple; until you actually try them out.

Arlen Holder

unread,
Nov 27, 2020, 12:15:12 PM11/27/20
to
On Fri, 27 Nov 2020 10:38:44 -0600, joe wrote:

> Could this be what you are looking at?
> https://en.wikipedia.org/wiki/Volume_serial_number

Hi joe,

Thank you for your purposefully helpful suggestion, where I agree that what
we're most likely looking at when we seek the path to the external sdcard
is it's "some kind of" identifying serial number, perhaps even "unique".

However, this is an 8-character serial (as far as I can see):
o <https://i.postimg.cc/SKXTMVfx/sdcard04.jpg> serial number of some sort

The cite you provided says it's 32 bits determined by the data and time on
the real-time clock on the computer at the time of formatting.

Of course, we can likely represent 8 characters in 32 bits, so it still
could be the same thing, where, if it is, the trick would be to change it
to something _simpler_ to type, such as "00000000" or "xxxxxxxx".

Notice the current name is "B31E-4294" which, on an Android keyboard, is a
PITA to type due to the case and dashes and mixes of characters & numbers.

In summary, if it is the volume serial number, the question to answer that
will benefit everyone is how to change it to something simpler to type
(e.g., fewer characters, no dashes, no upper-case letters, no mix of
letters & characters).
--
People working together can solve problems that benefit everyone greatly.

Arlen Holder

unread,
Nov 27, 2020, 12:29:05 PM11/27/20
to
Regarding what this number is (and how to change it to something simpler):
o <https://i.postimg.cc/SKXTMVfx/sdcard04.jpg>

When I looked at the references in the cite joe helpfully provided
o Volume Serial Number
<https://en.wikipedia.org/wiki/Volume_serial_number>

That wiki referenced this article on _changing_ volume serial numbers:
o Changing a Disk's Volume Serial Number
<www.brettglass.com/ttr19980206a.html>

That article distinguishes between:
o Volume label <== given to the disk by the user
o Volume serial number <== 4-byte number stamped at the time of format

And it says the location where that VSN is stored is different
o Depending on the type of file system (e.g., FAT vs FAT32)

In summary, given the external disk is clearly labed with 8 characters of
the format ????-????, does anyone here know what created those characters?

Better yet, so all benefit, if anyone knows how we could simplify those 8
characters, perhaps to something like 0000-0000 or xxxx-xxxx, that would
benefit many of us who, at times, need to type it out.
--
Usually there's at least one person on the planet who has already done it.

Arlen Holder

unread,
Nov 27, 2020, 10:40:53 PM11/27/20
to
Update:

Interestingly, I noticed a few minor "gotchas" when testing the method of
just copying the old (smaller) sdcard to the new (bigger) sdcard, which,
surprisingly, hit me even after I put the _original_ sdcard back in!

(Note I had never needed the larger external card, although I just bought
a SanDisk 400GB sdcard for about forty bucks last night for Black Friday)
o SanDisk 400GB Ultra microSDXC UHS-I Memory Card with Adapter
- 120MB/s, C10, U1, Full HD, A1, Micro SD Card - SDSQUA4-400G-GN6MA
<https://www.amazon.com/SanDisk-400GB-microSDXC-Memory-Adapter/dp/B08GYG5SVQ>

For one, old "links" to documents on the old sdcard (which are in the exact
same place on the new sdcard) don't seem to work, but they're easy to fix.

Also some hard-coded paths to the old sdcard no longer work with the new
sdcard, particularly with my automatic APK backup programs.

Both problems I am wont to attribute to the fact that the path to the old
card changed at the highest level, which, so far, nobody has found a way to
replicate between the old card and the new card, as shown in this shot:
o <https://i.postimg.cc/SKXTMVfx/sdcard04.jpg> old & new path

Hence, the transition is by no means perfect, but it's not difficult to
recover (you just re-create any hard-coded paths to external card
filespec).

In the future, it would be great if we can _understand_ how that filespec
works for _external_ sdcards, so that we can actually copy them (much as
some people copied floppys for flight simulator games in the past which had
a hard coded volume serial number on each floppy disk in an area of the
disk which isn't noticed by the copy command).
--
Note: I got around the hard-coded APK backup problem above simply by
setting my Google Play to automatically archive APKs upon installation, and
to set F-Droid to do the same, which isn't something most people seem to
know how to do as I just figured out how very recently myself.

See details in:
o Does anyone know if the F-Droid app saves the APKs on non-rooted Android?
<https://groups.google.com/g/comp.mobile.android/c/onNrUUa4bSI>

o What method you use to backup & share your installed apps on Android?
<https://groups.google.com/g/comp.mobile.android/c/FsRRoQbdKeo>

Frank Slootweg

unread,
Nov 28, 2020, 1:48:38 PM11/28/20
to
Arlen Holder <arlen_...@newmachines.com> wrote:
[...]
[...]
>
> If we can solve this problem set for everyone, that would be worthwhile.
> o But it's not going to be easy because each OEM is different (AFAIK).
>
> A lot of people get confused about the "internal" memory designation
> o Versus the _external_ memory card designation (they're similarly named)
>
> I'm not completely sure, but I "think" sdcard0 is the _internal_ storage
> "card" (in Android terminology); where what we want is the _external_ card.

I don't think there is a standard, because - as I mentioned - on my
device the *SD-card* is - amongst others - /storage/sdcard0.

[...]

> Likewise, the same thing happened with "/sdcard":
> o Termux: cd /sdcard/0data => works
> o Termux: cd /sdcard/1data => no such file or directory

Bummer! So on your device /sdcard is a directory, while on my device
it's a symbolic link which points directly to the SD-card.

> Testing everything you suggested, all these failed in my tests:
> o Termux: cd /storage/sdcard0/0data => no such file or directory
> o Termux: cd /storage/sdcard0/1data => no such file or directory
> o Termux: cd /storage/sdcard1/0data => no such file or directory
> o Termux: cd /storage/sdcard1/1data => no such file or directory
>
> Interestingly, as you hinted, there should be "simpler" paths
> to the _external_ sdcard; but they're not easy to find:
> o Termux: cd /mnt/sdcard1/1data => no such file or directory
> o Termux: cd /mnt/sd1/1data => no such file or directory
> o Termux: cd /storage/sdcard1/1data => no such file or directory
> o Termux: cd /storage/emulated/1/1data => no such file or directory
> etc.

You shouldn't try all kinds of 'cd' commands, only to have them fail,
but browse the logical places, starting at the root ('/'), use 'ls -l'
to see what a thing is / things are, i.e. is some path a directory, a
symbolic link, a file, etc. and use that information.

Also the 'mount' command should tell you what is mounted where.

IOW, with Termux you have basic Unix commands at your disposal, so use
them and use them with Unix/Linux insight.

Arlen Holder

unread,
Nov 28, 2020, 4:27:28 PM11/28/20
to
On 28 Nov 2020 18:48:36 GMT, Frank Slootweg wrote:

> I don't think there is a standard, because - as I mentioned - on my
> device the *SD-card* is - amongst others - /storage/sdcard0.

Hi Frank,

Thank you for clarifying, as I had thought you had made a mistake, so I
apologize, where what you're saying is your _external_ sdcard is called
"sdcard0", whereas my _internal_ sdcard is called "sdcard0".

I appreciate that you clarified as not only is it confusing that every OEM
seems to use a different designation, but Usenet is particularly difficult
to clarify due to the nature of the medium.

I'm well aware you're not paid to help me (nor am I paid to write
tutorials), so it's with sincere appreciation that I thank you for
clarifying:
o On your Android device, /storage/sdcard0 is the _external_ sdcard.
o On my Android device, /storage/sdcard0 says "no such file or directory"

>> Likewise, the same thing happened with "/sdcard":
>> o Termux: cd /sdcard/0data => works
>> o Termux: cd /sdcard/1data => no such file or directory
>
> Bummer! So on your device /sdcard is a directory, while on my device
> it's a symbolic link which points directly to the SD-card.

Yes. I agree.

I like how yours is done, where Motorola "claims" to be more "stock Android
10", where I don't remember what yours is, but a Pixel might be a good test
of what "stock" Android 10 uses for the filespec.

The only internal-storage paths that work:
o /storage/emulated/0/{mystuff}
o /mnt/sdcard/{mystuff}

The only external-storage path that works:
o /storage/B31E-4294/{mystuff}

I suspect the reason (minor) things broke when I swapped external sdcards
was that each external sdcard always seems to have a _unique_ name.

If we, together, on Usenet, the whole team, can figure out how to _change_
the otherwise-unique name of the sdcard, then sdcard swaps would work
better since the symbolic links all failed, as did homescreen shortcuts.

> You shouldn't try all kinds of 'cd' commands, only to have them fail,
> but browse the logical places, starting at the root ('/'), use 'ls -l'
> to see what a thing is / things are, i.e. is some path a directory, a
> symbolic link, a file, etc. and use that information.

I don't really understand _why_ the "ls" fails on non-rooted Android.

For example:
o Termux: ls /storage/emulated/0 ==> Permission denied
o Termux: ls /storage/emulated/0/ ==> Permission denied
o Termux: ls /storage/emulated/0/0data ==> Permission denied
Then watch what happens when I simply do a "cd" and then "ls":
o Termux: cd /storage/emulated/0/0data ==> works
o Termux: pwd ==> reports /storage/emulated/0/0data
o Termux: ls ==> Permission denied

Go figure.

It even happens at the _next_ level:
o Termux: cd /storage/emulated/0/0data/apk ==> works
o Termux: pwd ==> reports /storage/emulated/0/0data/apk
o Termux: ls ==> Permission denied

I don't know why, offhand, I can cd into a directory, but not ls it.

> Also the 'mount' command should tell you what is mounted where.

Ah, good advice. Let's try that, oooh, nice, lots of output.
o Termux: cd /storage/emulated/0/0data ==> works
o Termux: mount > mount.txt ==> permission denied

Drat... let's try the external sdcard:
o Termux: cd /storage/emulated/0/0data ==> works
o Termux: touch mount.txt ==> permission denied

Hmmmm... the "termux user" has almost no permissions:
o Termux: cd ~ ==> works
o Termux: pwd ==> reports /data/data/com.termux/files/home
o Termux: mount > mount.txt ==> works

The problem is I can't "see" the "com.termux" in /data/data
so I can't access that mount.txt file, but I can cat it out:
o Termux: cat mount.txt | more ==> works
(it's too much to copy by hand though to put here)

> IOW, with Termux you have basic Unix commands at your disposal, so use
> them and use them with Unix/Linux insight.

I rarely use Termux, so I'm not sure what the problem is, but I think it's
just that the default permissions for the "termux user" need to be opened
up a bit.

I never needed these permissions so I'm not sure if it's as easy as chmod
o But I can't even _copy_ ~/mount.txt file to any directory I can "see".

Even my file manager won't "see" the termux-user home directory.
o What I need is to figure out why Termux has so few permissions

If anyone here knows, offhand, how to give the termux user, at the very
least, the same permissions as the Android user normally has, that would be
nice, as the termux-users seems vastly limited in its permissions.

Probably there's a setup on the permissions I may have missed but I need
o OK. There is. Who knew? Not me. (termux-setup-storage)
<https://wiki.termux.com/wiki/Internal_and_external_storage>
"Allow Termux to access photos, media and files on your device?"

But that's a different problem than that of setting the external sdcard
filespec to something simpler than what it is currently.
o /storage/B31E-4294/{mystuff}
--
What would help everyone is a way to change the external sdcard filespec.
0 new messages