PS3 Linux Partition Clone/Restore

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

PS3 Linux Partition Clone/Restore

Post by keepkool »

Hi ppl

Yesterday I clone my Full PS3 Disk (60GB) with WinHex and Restore it in another 60GB disk, from my friend PS3, in hope that maybe it works, and he can joy the freevo/mplayer setup (Linux Partition), This way I dont do the same once again, after so many time

..I already read that the disk is encrypted, but I try even knows the final result in advance, in fact I whould like to have a backup of my disk, in case of faillure, and this way I can achieve half the result

I comprove that the cloned disk not works in my friend PS3,
but it works in mine same way as original :)
(now I have a backup that only works in mine, its not so bad eheh)

the question is:

Its possible to clone the partition inside linux
ex with dd or other tool to a external drive or network share (better),
and next install a new linux in my friend ps3 and restore the image partition inside his fresh linux setup ( I doubt but....)

its seems hard, because the /root system is mounted,
and it cant be replaced when use (I think),
but I dont hurt to ask LOL maybe someone knows anything that helps

the objective is "only" to restore my linux setup in my friends disk, I dont want waste time+brains with re-installing all another time

thanks fellows ;)
Last edited by keepkool on Thu May 29, 2008 6:49 am, edited 1 time in total.
PS3 - 60GB EUR - FW v1.55 + FC7
User avatar
jbit
Site Admin
Posts: 293
Joined: Sat May 28, 2005 3:11 am
Location: København, Danmark
Contact:

Post by jbit »

Why wouldn't it be?
Boot off an install CD (then no partitions on the HDD are mounted) or use a root filesystem on a USB device.... it's just linux... also the linux segment of the HDD is not encrytped, and when linux boots it tells you the size of this segment and what sector it starts at, so you could clone this segment....
Also remember that even if you clone the HDD you'll need to install an otheros.bld onto the PS3 since this is stored in flash and not on the HDD...
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

jbit wrote:Why wouldn't it be?
;)
jbit wrote:Boot off an install CD (then no partitions on the HDD are mounted)
You Just say everything....

When I have time I boot from a linux tools bootcd and clone the partition and leave my feed back here, maybe help someone

Thanks
PS3 - 60GB EUR - FW v1.55 + FC7
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

...folowing the post, trying to boot from a live cd to clone linux ps3 partition...

First
I have Fedora 7 PPC Installed with PetitiBoot otheros.bld

The problem Now, is when I boot from cd/dvd from the following distros in PetitBoot:
Fedora 7 (currently installed distro), Xunbutu, Yellow Dog, OpenSuse and Unbutu

what appening is that in all the distros,
the cd/dvd icon appears in PetitBoot and when I chose to boot (with any option like install, expert, oem, cli...) it starts to boot, goes to a black screen 1/4 sec, and returns to PetitBoot in all the distros except Fedora 7 (currently installed distro)

in the fedora it boots normal, and runs ok, but leaves me with 2 options, Install or Upgrade :(

but what I want is to boot in command line like a live cd,
and I cant do that with this specific fedora release (I think)
...I check in fedora page, live cd is not avaiable for ppc...

I also try petitboot in text console with alt+f1, and try to use dd and other commands from my installed distro in sd3, but always the same, miss libraries etc

Now leaves me with 2 questions
1) Why fedora boots and none of other distros dont boot?
2) How can I boot a live cd in petitboot diferent from my current installed distro?

my objective is: backup linux partition and restore it in another ps3 disk...

Thanks in Advance
PS3 - 60GB EUR - FW v1.55 + FC7
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

I Found that I can install any other otheros.bld from other distros,
and boot sucefully from the media, like live cds and back to petiti boot again

this way I change otheros.bld at will :)
and try some live cds

in my first boot with unbutu live cd,
my first problem
unbutu cant found ps3 linux partition in gnome partition,
its says UNKNOWN PARTITION :(

I´m think that the linux file system only will be sucefully mounted from ps3, if its same otheros.bld but I can be wrong
...but this is what is appening, diferent otheros.bld, no filesystem access

this leaves me with another problem

How can I acccess linux partition with a diferent distro live cd?

maybe someone helps ;)
PS3 - 60GB EUR - FW v1.55 + FC7
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

can't find ps3 linux partition in gnome partition
Huh?
Access to the PS3 disk depends only on having the proper driver built into your kernel, or loaded as a module. The kernel/initrd is in otheros.bld, but any otheros.bld that you would get from a distro is certainly able to access the disk.
Anyway, a much easier way is to just pop the disk into a computer and copy it off, if you're having trouble working with Linux.
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

First thanks for the repply :)
jimparis wrote:Access to the PS3 disk depends only on having the proper driver built into your kernel, or loaded as a module. The kernel/initrd is in otheros.bld, but any otheros.bld that you would get from a distro is certainly able to access the disk.
this seems true, but I was able to access the disk in unbutu but its says partition unknow, the problem is the same when boot with ghost or partition magic boot cds.
jimparis wrote:Anyway, a much easier way is to just pop the disk into a computer and copy it off, if you're having trouble working with Linux.
I already do that, clone the disk with winhex, and put it in another ps3, and it works but only in my ps3, in my friend ps3 it says unknown disk, the disk must be formatted etc.

and this is my main objective, try to clone the ps3 partition from a boot cd, this way the linux isnt mounted and I can try to clone the full partition

but the problems is:

1) I dont have a live cd for fedora ppc, and its the only that boots sucefully with my current petit boot otheros.bld, if I install others otheros.bld from other distros I cant access ps3 linux partition. Its boots the cd and run live cd ex unbutu, but no partition access :(

2) If I clone with winhex, the backup only work on my ps3, but I need to clone it to another one, and this is the main problem

maybe the only solution is use otheros-petitboot+network.bld that may gives me access to linux partition, and maybe with network and with a precompiled dd_rescue I can do the Job, I already try otheros-petitboot+network.bld in my friends ps3, and it seems to output some nasty errors when start. But I dont try it in mine yet

I hope you understand my problem,
this way you can try to help me to solve this ps3 linux partition backup problem

Thanks once again for your repply
PS3 - 60GB EUR - FW v1.55 + FC7
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

another try...another fail...
no problem

I try otheros-petitboot+network.bld like in the past, I confirm it has dd ready for work, but it cant access my ps3 linux filesystem like the normal petit boot currently installed

I cant access linux partition with
/var/tmp/mnt-sda3-?
like with normal petit boot, because I think other bld, no file system, It seems that the fs is encrypted with otheros.bld, If I change I lost access to ps3 linux fs :(

I only can access with
ls /tmp/tmp/mnt/ps3da1
but no hope too

Code: Select all

drwxr-xr-x    6 root     root         1024 Mar 25 23:22 .
drwxr-xr-x    8 root     root          160 Jun  2 20:53 ..
-rw-r--r--    1 root     root      1758678 May 24  2007 System.map-2.6.21-1.3194.fc7
-rw-r--r--    1 root     root        68066 May 24  2007 config-2.6.21-1.3194.fc7
drwxr-xr-x    2 root     root         1024 Mar 29 21:08 etc
drwxr-xr-x    2 root     root         1024 Mar 25 22:11 grub
-rw-------    1 root     root      4311164 Mar 25 22:19 initrd-2.6.21-1.3194.fc7.img
drwx------    2 root     root        12288 Mar 25 21:24 lost+found
-rwxr-xr-x    1 root     root      7567248 May 24  2007 vmlinuz-2.6.21-1.3194.fc7
drwxr-xr-x    3 root     root         1024 Mar 29 21:06 yaboot
I can access flash disk with
ls /tmp/tmp/mnt/sdd1
and works, networks works too, telnet etc

it seems that only with the same otheros.bld its possible to access linux fs
can someone confirm this?

last note....if I try to boot the detected installed system or boot to gameos in petit boot it gives me the same error, start to launch, and returns to petit boot menu again, same loop, it seems it doesnt detect mounted fs....like when I try to boot other distros

I will try with same otheros.bld its seems to be the best shot, and only (i think)

Thanks ppl
PS3 - 60GB EUR - FW v1.55 + FC7
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

keepkool wrote:First thanks for the repply :)
jimparis wrote:Access to the PS3 disk depends only on having the proper driver built into your kernel, or loaded as a module. The kernel/initrd is in otheros.bld, but any otheros.bld that you would get from a distro is certainly able to access the disk.
this seems true, but I was able to access the disk in unbutu but its says partition unknow, the problem is the same when boot with ghost or partition magic boot cds.
You are not being clear... since you now say "partition magic" I assume you're talking about pulling the disk out of the PS3, putting it in a PC, and trying to read it there? In that case, yes, the partition table is encrypted and not readable by the PS3. But you can find the start of the OtherOS partition (see dmesg on ps3 boot), and there you'll find whatever partition tables you set up under Linux on the PS3.
I already do that, clone the disk with winhex, and put it in another ps3, and it works but only in my ps3, in my friend ps3 it says unknown disk, the disk must be formatted etc.
That is normal, due to the per-ps3 encryption.
and this is my main objective, try to clone the ps3 partition from a boot cd, this way the linux isnt mounted and I can try to clone the full partition
Is your objective to clone the entire disk (not possible) or clone the OtherOS part (easy)?

The disk layout is straightfowrad, but you have to be very clear with what you're doing (booting with the disk on a PC versus booting with the disk on the PS3). From what you're saying I can hardly tell. Anyway, the PS3 disk contains
[encrypted GameOS data] [plaintext OtherOS data]
When you put the disk in a PC, that is what you see. Copying the encrypted data between PS3s is not useful, so don't even bother, unless you're just trying to make a backup.

When you boot the PS3 in OtherOS, the only visible part of the disk is
[plaintext OtherOS data]
ie. the hypervisor hides the encrypted portion (more or less, check the linux source for how the different regions are discovered and mapped)
warrennn
Posts: 12
Joined: Wed Oct 24, 2007 1:20 pm
Location: Seattle

Post by warrennn »

Jim,

This brings up a related question, if you don't mind me going off-topic for a minute. I have not been able read in ps3 linux the otheros partition(s) of a disk which was originally created on the ps3. The disk mounted, but no useable otheros partition was visible. Any ideas?

Thanks.

Warren Nagourney
warrennn
Posts: 12
Joined: Wed Oct 24, 2007 1:20 pm
Location: Seattle

Post by warrennn »

Sorry for leaving out the fact that the disk I was trying to read was in an external enclosure connected via USB (I had recently replaced the HD).

Thanks again,

Warren N
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

warrennn wrote:You are not being clear... since you now say "partition magic" I assume you're talking about pulling the disk out of the PS3, putting it in a PC, and trying to read it there? In that case, yes, the partition table is encrypted and not readable by the PS3.

sorry, but my english is...you know, you already read it
when I say partition magic, its just to tell that the partition is unknow inside linux/otheros and outside like partition magic
warrennn wrote:But you can find the start of the OtherOS partition (see dmesg on ps3 boot), and there you'll find whatever partition tables you set up under Linux on the PS3.

i will try to find what you mean latter, thanks for the tip :)
warrennn wrote:I have not been able read in ps3 linux the otheros partition(s) of a disk which was originally created on the ps3. The disk mounted, but no useable otheros partition was visible. Any ideas?
this is new for me, with external disk, even if is ps3 formated disk, (i mean same ps3)

but it seems related to my problem

I think its related to otheros.bld, like it must be run from same disk and same otheros.bld, like when it install otheros.bld it reads the disk serial number, and it uses it to mount succefully the otheros partition...just thinking

ex. I have a already linux setup with its otheros partition, and if I change my otheros.bld to any diferent one, ex if I have petit boot and change to petit boot network or any other, I cannot access my otheros partition anymore, only when I put the same otheros.bld, I can access it again, and run without problems my otheros
I think the otheros.bld is related to per-ps3 encryption, like jimparis says

continue to try to explain the original thread problem

its simple, always usign ps3, I want to clone [plaintext OtherOS data] and restore it again in other ps3...

idea: use a boot cd
problem: I cant, if I try it returns me to petiti boot again, and if I change the otheros.bld to boot cds, it works but lost access to [plaintext OtherOS data] again

idea: use petit boot network (with net, ftp, it has dd) or other boot
problem: I cant, if I change the otheros.bld I cant access [plaintext OtherOS data], like I reported above

so the question is simple

how can we clone the ps3 [plaintext OtherOS data]? and put it in other target ps3 disk, making it possible to clone and restore the [plaintext OtherOS data] to any same size disk, for any other ps3, with any tool like dd_rescue or dd, or any other means....

just think ps3.source[plaintext OtherOS data] to ps3.target[plaintext OtherOS data]

I was trying to do that, because It seems very usefull for many means
If someone make a media player or any other usefull and dificult pre installed system,
it seems wise to share the image with other less knowledge users, that the only think that they do, is use the restore method to put it in is own ps3

it seems usefull for me......
i try that to put the freevo+mplayer into my friend, but I already do that, but I waste time doing that track again, if I have a usefull way of doing the image, its just a few lines to restore it and I dont lost a few hours

I hope I explain well the problem
but with my english its not easy,

thanks pp
PS3 - 60GB EUR - FW v1.55 + FC7
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

jimparis wrote:see dmesg on ps3 boot, and there you'll find whatever partition tables you set up under Linux on the PS3
you mean this

Looking for disk devices...
Region 3: id 3 start 25165832 size 92044408

if so, how can I mount it readdony for backup, using other otheros.bld, or a boot cd. or better to use dd with that parameters, to backup and restore

tia
PS3 - 60GB EUR - FW v1.55 + FC7
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

warrennn wrote:This brings up a related question, if you don't mind me going off-topic for a minute. I have not been able read in ps3 linux the otheros partition(s) of a disk which was originally created on the ps3. The disk mounted, but no useable otheros partition was visible. Any ideas?
Sorry for leaving out the fact that the disk I was trying to read was in an external enclosure connected via USB (I had recently replaced the HD).
The encrypted stuff comes first, so Linux won't know where to find the OtherOS section. You'll have to locate it and mount it explicitly with an offset. The kernel messages when booting OtherOS (with that disk inside the PS3) should tell you where the image starts.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

keepkool wrote:I think its related to otheros.bld, like it must be run from same disk and same otheros.bld, like when it install otheros.bld it reads the disk serial number, and it uses it to mount succefully the otheros partition...just thinking
No, that's not true, if you're having problems with an otheros.bld it's because that otheros.bld is just broken or doesn't load the right modules for accessing the hard drive, it has nothing to do with the ps3 encryption.
just think ps3.source[plaintext OtherOS data] to ps3.target[plaintext OtherOS data]
Region 3: id 3 start 25165832 size 92044408
If they're the same size -- then the otheros data starts at sector 25165832 and is 92044408 sectors long, and you just need to copy that:
  • in ps3 gameos, format ps3.target the same way you had ps3.source formatted (50 GB OtherOS)
  • put both ps3.source and ps3.target into a PC
  • on the PC, run

    Code: Select all

    dd if=/dev/ps3source of=/dev/ps3target bs=512 skip=25165832 seek=25165832 count=92044408
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

Thanks for your support and help, When I have a spare time, I will try to do what you say its seems an excelent tip :)
I leave my feedback after.....

thanks once again
PS3 - 60GB EUR - FW v1.55 + FC7
steve0
Posts: 6
Joined: Sun May 04, 2008 1:42 am
Contact:

Post by steve0 »

A much easier way is to just pop the disk into a computer and copy it off...
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

steve0 wrote:A much easier way is to just pop the disk into a computer and copy it off...
Huh? That's exactly what we're talking about here. He wants to copy just the OtherOS portion so I was explaining how to do that.
leonhong
Posts: 10
Joined: Wed Jan 09, 2008 6:38 pm

Re: PS3 Linux Partition Clone/Restore

Post by leonhong »

Dear keepkool:

To clone a partition was not that difficult. I had done it many times, including cloning my whole partition to another PS3 and boot it successfully. Here is my way:

1. Prepare a Live CD of your system. My system is Gutsy, so I used Gutsy Live CD.

2. Prepare a USB disk, better be larger than your partiton.

3. Download partimage.deb for PS3, put it on the USB disk.

3. Start Live CD on the PS3, plug your USB disk, mount your partition and USB disk.

4. Remember to activate the swap partition for the Live CD, or it may lack memory.

5. Install partimage on Live system. It is so small that you can put it in the ram disk space.

6. Open a terminal and start the partimage, its text mode GUI will show up, and you can start the clone operations from the partition to a file or files on the USB disk.

As to restore, do the exact procedure as above, then assign the files on the USB disk back to the partition.

Best regards
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

dear leonhong thank for your post

1) Prepare a Live CD of your system. My system is Gutsy, so I used Gutsy Live CD.
Fedora PPC dont have any Live CD, damn luck

about your instructions I rember that I cannot boot any live cd,
except fedora ppc (the one I installed),
and this distro only permits to Install or Upgrade
I reported it in this thread

if I do that, run with other distro, I must change otheros.bld and after change otheros.bld I cant access OtherOs partition anymore like I said in this post

I tried many time with many distros and the result is always

in petit boot it starts bootcd and brings me back to petiti boot again,
and If I changed otheros.bld it dont gives me access to OtherOS partition

ex if change to petitboot+net for example,
I cant access it, I change to petiti boot (normal without net) again,
and gives me access

I try to explain the problem,
but seems that nobody understand the real problem trying to run other livecds.

In fact I have already installed media player in my friends PS3,
like I said in this post, but belive me, I lost many time to TRY clone and restore OtherOs partition, and belive me I really wanna know how?

I dont give up, special when I lost time without concluded my objective LOL


Thanks leonhong and jimparis for your nice and clear instructions, and for the rest of ppl too
PS3 - 60GB EUR - FW v1.55 + FC7
leonhong
Posts: 10
Joined: Wed Jan 09, 2008 6:38 pm

Post by leonhong »

Dear keepkool:

I met your problem many times before I decide to hang on Ubuntu. Yes, the otheros.bld is os-specific. Theoretically, it is a small kernel loaded inside the PS3 system area and will be booted by the Hypervisor, then it switches to its system booting area that resides on the linux partitions and boot the whole system. Before the otheros.bld can switch, it must mount all the partitions that pre-defined in itself to locate its configuration files, and this is the answer why if you changed the system it will fail to boot - it is system specific, you cannot change its default configurations to fit different systems.

According to my memories (NOT so CONCRETE!! SORRY!!), YDL and FEDORA uses 2 partitions, one for kernel images and one for the root directory, and the kernel partition will be mounted to /boot after the boot process succeeds. To the contrary, Ubuntu uses only one partition for EVERY things. Different otheros.bld files will mount different types of system partitions, so I said they are system-specific, and that will fail the boot if no compatible partitions existing.

You can still use my way to clone your partition. Ubuntu Live cd does not care what is on your disk. Just remember to clone every linux partitions that you see on your disk.

ps: otheros.bld of Ubuntu must be installed before you insert the Live cd to boot, and choose the booting items when the kboot: appears with tab key. Choose live cd or install makes no difference, because you just need its GUI to install partimage and run it. After you cloned your partitions, re-install your original otheros.bld in the XMB, then it will boot.
User avatar
keepkool
Posts: 59
Joined: Thu Oct 11, 2007 9:20 am
Location: Portugal

Post by keepkool »

bullseye! that´s what i´m talking about ;)
great information leonhong
leonhong wrote:You can still use my way to clone your partition. Ubuntu Live cd does not care what is on your disk. Just remember to clone every linux partitions that you see on your disk.
this seems a good tip
"Live cd does not care what is on your disk. Just remember to clone every linux partitions that you see on your disk"
this way I can try, change otheros.bld to Ubuntu Live cd like in the past and do the job, and return back when I need my fedora again, restoring otheros.bld :)

when I do the "job" I report here my final feedback ;)
maybe in a near future when I have a little spare time.....

in fact my friends ps3 is already running, but belive me, I will do that, only to be sure, and spare time in future, because installing media player setup requires a night, or a little more, depends on our luck and knowlegde ;)

thanks leonhong for your time and for your knowledge to ;)
PS3 - 60GB EUR - FW v1.55 + FC7
Post Reply