Micro SD card

General support for the Pi-Star System
KE7FNS
Posts: 447
Joined: Wed Apr 17, 2019 11:11 pm

Re: Micro SD card

Post by KE7FNS » Thu Aug 15, 2019 3:41 am

w7efs wrote:
Thu Aug 15, 2019 2:04 am
Formatting an SD card is completely wasted time and effort. The image that gets burned to the card contains the two filesystems /boot (filesystem type fat32) and / (fs type ext4) along with partition information. The / ext4 filesystem partition is expanded to occupy all remaining card space upon invocation of /usr/local/sbin/pistar-expand that gets invoked from /etc/rc.local when the image gets booted the first time.
No... it isn't.

By using a formatting application and selecting FULL erase or FULL (Overwrite) during the format It will check the ENTIRE SD card and notify you of any errors encountered.

The process you explained does not write to every sector of the disk like that format would, it only writes to the first 1.8 Gigabytes, leaving the rest of the sectors on the SD card completely untouched.

Code: Select all

Start    End           Sectors      Size      Id      Type
8192     137215        129024       63M       c       W95 FAT32 (LBA)
137216   3782655       3645440      1.8G      83      Linux
The process of expanding the partition table does NOT write to those sectors beyond 1.8 Gigabytes either. That only adjusts the partition table.
All views, comments, posts and opinions shared are entirely my own.

User avatar
w7efs
Posts: 311
Joined: Sun Apr 22, 2018 4:26 pm

Re: Micro SD card

Post by w7efs » Thu Aug 15, 2019 5:34 am

You'd do well to read "man resizefs" after examining "less $(which pistar-expand)".

KE7FNS
Posts: 447
Joined: Wed Apr 17, 2019 11:11 pm

Re: Micro SD card

Post by KE7FNS » Thu Aug 15, 2019 7:13 am

w7efs wrote:
Thu Aug 15, 2019 5:34 am
You'd do well to read "man resizefs" after examining "less $(which pistar-expand)".

Code: Select all

[email protected](ro):~$ man resizefs
No manual entry for resizefs
All views, comments, posts and opinions shared are entirely my own.

User avatar
w7efs
Posts: 311
Joined: Sun Apr 22, 2018 4:26 pm

Re: Micro SD card

Post by w7efs » Thu Aug 15, 2019 2:13 pm

"man resize2fs" would've been apparent after "less $(which pistar-expand)" ... thanks for the correction.

KE7FNS
Posts: 447
Joined: Wed Apr 17, 2019 11:11 pm

Re: Micro SD card

Post by KE7FNS » Thu Aug 15, 2019 4:26 pm

w7efs wrote:
Thu Aug 15, 2019 2:13 pm
"man resize2fs" would've been apparent after "less $(which pistar-expand)" ... thanks for the correction.

Code: Select all

/*
 * Resizing a filesystem consists of the following phases:
 *
 *	1.  Adjust superblock and write out new parts of the inode
 * 		table
 * 	2.  Determine blocks which need to be relocated, and copy the
 * 		contents of blocks from their old locations to the new ones.
 * 	3.  Scan the inode table, doing the following:
 * 		a.  If blocks have been moved, update the block
 * 			pointers in the inodes and indirect blocks to
 * 			point at the new block locations.
 * 		b.  If parts of the inode table need to be evacuated,
 * 			copy inodes from their old locations to their
 * 			new ones.
 * 		c.  If (b) needs to be done, note which blocks contain
 * 			directory information, since we will need to
 * 			update the directory information.
 * 	4.  Update the directory blocks with the new inode locations.
 * 	5.  Move the inode tables, if necessary.
 */
Resize2fs and fdisk do NOT check the disk for bad sectors which is the entire point I was making earlier by running a separate formatting program while setting it on full erase or full overwrite.
All views, comments, posts and opinions shared are entirely my own.

User avatar
w7efs
Posts: 311
Joined: Sun Apr 22, 2018 4:26 pm

Re: Micro SD card

Post by w7efs » Thu Aug 15, 2019 6:18 pm

I have [re]burned a great many sd cards for many years using only e.g. "pv xxx.img | dd bs=4M of=/dev/sdx" and the ext4 filesystem works very well. Go ahead and format to ntfs or fat32 if you like, but it accomplishes nothing useful.

KE7FNS
Posts: 447
Joined: Wed Apr 17, 2019 11:11 pm

Re: Micro SD card

Post by KE7FNS » Thu Aug 15, 2019 9:10 pm

w7efs wrote:
Thu Aug 15, 2019 6:18 pm
I have [re]burned a great many sd cards for many years using only e.g. "pv xxx.img | dd bs=4M of=/dev/sdx" and the ext4 filesystem works very well. Go ahead and format to ntfs or fat32 if you like, but it accomplishes nothing useful.
It accomplishes a simple way of checking the ENTIRE disk for errors.

It has nothing to do with the filesystem, and everything to do with the hardware experiencing errors and being able to detect them.
All views, comments, posts and opinions shared are entirely my own.

User avatar
w7efs
Posts: 311
Joined: Sun Apr 22, 2018 4:26 pm

Re: Micro SD card

Post by w7efs » Fri Aug 16, 2019 3:15 am

So ask yourself why the resultant ext4 filesystem doesn't care about your M$-determined "errors".

KE7FNS
Posts: 447
Joined: Wed Apr 17, 2019 11:11 pm

Re: Micro SD card

Post by KE7FNS » Fri Aug 16, 2019 3:56 am

w7efs wrote:
Fri Aug 16, 2019 3:15 am
So ask yourself why the resultant ext4 filesystem doesn't care about your M$-determined "errors".
Thats easy, its because you aren't using the linux tools to check an ENTIRE disk for errors, so it isn't going to report any errors in any areas that it doesn't write too. I've said that multiple times and yet you still can't comprehend that basic fact.

If ext4 was so pristine then why is the tool badblocks included in the e2fsprogs package? Don't bother answering that it is a rhetorical question.
All views, comments, posts and opinions shared are entirely my own.

User avatar
w7efs
Posts: 311
Joined: Sun Apr 22, 2018 4:26 pm

Re: Micro SD card

Post by w7efs » Fri Aug 16, 2019 12:48 pm

It's one of the native tools to deal with such things. When have you ever invoked "badblocks" on a Pi-Star microSD card?

Post Reply