On 09/12/2019 21:59, Hendrik Boom wrote: > On Mon, Dec 09, 2019 at 10:45:46PM +0100, Antony Stone wrote: >> On Monday 09 December 2019 at 22:38:26, Hendrik Boom wrote: >> >>> I have an sd card that used to be in an android phone. >>> My usual tools tell me very little: >>> >>> root@midwinter:~# lsblk --fs /dev/sdb >>> NAME FSTYPE LABEL UUID MOUNTPOINT >>> sdb >>> ├─sdb1 >>> └─sdb2 >>> >>> root@midwinter:~# fdisk -l /dev/sdb >>> Disk /dev/sdb: 14.9 GiB, 15931539456 bytes, 31116288 sectors >>> Units: sectors of 1 * 512 = 512 bytes >>> Sector size (logical/physical): 512 bytes / 512 bytes >>> I/O size (minimum/optimal): 512 bytes / 512 bytes >>> Disklabel type: gpt >>> Disk identifier: 4F1502F0-81F3-49FA-A294-8B8FB4DB6964 >> >> I'm really rather surprised that a 16Gbyte SD card is has a GPT partition >> table. > > My guess is that Android put it there and that it's not what was on it > originally. > >> >>> Device Start End Sectors Size Type >>> /dev/sdb1 2048 34815 32768 16M unknown >>> /dev/sdb2 34816 31116254 31081439 14.8G unknown >>> root@midwinter:~# >>> >>> Is there another way to find out anything? >> >> Well, given that it's got a GPT partition table, try sgdisk instead of >> sfdisk. >> >>> Or is this likely to be an Google-encrypted card I can do nothing with >>> except restore it to an almost virginal state? >> >> What do you *want* to do with it? >> >> Read it, copy it, reformat it, what? > > Read it if I can (and I aready suspect I can't); otherwise reformat > it to whatever file system it is that most > consumer devices using microsd cards expect. > Kind of a factory reset. > >> >>> And what is the proper way to reformat an sdcard to the file >>> systems just about everything accepts without using >>> up its remaining lifetime? >> >> Hm, dd if=/dev/zero of=/dev/sdb bs=1M count=1 > > Yes, that will clear it out. But what file system is customarily on a new > 16G microsd card? And does that fs really need everything cleared out?
No, that will not wipe the GPT or it's backup. Use something like 'gdisk z /dev/sdb' then dd it after if paranoid. Confliction between MBR <=> GPT can cause corruption. > > -- hendrik > _______________________________________________ > Dng mailing list > [email protected] > https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng > _______________________________________________ Dng mailing list [email protected] https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
