Forum

Full Version: How to Expand SD Card
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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.
(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
...
This post may help to resize root partition and create swap
When I SSH in I only get this?
You have to exit xbian-config to get command prompt
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
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 ~ #
Step 1 worked but step 2 returned.

xbian@xbian ~ $ root@kmxbilr ~ # xbian-arch
-bash: root@kmxbilr: command not found
Oh noooooooo, aaarrrrg,

just run xbian-arch and xbian-arch revision, don't include my prompt to the command
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 ~ $
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
(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
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
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
(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)
Pages: 1 2
Reference URL's