Bug 445786 - swapon can't recognize UUID nor label of PS3 disk
Summary: swapon can't recognize UUID nor label of PS3 disk
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: e2fsprogs
Version: 9
Hardware: ppc64
OS: Linux
low
high
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-09 05:39 UTC by Kazunori Asayama
Modified: 2008-06-03 04:52 UTC (History)
2 users (show)

Fixed In Version: e2fsprogs-1.40.8-3.fc9
Clone Of:
Environment:
Last Closed: 2008-06-03 04:52:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
first page of swap partition (4.00 KB, application/octet-stream)
2008-05-12 03:10 UTC, Kazunori Asayama
no flags Details
strace blkid -c /dev/null (24.23 KB, text/plain)
2008-05-12 03:19 UTC, Kazunori Asayama
no flags Details

Description Kazunori Asayama 2008-05-09 05:39:37 UTC
Description of problem:

The swapon command can't recognize UUID nor label of PLAYSTATION 3 disk
(/dev/ps3d*), so swap space on PS3 disk is unavailable.


Version-Release number of selected component (if applicable):

util-linux-ng-2.13.1-6.fc9.ppc


How reproducible:

Every time.


Steps to Reproduce:
1. make a swap partition on PS3 disk with UUID or label.
2. try to enable the swap by using swapon with -U or -L option.
  
Actual results:
[root@localhost ~]# mkswap -L ps3-swap -U 22ea645c-4784-44a0-a954-5f2dd1e34525
/dev/ps3da2
Setting up swapspace version 1, size = 1077506 kB
LABEL=ps3-swap, UUID=22ea645c-4784-44a0-a954-5f2dd1e34525

[root@localhost ~]# swapon -U 22ea645c-4784-44a0-a954-5f2dd1e34525
swapon: cannot find the device for 22ea645c-4784-44a0-a954-5f2dd1e34525

[root@localhost ~]# swapon -L ps3-swap
swapon: cannot find the device for ps3-swap


Expected results:

The swap is enabled.


Additional info:

If the device name is passed to the swapon command directly, the swap is enabled.

[root@localhost ~]# swapon /dev/ps3da2
[root@localhost ~]# free
             total       used       free     shared    buffers     cached
Mem:        202112     144884      57228          0       7648      73112
-/+ buffers/cache:      64124     137988
Swap:      1052248          0    1052248

Comment 1 Karel Zak 2008-05-11 20:02:17 UTC
Please, I'd like to see outputs from:
  # /sbin/blkid

and
  # /sbin/blkid /dev/ps3da2

and
  # cat /proc/partitions

I guess the partition is invisible for libblkid...

Comment 2 Eric Sandeen 2008-05-12 01:45:08 UTC
Agreed, please provide blkid output - attaching a dd of the first page-sized
chunk of /dev/ps3da2 would also be useful I think.

Thanks,

-Eric

Comment 3 Eric Sandeen 2008-05-12 02:29:05 UTC
Oh perhaps an strace of "blkid -c /dev/null" too to be sure it's even scanning
the device (it should be).

Comment 4 Kazunori Asayama 2008-05-12 03:08:37 UTC
[root@localhost ~]# /sbin/blkid
/dev/ps3da1: LABEL="/" UUID="a00e88ac-942e-4da6-84d1-a9e2de6ee0a7"
SEC_TYPE="ext2" TYPE="ext3" 

[root@localhost ~]# /sbin/blkid /dev/ps3da2
(no output)

[root@localhost ~]# cat /proc/partitions
major minor  #blocks  name

   1     0      16384 ram0
   1     1      16384 ram1
   1     2      16384 ram2
   1     3      16384 ram3
   1     4      16384 ram4
   1     5      16384 ram5
   1     6      16384 ram6
   1     7      16384 ram7
   1     8      16384 ram8
   1     9      16384 ram9
   1    10      16384 ram10
   1    11      16384 ram11
   1    12      16384 ram12
   1    13      16384 ram13
   1    14      16384 ram14
   1    15      16384 ram15
 253     0   46022204 ps3da
 253     1   44965903 ps3da1
 253     2    1052257 ps3da2



Comment 5 Kazunori Asayama 2008-05-12 03:10:38 UTC
Created attachment 305074 [details]
first page of swap partition

output of "dd if=/dev/ps3da2 of=output bs=4096 count=1"

Comment 6 Kazunori Asayama 2008-05-12 03:19:46 UTC
Created attachment 305075 [details]
strace blkid -c /dev/null

Comment 7 Eric Sandeen 2008-05-12 03:36:09 UTC
Thanks.  So, from the attachment in comment #6, blkid is opening the device:

open("/dev/ps3da2", O_RDONLY)           = 5

but from comment #4, blkid is not able to recognize the swap device.

I'll look at the provided data from the swapfile to see why.

Thanks,

-Eric




Comment 8 Kazunori Asayama 2008-05-12 03:51:30 UTC
I found that PS3 couldn't find swap partitions on '/dev/sd*' (USB storage), too.
It looks like that this problem is not specific to '/dev/ps3d*'.


Comment 9 Eric Sandeen 2008-05-12 04:01:56 UTC
Ok, this is unfortunately due to a recent change I put in to sanity-check
swapspace; it's in F9 too.  :(

http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=commitdiff;h=6360d129d003f25942f62fab2cdc5e1d97cc88a6

+       /* check for wrong version or zeroed pagecount, for sanity */
+       if (!memcmp(id->bim_magic, "SWAPSPACE2", id->bim_len) &&
+                       (blkid_le32(sws->sws_version) != 1 ||
+                        sws->sws_lastpage == 0))
+               return 1;

but it looks like the sws_version is in native-host order and should not be
byteswapped...

I can fix this in rawhide and push it out for an F9 update but unfortunately it
will be in F9-GA, I think.


Comment 10 Kazunori Asayama 2008-05-12 04:16:24 UTC
(In reply to comment #9)
> but it looks like the sws_version is in native-host order and should not be
> byteswapped...

So it is a generic problem for big-endian hosts?

> I can fix this in rawhide and push it out for an F9 update but unfortunately it
> will be in F9-GA, I think.

I see. I'll wait for F9 update.


Comment 11 Eric Sandeen 2008-05-12 04:29:19 UTC
Yep, it's generic.  I'm sorry about that, it was a fairly last-minute F9 change
that obviously wasn't tested well enough.

Comment 12 Kazunori Asayama 2008-05-12 07:51:10 UTC
(In reply to comment #9)
I applied this fix, i.e. I changed blkid_le32(sws->sws_version) to
sws->sws_version, and it worked correctly. (though 'make check' failed because
the 'lib/blkid/tests/swap1.img.bz2' was a little-endian image...)


Comment 13 Fedora Update System 2008-05-12 19:07:07 UTC
e2fsprogs-1.40.8-3.fc9 has been submitted as an update for Fedora 9

Comment 14 Kazunori Asayama 2008-05-13 01:45:43 UTC
(In reply to comment #13)
It works. Thanks.


Comment 15 Fedora Update System 2008-05-13 15:28:29 UTC
e2fsprogs-1.40.8-3.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update e2fsprogs'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-3675

Comment 16 Bug Zapper 2008-05-14 10:52:54 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 17 Fedora Update System 2008-05-21 10:59:32 UTC
e2fsprogs-1.40.8-3.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.