Airstream
Posts: 12
Joined: Fri May 04, 2012 7:05 am

Re: How to resize Debian for 8GB SD Card - No reader, just USB

Fri May 04, 2012 8:25 am

Seems this should be easier, but I created the 2Gb Debian Rpi image using Windows tools Win32DiskImager to an 8GB SD card. I now want to resize the partition to make use of all 8GB. I have a separate machine running UBuntu which has an internal OEM card reader, which connects into a USB port. When I insert the SD card into the card reader it is recognised as /media/95F5-0D7A, but not as /dev/sdd as per the 'Easy SD card Setup' section. Two file systems are showing on the SD card, about 80mb and 2gb.

Do I need to start again and just re-write the SD image solely under Linux, or is there al alternative process to adjust the partition similar to using gparted? I also put the SD card into a USB adapter and same story.

User avatar
TheTap
Posts: 25
Joined: Fri Dec 23, 2011 11:26 am
Location: Edinburgh

Re: How to resize Debian for 8GB SD Card - No reader, just USB

Fri May 04, 2012 9:27 am

Airstream said:


Seems this should be easier, but I created the 2Gb Debian Rpi image using Windows tools Win32DiskImager to an 8GB SD card. I now want to resize the partition to make use of all 8GB. I have a separate machine running UBuntu which has an internal OEM card reader, which connects into a USB port. When I insert the SD card into the card reader it is recognised as /media/95F5-0D7A, but not as /dev/sdd as per the 'Easy SD card Setup' section. Two file systems are showing on the SD card, about 80mb and 2gb.

Do I need to start again and just re-write the SD image solely under Linux, or is there al alternative process to adjust the partition similar to using gparted? I also put the SD card into a USB adapter and same story.


Try this on your Ubuntu machine:

Open a terminal and type - mount | grep 95F5-0D7A

it should come up with a line something like - /dev/sdd1 on media/95F5-0D7A

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: How to resize Debian for 8GB SD Card - No reader, just USB

Fri May 04, 2012 9:45 am

Airstream said:


When I insert the SD card into the card reader it is recognised as /media/95F5-0D7A, but not as /dev/sdd as per the 'Easy SD card Setup' section.


Your problem is caused by Ubuntu trying to hide the complexity of the file system. It's just trying to help...

Open a command terminal (Ctrl-Alt-t) in Ubuntu and enter the command

df -h

This will give you a list of all the file systems and their sizes (the -h option shows the human-friendly sizes like MB and GB).

Airstream
Posts: 12
Joined: Fri May 04, 2012 7:05 am

Re: How to resize Debian for 8GB SD Card - No reader, just USB

Fri May 04, 2012 11:48 am

So here is what I have following these commands. The resize option does not look  like what is given in the guide although it is showing /dev/sdb1 as the FS.

linux@Ubu9:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             178G   18G  152G  11% /
none                 1001M  252K 1001M   1% /dev
none                 1007M  180K 1006M   1% /dev/shm
none                 1007M  352K 1006M   1% /var/run
none                 1007M     0 1007M   0% /var/lock
/dev/sdb2             1.6G  1.2G  298M  80% /media/18c27e44-ad29-4264-9506-c93bb7083f47
/dev/sdb1              75M   28M   47M  37% /media/95F5-0D7A
linux@Ubu9:~$ mount | grep 95F5-0D7A
/dev/sdb1 on /media/95F5-0D7A type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
linux@Ubu9:~$ sudo parted /dev/sdb1
GNU Parted 2.3
Using /dev/sdb1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit chs
(parted) print
Model: Unknown (unknown)
Disk /dev/sdb1: 9,143,5
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 9,255,63.  Each cylinder is 8225kB.
Partition Table: msdos

Number  Start  End  Type  File system  Flags

(parted)

.... and this is where it ends. Next step?

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: How to resize Debian for 8GB SD Card - No reader, just USB

Fri May 04, 2012 11:56 am

/dev/sdb2 1.6G 1.2G 298M 80% /media/18c27e44-ad29-4264-9506-c93bb7083f47
/dev/sdb1 75M 28M 47M 37% /media/95F5-0D7A

Note: /dev/sdb1 is the "FAT" (aka, /boot) partition - where the blob and stuff are.

/dev/sdb2 is the Linux partition (presumably, this is the one you want to "resize")
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Airstream
Posts: 12
Joined: Fri May 04, 2012 7:05 am

Re: How to resize Debian for 8GB SD Card - No reader, just USB

Fri May 04, 2012 12:05 pm

Okay - This is what I have as the 1.6GB partition

linux@Ubu9:~$ sudo parted /dev/sdb2
GNU Parted 2.3
Using /dev/sdb2
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit chs
(parted) print
Model: Unknown (unknown)
Disk /dev/sdb2: 202,177,38
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 202,255,63.  Each cylinder is 8225kB.
Partition Table: loop

Number  Start  End         File system  Flags
1      0,0,0  202,177,38  ext4

(parted)
... but I dont have 3 entries so work out the resize?

(Oh and the Rpi Model B arrived today!)

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: How to resize Debian for 8GB SD Card - No reader, just USB

Fri May 04, 2012 12:36 pm

It is not clear what your current problem is because I cannot understand "… but I dont have 3 entries so work out the resize?". But here is some useful info anyway...

To be able to repartition sdb2, you will probably need to unmount it from Ubuntu. You can right-click in the file manager and unmount or enter the command

sudo umount /dev/sdb2

If you want to see the full size of the disk, use the command

sudo fdisk /dev/sdb

Use 'q' to quit fdisk.

To change the size of /dev/sdb2 in parted use the command

(parted) resize 2 xxxxx yyyyy

where xxxx is the original start of sdb2 (you may not change that) and yyyy is the end of the disk.

User avatar
grumpyoldgit
Posts: 1452
Joined: Thu Jan 05, 2012 12:20 pm

Re: How to resize Debian for 8GB SD Card - No reader, just USB

Fri May 04, 2012 12:51 pm

I am even more confused. Why on earth doesn't the OP use gparted and then he could see what he was doing?

Airstream
Posts: 12
Joined: Fri May 04, 2012 7:05 am

Re: How to resize Debian for 8GB SD Card - No reader, just USB

Fri May 04, 2012 1:26 pm

Please view link http://elinux.org/RPi_Easy_SD_Card_Setup and see section ' Manually resizing the SD card partitions (Optional)'

The example showing 3 partitions in the table (which I do not have)$ sudo parted /dev/sdd
(parted) unit chs
(parted) print
Disk /dev/sdd: 121535,3,31
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 121536,4,32. Each cylinder is 65.5kB.
Partition Table: msdos

Number Start End Type File system Flags
1 16,0,0 1215,3,31 primary fat32 lba
2 1232,0,0 26671,3,31 primary ext4
3 26688,0,0 29743,3,31 primary linux-swap(v1)

Thanks for advice...When I use the Ubuntu Disk Utility I see a 79MB FAT, 1.7GB ext4 and a 200MB swapfile.
And 6GB free space.
Now I see what is required
linux@Ubu9:~$ sudo umount /dev/sdb1

linux@Ubu9:~$ sudo umount /dev/sdb2

linux@Ubu9:~$ sudo umount /dev/sdb3



linux@Ubu9:~$ df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda1 178G 18G 152G 11% /

none 1001M 252K 1001M 1% /dev

none 1007M 412K 1006M 1% /dev/shm

none 1007M 352K 1006M 1% /var/run

none 1007M 0 1007M 0% /var/lock

linux@Ubu9:~$ sudo parted /dev/sdb

GNU Parted 2.3

Using /dev/sdb

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) unit chs

(parted) print

Model: Generic USB SD Reader (scsi)

Disk /dev/sdb: 119359,3,31

Sector size (logical/physical): 512B/512B

BIOS cylinder,head,sector geometry: 119360,4,32. Each cylinder is 65.5kB.

Partition Table: msdos



Number Start End Type File system Flags

1 16,0,0 1215,3,31 primary fat32 lba

2 1232,0,0 26671,3,31 primary ext4

3 26688,0,0 29743,3,31 primary linux-swap(v1)



(parted) parted move 3 116303,0,0

End? [119358,3,31]?

(parted) rm 2

(parted) mkpart primary 1232,0,0 116302,3,31

(parted) quit

Information: You may need to update /etc/fstab.



linux@Ubu9:~$ sudo e2fsck -f /dev/sdb2

[sudo] password for linux:

e2fsck 1.41.12 (17-May-2010)

Pass 1: Checking inodes, blocks, and sizes

Pass 2: Checking directory structure

Pass 3: Checking directory connectivity

/lost+found not found. Create<y>? yes



Pass 4: Checking reference counts

Pass 5: Checking group summary information



/dev/sdb2: ***** FILE SYSTEM WAS MODIFIED *****

/dev/sdb2: 59389/101920 files (0.0% non-contiguous), 310435/407040 blocks

linux@Ubu9:~$ sudo resize2fs /dev/sdb2

resize2fs 1.41.12 (17-May-2010)

Resizing the filesystem on /dev/sdb2 to 1841136 (4k) blocks.

The filesystem on /dev/sdb2 is now 1841136 blocks long.



This now shows a 6.7GB #2 resized partition.


Return to “Beginners”