[SOLVED] Problem with Partition

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

[SOLVED] Problem with Partition

Postby ferdinandum » Mon Dec 10, 2012 7:11 pm

Good afternoon,
I'm partitioning a disk of 500GB but not if I'm doing well.

Here are the steps I've done

$this->bbcode_second_pass_code('', '
# /sbin/fdisk /dev/sda1

# Command: p (p = listado de particiones)
# Command: n (n = nueva partición)
# Command: p (p = partición primaria)
# Partition number: 1 (numero de la partición)
# First cylinder: poner el primero que deje
# Last cylinder: +250M (250 Mb)


# Command: n
# Command: p
# Partition number: 2
# First cylinder: default
# Last cylinder: default
# Command: w

# /sbin/mkfs.ext3 /dev/sda1

')

This is the result:
$this->bbcode_second_pass_code('', '
root@alarmpi ~ $ /sbin/fdisk -l

Disk /dev/mmcblk0: 3904 MB, 3904897024 bytes, 7626752 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
Disk identifier: 0x000c21e5

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 194559 96256 c W95 FAT32 (LBA)
/dev/mmcblk0p2 194560 3862527 1833984 83 Linux

Disk /dev/sda: 500.1 GB, 500074283008 bytes, 976707584 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
Disk identifier: 0x0004a183

Device Boot Start End Blocks Id System
/dev/sda1 2048 976707583 488352768 7 HPFS/NTFS/exFAT
')

The first partition I want to be the linux swap and the second for storage

but when I do the following tells me that there is no exist

i dont no what I'm doing wrong
$this->bbcode_second_pass_code('', '
# Command: t
# Command 1 (1=first partition)
# Hex code: 82 (82 = Linux Swap)
')
Last edited by ferdinandum on Wed Dec 12, 2012 6:21 pm, edited 2 times in total.
ferdinandum
 
Posts: 10
Joined: Mon Dec 10, 2012 7:00 pm

Re: Problem with Partition

Postby WarheadsSE » Mon Dec 10, 2012 7:14 pm

It rather obviously either: hasn't re-read the partition table, or didn't work at all. Try unplugging & re-plugging the drive.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Problem with Partition

Postby pepedog » Mon Dec 10, 2012 7:26 pm

Do not do this
/sbin/fdisk  /dev/sda1
Do this
/sbin/fdisk  /dev/sda
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Problem with Partition

Postby WarheadsSE » Mon Dec 10, 2012 7:38 pm

Hah, good catch, I missed that pepedog.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

[SOLVE] Problem with Partition

Postby ferdinandum » Mon Dec 10, 2012 7:41 pm

Thx

It was

$this->bbcode_second_pass_code('', '/sbin/fdisk /dev/sda')
ferdinandum
 
Posts: 10
Joined: Mon Dec 10, 2012 7:00 pm

Re: Problem with Partition

Postby pepedog » Mon Dec 10, 2012 7:56 pm

Only noticed because I persistently make this mistake
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Problem with Partition

Postby ferdinandum » Mon Dec 10, 2012 8:09 pm

This is the result:
$this->bbcode_second_pass_code('', '
Device Boot Start End Blocks Id System
/dev/sda1 2048 514047 256000 82 Linux swap / Solaris
/dev/sda2 514048 976707583 488096768 83 Linux
')

And in the /etc/fstab i did:
$this->bbcode_second_pass_code('', '
# <file system> <dir> <type> <options> <dump> <pass>
devpts /dev/pts devpts defaults 0 0
shm /dev/shm tmpfs nodev,nosuid 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 0

/dev/sda2 /media/almacen ext3 defaults 1 2
/dev/sda1 none swap 0 0
')

It's correct?
ferdinandum
 
Posts: 10
Joined: Mon Dec 10, 2012 7:00 pm

Re: Problem with Partition

Postby Magikarp » Mon Dec 10, 2012 9:02 pm

It looks good, but dump for sda2 should be 0. And why didn't you format it ext4?
You should also remove devpts and shm lines since they are not needed anymore.

EDIT: It would be good idea to use UUIDs for idenifying partitions. If you boot with for example usb stick pluged, external hdd might become sdb and not get mounted.
https://wiki.archlinux.org/index.php/Fstab#UUID
Magikarp
 
Posts: 22
Joined: Thu Oct 25, 2012 1:18 pm

Re: Problem with Partition

Postby ferdinandum » Mon Dec 10, 2012 9:48 pm

Thx Magilkap, its good but i quite difficult to do this.

I did
$this->bbcode_second_pass_code('', '
root@alarmpi ~ $ swapon -s
root@alarmpi ~ $ swapoff /dev/sda2
swapoff: /dev/sda2: swapoff failed: Invalid argument
')
ferdinandum
 
Posts: 10
Joined: Mon Dec 10, 2012 7:00 pm

Re: Problem with Partition

Postby pepedog » Mon Dec 10, 2012 10:03 pm

Did you
mkswap /dev/sda1
swapon /dev/sda1
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 51 guests