Re: [DNG] fdisk SD card partitioning question

2022-06-15 Thread d...@d404.nl

On 14-06-2022 22:43, Jim Jackson wrote:



On Mon, 13 Jun 2022, Andreas Messer wrote:


Created a new partition 1 of type 'Linux' and of size 27.5 GiB.

You shouldn't do that. Although its possible to "partition" SD-Cards,
this is not recommended. This is since SD-Cards have some kind of
knowledge about "how FATFS works" to optimize the write cycles. This
won't work if the card is partitioned.

Bit wierd that X-gazillion Raspberry Pi's out there are expected to work
with partitioned SD cards.

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


There is a reason that SD-Cards wear out quickly with a Raspberry Pi. 
But the Pi need to boot from a FAT partition and at the same time 
Raspbian will not run on a FAT partition. Luckily you can boot them from 
the network and from USB pen drive or SSD too.


Grtz

Nick

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-14 Thread Jim Jackson



On Mon, 13 Jun 2022, Andreas Messer wrote:

> > Created a new partition 1 of type 'Linux' and of size 27.5 GiB.
> 
> You shouldn't do that. Although its possible to "partition" SD-Cards,
> this is not recommended. This is since SD-Cards have some kind of
> knowledge about "how FATFS works" to optimize the write cycles. This 
> won't work if the card is partitioned. 

Bit wierd that X-gazillion Raspberry Pi's out there are expected to work 
with partitioned SD cards.

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-13 Thread ael via Dng
On Mon, Jun 13, 2022 at 09:34:32AM +0200, Andreas Messer wrote:
> 
> However, the best way to use SD-Cards in Linux only environments is
> to format them with f2fs file system. f2fs was developed by Samsung
> with internal behavior of embedded MMC memory devices in mind. Which 
> is pretty the same like an SD-Card. With f2fs you also have 
> uid/gid as usual and it will help to improve the endurance and 
> performance of an SD-Card.

Interesting. I always use f2fs on my ssds, but it does seem to have a
large overhead, so although I think I once used it on an sdhc card for
exactly the reasons you describe, I usually go to ext4 without a
journal to get more space. sdhc flash memory is extremely expensive
so there is a strong motive to maximize the available space.

Aside: I have almost ceased to use USB sticks (apart from booting
live images) because a cheap SSD is far faster and cheaper: I
use usb-sata cables, and they only cost a £ or two. I do use
f2fs also on my heritage USB sticks.

ael

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-13 Thread ael via Dng
On Mon, Jun 13, 2022 at 10:09:31AM +0100, ael via Dng wrote:
> On Sun, Jun 12, 2022 at 06:33:37PM -0700, Fred wrote:
> 
> So confirmed as a fake. Maybe worth checeking with fwrite and fread for
> a more thorough check.

s/fwrite/f3write and s/fread/f3read: typo corrections, of course.

ael

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-13 Thread ael via Dng
On Sun, Jun 12, 2022 at 06:33:37PM -0700, Fred wrote:
> 
> The f3probe utility says:
> 
> Good news:  The device /dev/sdb is the real thing
> 
> And then it reports the same size as fdisk, 27.48GB usable even though the
> card is plainly marked 64GB.

So confirmed as a fake. Maybe worth checeking with fwrite and fread for
a more thorough check.

ael

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-13 Thread ael via Dng
On Sun, Jun 12, 2022 at 02:14:15PM -0700, Fred wrote:
> > > 
> > Hi,
> > I recall a lot of discussion about this on either this list or the
> > Debian list.  If the card was an offbrand I would assume it was fraud
> > and would not have even asked here.  However, the card is a SanDisk. The
> > packaging becomes destroyed in removing the card so I can't take it back
> > to Walfart for exchange.

Plenty of fake cards pretend to be SanDisk. No idea whether Walfart can be
trusted to have checked their cards.

> > You said above that you use a better filesystem for the sdhc cards. Have
> > you done that for a card over 32GB?  And how?

Most of my sdhc cards are used in "other" devices, and so have to be
kept in vfat. But I have other cards, usually in ext4 (without a
journal to extend flash life). I can't remember now whether any are
64GB, but I have never had any problem reformatting, or finding fdisk
reporting different sizes. But then I always check cards with f3 on
purchase, just in case. Using fwrite and fread also gives me an idea of
the speed of the card. The downside is that that test writes all
(unreserved blocks) so all subsequent writes need an erase cycle,
so the effective speed drops. But that is going to happen anyway
with normal use.

ael

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-13 Thread Andreas Messer
Hi Fred,

Am Sun, Jun 12, 2022 at 12:35:06PM -0700 schrieb Fred:
> 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.

You shouldn't do that. Although its possible to "partition" SD-Cards,
this is not recommended. This is since SD-Cards have some kind of
knowledge about "how FATFS works" to optimize the write cycles. This 
won't work if the card is partitioned. 

However, the best way to use SD-Cards in Linux only environments is
to format them with f2fs file system. f2fs was developed by Samsung
with internal behavior of embedded MMC memory devices in mind. Which 
is pretty the same like an SD-Card. With f2fs you also have 
uid/gid as usual and it will help to improve the endurance and 
performance of an SD-Card.

cheers,
Andreas

-- 
gnuPG keyid: 8C2BAF51
fingerprint: 28EE 8438 E688 D992 3661 C753 90B3 BAAA 8C2B AF51


signature.asc
Description: PGP signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-12 Thread Fred

On 6/12/22 14:09, Fred wrote:

On 6/12/22 13:48, ael wrote:

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: 0x

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


Hi,
I recall a lot of discussion about this on either this list or the 
Debian list.  If the card was an offbrand I would assume it was fraud 
and would not have even asked here.  However, the card is a SanDisk. The 
packaging becomes destroyed in removing the card so I can't take it back 
to Walfart for exchange.


I would like to try the f3 program.  How do I get the tarball from github?

You said above that you use a better filesystem for the sdhc cards. Have 
you done that for a card over 32GB?  And how?


Best regards,
Fred

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Hi,

The f3probe utility says:

Good news:  The device /dev/sdb is the real thing

And then it reports the same size as fdisk, 27.48GB usable even though 
the card is plainly marked 64GB.


So, my question has been answered.  Thanks for the help!

Best regards,
Fred

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-12 Thread Fred

On 6/12/22 14:33, tempforever wrote:

Fred wrote:

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.

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: 0x

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.



A couple things come to mind.  Yes, it could be an acutal 32 GB card
that was designed to appear as 64 GB (as was already mentioned).
Another possibility: is it an issue with the "Card-Reader" device?
Check the card in another computer or with a different card reader, does
it still appear 32 GB?
One other possibility (but less likely IMO), if the card is put back
into Windows machine, does it appear as 64 GB?

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Hi,
I only have one usb-sd card reader.  They don't cost much so I may order 
another.


I don't use Bill Gates' cancerous, virus infested scourge of the Earth 
excuse for an OS and don't have access to it.


Best regards,
Fred

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-12 Thread tempforever
Fred wrote:
> 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.
>
> 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: 0x
>
> 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.
>

A couple things come to mind.  Yes, it could be an acutal 32 GB card
that was designed to appear as 64 GB (as was already mentioned).
Another possibility: is it an issue with the "Card-Reader" device? 
Check the card in another computer or with a different card reader, does
it still appear 32 GB?
One other possibility (but less likely IMO), if the card is put back
into Windows machine, does it appear as 64 GB?

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-12 Thread Fred

On 6/12/22 14:09, Fred wrote:

On 6/12/22 13:48, ael wrote:

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: 0x

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


Hi,
I recall a lot of discussion about this on either this list or the 
Debian list.  If the card was an offbrand I would assume it was fraud 
and would not have even asked here.  However, the card is a SanDisk. The 
packaging becomes destroyed in removing the card so I can't take it back 
to Walfart for exchange.


I would like to try the f3 program.  How do I get the tarball from github?


I found the tarball!

You said above that you use a better filesystem for the sdhc cards. Have 
you done that for a card over 32GB?  And how?


Best regards,
Fred

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-12 Thread Fred

On 6/12/22 13:48, ael wrote:

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: 0x

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


Hi,
I recall a lot of discussion about this on either this list or the 
Debian list.  If the card was an offbrand I would assume it was fraud 
and would not have even asked here.  However, the card is a SanDisk. 
The packaging becomes destroyed in removing the card so I can't take it 
back to Walfart for exchange.


I would like to try the f3 program.  How do I get the tarball from github?

You said above that you use a better filesystem for the sdhc cards. 
Have you done that for a card over 32GB?  And how?


Best regards,
Fred

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-12 Thread ael via Dng
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: 0x
> 
> 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

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-12 Thread Fred

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?


What's the output of "fdisk -l /dev/sdX"?

Have you tried wiping the partition table and creating a new one?

dd if=/dev/zero of=/dev/sdX bs=10M count=10

Then use fdisk as usual - it will prompt you to create a new table.


Antony.


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.


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: 0x

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.


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


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?

Best regards,
Fred




___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] fdisk SD card partitioning question

2022-06-12 Thread Antony Stone
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?

What's the output of "fdisk -l /dev/sdX"?

Have you tried wiping the partition table and creating a new one?

dd if=/dev/zero of=/dev/sdX bs=10M count=10

Then use fdisk as usual - it will prompt you to create a new table.


Antony.

-- 
In Heaven, the beer is Belgian, the chefs are Italian, the supermarkets are 
British, the mechanics are German, the lovers are French, the entertainment is 
American, and everything is organised by the Swiss.

In Hell, the beer is American, the chefs are British, the supermarkets are 
German, the mechanics are French, the lovers are Swiss, the entertainment is 
Belgian, and everything is organised by the Italians.

   Please reply to the list;
 please *don't* CC me.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] fdisk SD card partitioning question

2022-06-12 Thread Fred

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.


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?


Best regards,
Fred
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng