Thank you for your donation


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Expand SD Card
10th May, 2017, 12:25 AM
Post: #1
How to Expand SD Card
I know this has been asked before as I have found most of the posts about it.

My problem is that the instructions are quite abridged or maybe out of date.

My 16GB card never expanded by itself on first boot, not sure if I need to SSH in (I get Network error: Connection timed out.) with Putty or open a terminal (not sure how to do that) use Win32DiskImager or something else?

I do need my hand held and guided what route I need to take.

Thank you.
Find all posts by this user
Quote this message in a reply
10th May, 2017, 12:41 AM
Post: #2
RE: How to Expand SD Card
(10th May, 2017 12:25 AM)TheDutypaid Wrote:  My 16GB card never expanded by itself on first boot, not sure if I need to SSH in (I get Network error: Connection timed out.) with Putty or open a terminal (not sure how to do that) use Win32DiskImager or something else?

I do need my hand held and guided what route I need to take.

Thank you.

Initramfs needs to be enabled for automatic resize and swap creation. So, first please check if initramfs will be used:

1) a file initramfs.gz must be in /boot folder
2) initramfs line must not be hashed in /boot/config.txt
Terminal

cat /boot/config.txt
initramfs initramfs.gz 0x1500000
...
Find all posts by this user
Quote this message in a reply
10th May, 2017, 12:52 AM
Post: #3
RE: How to Expand SD Card
This post may help to resize root partition and create swap
Find all posts by this user
Quote this message in a reply
10th May, 2017, 01:27 AM
Post: #4
RE: How to Expand SD Card
When I SSH in I only get this?
Find all posts by this user
Quote this message in a reply
10th May, 2017, 02:00 AM
Post: #5
RE: How to Expand SD Card
You have to exit xbian-config to get command prompt
Find all posts by this user
Quote this message in a reply
10th May, 2017, 02:23 AM
Post: #6
RE: How to Expand SD Card
OK, this is my current config.txt

Do I need to add the 'initramfs initramfs.gz 0x1500000' to this?

Code:
# ****************************************************************
# *                                                              *
# * /boot/config.txt                                             *
# *                                                              *
# ****************************************************************

# see /etc/default/xbian-initramfs
initramfs initramfs.gz  0x1500000

gpu_mem_1024=256
gpu_mem_512=144
gpu_mem_256=100

initial_turbo=3
hdmi_ignore_cec_init=1
disable_overscan=1
disable_splash=1

# Double power for USB ports
#max_usb_current=1


# ****************************************************************
# * Overlays. For more information please read                   *
# *           /boot/README.overlays                              *
# ****************************************************************

# This parameter enables onboard sound via module snd_bcm2835.
# Module will be loaded automatically, an entry in
# /etc/modules[.xbian] has no effect and is not longer needed/
# necessary with kernel 4.4 and above.
# Please note, this setting should be commented out if a Hifiberry
device is used.
dtparam=audio=on


# ****************************************************************
# * GPIO LIRC                                                    *
# *   Please note:                                               *
# *   GPIO input pin has to be remapped for working together     *
# *   with Hifiberry sound cards                                 *
# ****************************************************************

dtoverlay=lirc-rpi,debug
#dtoverlay=lirc-rpi,gpio_out_pin=17,gpio_in_pin=22,debug


# ****************************************************************
# * Hifiberry and compatible sound cards (I2S interface)         *
# * May conflict with LIRC. See note above                       *
# ****************************************************************

#dtoverlay=hifiberry-amp
#dtoverlay=hifiberry-dac
#dtoverlay=hifiberry-dacplus
#dtoverlay=hifiberry-digi


# ****************************************************************
# * Raspberry Pi 3 onboard Bluetooth                             *
# ****************************************************************

# This parameter enables usage of miniuart (ttyS0) for BT.
# Please note that BT may not work properly if CPUFREQ_GOVERNOR
# is set to something else than performance (see also
# /etc/default/xbian-module-init-tools).
#dtoverlay=pi3-miniuart-bt

# Disables onboard Bluetooth
#dtoverlay=pi3-disable-bt
arm_freq=840
core_freq=320
sdram_freq=400


enable_uart=1

# uncomment for composite PAL

sdtv_mode=2

dtoverlay=pwm-2chan,pin=12,func=2,pin2=13,func2=4
Find all posts by this user
Quote this message in a reply
10th May, 2017, 02:32 AM (This post was last modified: 10th May, 2017 02:34 AM by Nachteule.)
Post: #7
RE: How to Expand SD Card
No, your file is ok

If you have file /boot/initramfs.gz and resize does not work after reboot, please show me output of

1)
Terminal

sudo fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 14,7 GiB, 15720251392 bytes, 30703616 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: dos
Disk identifier: 0x828520e3

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 141311 139264 68M b W95 FAT32
/dev/mmcblk0p2 141312 15845375 15704064 7,5G 83 Linux
/dev/mmcblk0p3 15845376 16347135 501760 245M 82 Linux swap / Solaris

2)
Terminal

root@kmxbilr ~ # xbian-arch
RPI
root@kmxbilr ~ #

3)
Terminal

root@kmxbilr ~ # xbian-arch revision
rpi
root@kmxbilr ~ #
Find all posts by this user
Quote this message in a reply
10th May, 2017, 02:48 AM
Post: #8
RE: How to Expand SD Card
Step 1 worked but step 2 returned.

xbian@xbian ~ $ root@kmxbilr ~ # xbian-arch
-bash: root@kmxbilr: command not found
Find all posts by this user
Quote this message in a reply
10th May, 2017, 03:00 AM
Post: #9
RE: How to Expand SD Card
Oh noooooooo, aaarrrrg,

just run xbian-arch and xbian-arch revision, don't include my prompt to the command
Find all posts by this user
Quote this message in a reply
10th May, 2017, 03:59 AM
Post: #10
RE: How to Expand SD Card
OK, here is what I got. I'm not sure it is a lot. the xbian arch and revision only returned RPI

Code:
xbian@xbian ~ $ sudo fdisk -l /dev/mmcblk0
[sudo] password for xbian:

Disk /dev/mmcblk0: 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: dos
Disk identifier: 0x85111b4d

Device         Boot    Start      End  Sectors   Size Id Type
/dev/mmcblk0p1 *        2048   141311   139264    68M  b W95 FAT32
/dev/mmcblk0p2        141312 30614527 30473216  14.5G 83 Linux
/dev/mmcblk0p3      30615552 31116287   500736 244.5M 82 Linux swap / Solaris

xbian@xbian ~ $ xbian-arch
RPI
xbian@xbian ~ $ xbian-arch revision
rpi
xbian@xbian ~ $
Find all posts by this user
Quote this message in a reply
10th May, 2017, 04:18 AM (This post was last modified: 10th May, 2017 04:26 AM by Nachteule.)
Post: #11
RE: How to Expand SD Card
Hmmm, everything is ok. Your sd-card has already been resized (size of root partition /dev/mmcblk0p2 is 14.5G)

So I can't see any problem HuhHuhHuh
Find all posts by this user
Quote this message in a reply
10th May, 2017, 05:05 AM
Post: #12
RE: How to Expand SD Card
(10th May, 2017 02:32 AM)Nachteule Wrote:  So I can't see any problem HuhHuhHuh

It is just when I place the SD card into my windows computer it shows the card as 44.1 MB free of 67.8 MB

Not the 14.4 GB it should be, was hoping to store some video and music files on said card. Not sure if that is possible?

Thank you again for your help, sorry I can be hard work. Angel
Find all posts by this user
Quote this message in a reply
10th May, 2017, 05:16 AM (This post was last modified: 10th May, 2017 06:31 AM by Nachteule.)
Post: #13
RE: How to Expand SD Card
Ah, you can't read/write root partition from windows, because XBian uses BTRFS file system and W$ can not deal with that

All you see in W$ is the boot partition, because this is FAT formatted
Find all posts by this user
Quote this message in a reply
10th May, 2017, 06:20 AM
Post: #14
RE: How to Expand SD Card
Hmmm... I had problem yseterday with a pi2 which despite having a 16Gb card gave an out of memory crash during an upgrade.

I removed the card and put it in the PC and saw the boot partition was 68MB, Xbian partition was 2GB and there was a unused partition of 12GB that was empty.

I relfashed the card and tried upgrade again. The result was not so good (lots of messages about missing lsb and start/stop from memory) so I reverted to older image again.

Today I see this thread and so I tried this.....
Code:
sudo fdisk -l /dev/mmcblk0
[sudo] password for xbian:

Disk /dev/mmcblk0: 14.9 GiB, 15980298240 bytes, 31211520 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: dos
Disk identifier: 0xf29dd130

Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk0p1 *      2048  141311  139264   68M  b W95 FAT32
/dev/mmcblk0p2      141312 6006783 5865472  2.8G 83 Linux

Does this look OK?

(Sorry to piggy back this thread, but it seemed the nature of the problem was similar.)...

Smile
Find all posts by this user
Quote this message in a reply
10th May, 2017, 06:23 AM (This post was last modified: 10th May, 2017 06:33 AM by Nachteule.)
Post: #15
RE: How to Expand SD Card
(10th May, 2017 06:20 AM)Skywatch Wrote:  Does this look OK?

(Sorry to piggy back this thread, but it seemed the nature of the problem was similar.)...

Smile

No!

Root partition not expanded and missing swap

initramfs enabled? Again, root partition will resized only if initramfs is enabled. (the script is there and nowhere else)
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: