LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 10-14-2020, 07:32 AM   #1
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Rep: Reputation: 70
8Gb SD card seen as only 4Gb


Hi all,

I'd run out of free space with the SD card I'd been using in my Pi. That card was 4Gb, so I decided to replace it with an 8Gb one. I dd'd the old card's contents over onto the new one and inserted it, expecting to have everything up and running with an extra 4Gb of free space, but the OS reports the new card as still only being 4Gb in total size. I'm no techie, so the best reason I can come up with to explain this is that Linux doesn't check the actual size of SD cards, it just relies on reading the partition table and since I used dd I'm guessing I've copied over the old partition table which tells the OS the card is 4Gb when it's actually 8Gb. Would that be right? If so, can I correct the error by editing the PT on the new card?
Thanks.
 
Old 10-14-2020, 07:44 AM   #2
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by Completely Clueless View Post
Hi all,

I'd run out of free space with the SD card I'd been using in my Pi. That card was 4Gb, so I decided to replace it with an 8Gb one. I dd'd the old card's contents over onto the new one and inserted it, expecting to have everything up and running with an extra 4Gb of free space, but the OS reports the new card as still only being 4Gb in total size. I'm no techie, so the best reason I can come up with to explain this is that Linux doesn't check the actual size of SD cards, it just relies on reading the partition table and since I used dd I'm guessing I've copied over the old partition table which tells the OS the card is 4Gb when it's actually 8Gb. Would that be right? If so, can I correct the error by editing the PT on the new card?
Thanks.
If you have LVM, you can extend the disk, and resize the filesystem.
What is output of: lsblk or fdisk -l
 
Old 10-14-2020, 07:50 AM   #3
Pastychomper
Member
 
Registered: Sep 2011
Location: Scotland
Distribution: Slackware, Devuan, Android
Posts: 132

Rep: Reputation: 243Reputation: 243Reputation: 243
What exactly did you dd? The whole card, the partition, or the individual files? It sounds like you've ended up with a 4GB partition on an 8GB drive. The partition gets mounted and the empty space ignored. In that case, you can either keep it as it is and partition the empty space separately, or repartition the entire drive and copy across the files from the old card. Or better still, follow dc.901's advice and resize the partition.

Last edited by Pastychomper; 10-14-2020 at 07:53 AM.
 
Old 10-14-2020, 07:51 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
A Raspberry pi does not use LVM. If you are running raspbian there is a configuration script to expand the root filesystem to fill the card. Must be really old since the minimum size for 8GB has been around for awhile now...
 
1 members found this post helpful.
Old 10-14-2020, 10:21 AM   #5
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
[QUOTE=Pastychomper;6175264]What exactly did you dd? The whole card, the partition, or the individual files?

The whole card: sda---->sdb
 
Old 10-14-2020, 01:03 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
Are you running raspian?
 
Old 10-14-2020, 01:06 PM   #7
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by michaelk View Post
Are you running raspian?
Yes.
 
Old 10-14-2020, 01:45 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
raspi-config has a utility to expand the root partition. If that does not work will have to think of another plan.
 
Old 10-14-2020, 08:32 PM   #9
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by michaelk View Post
raspi-config has a utility to expand the root partition. If that does not work will have to think of another plan.
Thanks. How do I avail myself of that feature? As you will have gathered, I'm not that clued-up on such things.
 
Old 10-14-2020, 08:40 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
From a terminal window run the command
sudo raspi-config

It is an ncurses menu based utility, select advanced options, then expand filesystem.

I don't know if it will work but its worth a try...

https://www.raspberrypi.org/document...aspi-config.md
 
1 members found this post helpful.
Old 10-14-2020, 08:46 PM   #11
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by michaelk View Post
From a terminal window run the command
sudo raspi-config

It is an ncurses menu based utility, select advanced options, then expand filesystem.

I don't know if it will work but its worth a try...

https://www.raspberrypi.org/document...aspi-config.md
Many thanks, Michael. It's getting very late here now so I'll give it a try in the morning and report back in due course.....
 
Old 10-15-2020, 04:22 AM   #12
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,506

Rep: Reputation: Disabled
See man resize2fs to do it manually.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] PClinuxOS sees only 4GB of 8GB SDF Linux - Newbie 2 11-16-2013 07:19 PM
How do I clone a 4Gb SDHC Card to another 4Gb SDHC Card lothario Linux - Software 3 07-22-2008 09:40 PM
Only 4Gb usable RAM when 8Gb physical is present stokes Linux - Server 12 11-16-2007 06:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 02:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration