On Mon, Jun 13, 2016 at 2:50 PM, Vladimir Gusiatnikov
<[email protected]> wrote:
> I am getting the exact same behavior on an Ubuntu machine for an SD card
> that has been expanded with grow_partition.sh. Ubuntu does not see more than
> 780 MB on the card. This is a brand new 8 GB card. I strongly suspect that
> the script is rendering SD cards unusable.

I strongly disagree, the script works fine:  Looks like a bug on your end..

#history:
https://github.com/RobertCNelson/boot-scripts/commits/master/tools/grow_partition.sh

debian@beaglebone:~$ uname -r
4.4.12-ti-r30

debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2016-06-13

debian@beaglebone:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16   0    2M  1 disk
mmcblk1boot1 179:24   0    2M  1 disk
mmcblk0      179:0    0  7.4G  0 disk
└─mmcblk0p1  179:1    0  3.3G  0 part /
mmcblk1      179:8    0  3.6G  0 disk
└─mmcblk1p1  179:9    0  3.6G  0 part

debian@beaglebone:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             10M     0   10M   0% /dev
tmpfs            99M  8.4M   91M   9% /run
/dev/mmcblk0p1  3.3G  2.6G  510M  84% /
tmpfs           247M     0  247M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           247M     0  247M   0% /sys/fs/cgroup
tmpfs            50M     0   50M   0% /run/user/1000

debian@beaglebone:/opt/scripts/tools$ sudo ./grow_partition.sh
Media: [/dev/mmcblk0]

Disk /dev/mmcblk0: 242560 cylinders, 4 heads, 16 sectors/track
Old situation:
sfdisk: Warning: The partition table looks like it was made
  for C/H/S=*/112/62 (instead of 242560/4/16).
For this listing I'll assume that geometry.
Units: 1MiB = 1024*1024 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/mmcblk0p1   *     1   3399   3399    3480576   83  Linux
start: (c,h,s) expected (0,33,3) found (0,32,33)
end: (c,h,s) expected (1002,85,42) found (433,111,62)
/dev/mmcblk0p2         0      -      0          0    0  Empty
/dev/mmcblk0p3         0      -      0          0    0  Empty
/dev/mmcblk0p4         0      -      0          0    0  Empty
New situation:
Units: 1MiB = 1024*1024 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/mmcblk0p1   *     1   7579   7579    7760896   83  Linux
/dev/mmcblk0p2         0      -      0          0    0  Empty
/dev/mmcblk0p3         0      -      0          0    0  Empty
/dev/mmcblk0p4         0      -      0          0    0  Empty
Successfully wrote the new partition table

Re-reading the partition table ...
sfdisk: BLKRRPART: Device or resource busy
sfdisk: The command to re-read the partition table failed.
Run partprobe(8), kpartx(8) or reboot your system now,
before using mkfs
sfdisk: If you created or changed a DOS partition, /dev/foo7, say,
then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)

#reboot:

debian@beaglebone:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16   0    2M  1 disk
mmcblk1boot1 179:24   0    2M  1 disk
mmcblk0      179:0    0  7.4G  0 disk
└─mmcblk0p1  179:1    0  7.4G  0 part /
mmcblk1      179:8    0  3.6G  0 disk
└─mmcblk1p1  179:9    0  3.6G  0 part

debian@beaglebone:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             10M     0   10M   0% /dev
tmpfs            99M  4.4M   95M   5% /run
/dev/mmcblk0p1  7.3G  2.6G  4.4G  37% /
tmpfs           247M     0  247M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           247M     0  247M   0% /sys/fs/cgroup
tmpfs            50M     0   50M   0% /run/user/1000

#Debian x86/amd64:

voodoo@hades:/opt/github/npm-package-node-red$ uname -r
4.7.0-rc2

voodoo@hades:/opt/github/npm-package-node-red$ dmesg | tail
[23848.747325] sd 8:0:0:1: [sdk] Attached SCSI removable disk
[23848.748076] sd 8:0:0:2: [sdl] Write Protect is off
[23848.748079] sd 8:0:0:2: [sdl] Mode Sense: 03 00 00 00
[23848.748836] sd 8:0:0:2: [sdl] No Caching mode page found
[23848.748841] sd 8:0:0:2: [sdl] Assuming drive cache: write through
[23848.755012] sd 8:0:0:3: [sdm] Attached SCSI removable disk
[23848.774910]  sdl: sdl1
[23848.781467] sd 8:0:0:2: [sdl] Attached SCSI removable disk
[23896.961030] EXT4-fs (sdl1): recovery complete
[23896.962771] EXT4-fs (sdl1): mounted filesystem with ordered data
mode. Opts: (null)

voodoo@hades:/opt/github/npm-package-node-red$ lsblk | grep sdl
sdl      8:176  1   7.4G  0 disk
└─sdl1   8:177  1   7.4G  0 part /media/voodoo/rootfs2

voodoo@hades:/opt/github/npm-package-node-red$ df -h | grep sdl
/dev/sdl1       7.3G  2.6G  4.4G  37% /media/voodoo/rootfs2


Works as designed:

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYg-vKerPcfQSwh%2BG0Tzi997pc8OwV7DNB2%2BYVPcU9COoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to