:: Re: [DNG] fdisk SD card partitionin…
Top Pagina
Delete this message
Reply to this message
Auteur: ael
Datum:  
Aan: Fred
CC: dng
Onderwerp: Re: [DNG] fdisk SD card partitioning question
On Sun, Jun 12, 2022 at 12:35:06PM -0700, Fred wrote:
> On 6/12/22 09:18, Antony Stone wrote:
> > On Sunday 12 June 2022 at 17:11:45, Fred wrote:
> >
> > > Hello,
> > >
> > > I have some directories I want to back up to an SD card while preserving
> > > the permissions. I have tried to repartition a 64GB card and write an
> > > ext4 filesystem.
> >
> > What is the existing partition table?
> >
> > Out of interest, since this is ext4 and therefore Linux (not Windows), why
> > partiton at all? Why not just "mkfs.ext4 /dev/sdX"?
> >
> > > fdisk says the card has 124702720 sectors and has 59.5GB available.
> > > However it will not make a partition over 27.5GB. Why and what to do?


Are you sure that this is not just another example of "Flash Fraud"?
You could try running https://github.com/AltraMayor/f3 .


> Hi,
> As supplied the SD cards are intended to work with Windows. Under Linux
> only root can write to them and the ownership can not be changed. I want
> preserve permissions of data written to the card.


I don't follow above. SD cards usually come with a vfat file system and
are indeed set up mainly for Windoze. But if you mount with
-o uid=someone,gid=someone,..
then that someone user can write.

I do this all the time with a whole variety of sdhc cards. I only leave
them formated for vfat if I need to move them between other devices
(cameras, sat navs, ereaders which only read and write vfat). Otherwise
I use a better file system.

>
> root@aragog:# /sbin/fdisk -l /dev/sdb
> Disk /dev/sdb: 27.48 GiB, 29504831488 bytes, 57626624 sectors
> Disk model: Card-Reader
> 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: dos
> Disk identifier: 0x00000000
>
> Device     Boot Start       End   Sectors  Size Id Type
> /dev/sdb1       32768 124735487 124702720 59.5G  7 HPFS/NTFS/exFAT

>
> I don't know why the size is reported differently in two places. It is a
> 64GB card.


Are you sure?? Not a faked 32GB ?

>
> I tried your dd command line and things have gone downhill as the 64GB card
> is now only 27.4GB.


So almost certainly a fake. Did you but this from somewhere trustworthy?

> root@aragog:# /sbin/fdisk -l /dev/sdb
> Disk /dev/sdb: 27.48 GiB, 29504831488 bytes, 57626624 sectors
> Disk model: Card-Reader
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
>
>
> I tried fdisk again with the same result.
>
> root@aragog:# /sbin/fdisk /dev/sdb
> Command (m for help): n
> Partition type
>    p   primary (0 primary, 0 extended, 4 free)
>    e   extended (container for logical partitions)
> Select (default p): p
> Partition number (1-4, default 1): 1
> First sector (2048-57626623, default 2048):
> Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-57626623, default
> 57626623):

>
> Created a new partition 1 of type 'Linux' and of size 27.5 GiB.
>
> Command (m for help): d
> Selected partition 1
> Partition 1 has been deleted.
>
> Command (m for help): n
> Partition type
>    p   primary (0 primary, 0 extended, 4 free)
>    e   extended (container for logical partitions)
> Select (default p): e
> Partition number (1-4, default 1): 1
> First sector (2048-57626623, default 2048):
> Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-57626623, default
> 57626623):

>
> Created a new partition 1 of type 'Extended' and of size 27.5 GiB.
>
>
> Any ideas?


Yes. Almost certainly a fake....

ael