Bug 460608 - Swap partition is not restored by hts after running hts storage test in RHEL4.x.
Swap partition is not restored by hts after running hts storage test in RHEL4.x.
Status: CLOSED DUPLICATE of bug 467679
Product: Red Hat Hardware Certification Program
Classification: Red Hat
Component: Test Suite (tests) (Show other bugs)
5.2
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: YangKun
Lawrence Lim
:
Depends On: 467679
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-28 20:36 EDT by NIWA Hideyuki
Modified: 2014-03-25 20:55 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-06 21:51:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
results.xml (185.98 KB, application/x-gzip)
2008-09-04 21:23 EDT, NIWA Hideyuki
no flags Details
/etc/fstab (603 bytes, application/octet-stream)
2008-10-17 06:23 EDT, NIWA Hideyuki
no flags Details

  None (edit)
Description NIWA Hideyuki 2008-08-28 20:36:44 EDT
Description of problem:
Swap partition is not restored by hts after running hts storage test in RHEL4.x.

This bug is fixed in RHEL5.x (BZ#437227), but the same bug is reproduced in RHEL4.x.

hts seems to use blkid command to get the label name of swap, but blkid does not display the label name in RHEL4.x. So hts fails to get the label name of swap, then hts fails to restore swap partition.

RHEL5:
# blkid
/dev/sda3: TYPE="swap" LABEL="SWAP-sda3"

RHEL4:
# blkid
/dev/sda3: TYPE="swap"

hts version is as follows.
# rpm -q hts
hts-5.2-16.el4

How reproducible:
Always

Steps to Reproduce:
* In this case, swap partition is /dev/sda3 and label name is "SWAP-sda3"

1) Run the storage test.
# hts certify --test storage

2) Confirm the swap is enabled.
# swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda3                               partition       10241428        0      -2

3) Disable swap.
# swapoff -a

4) Confirm the swap is disabled.
# swapon -s
#

5) Enable swap.
# swapon -a
swapon: cannot find the device for LABEL=SWAP-sda3

6) Confirm the swap is not enabled.
# swapon -s
#

7) Set label name to the swap partition.
# cat /etc/fstab |grep swap
LABEL=SWAP-sda3         swap                    swap    defaults        0 0
# mkswap -L SWAP-sda3 /dev/sda3
Setting up swapspace version 1, size = 10487226 kB

8) Enable swap again.
# swapon -a

9) Confirm the swap is enabled.
# swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda3                               partition       10241428        0      -3

Actual results:
After the storage test, the label name of swap partition is broken.

Expected results:
After the storage test, the label name of swap partition is restored.

Additional info:
This error caused in RHEL4.x only.
Comment 1 YangKun 2008-08-28 23:01:52 EDT
could you please provide the file "/var/hts/results.xml" ?

Thanks
-YK
Comment 2 NIWA Hideyuki 2008-09-04 21:23:02 EDT
Created attachment 315824 [details]
results.xml

Hello,

I updated results.xml. Please check it.

Regards.
Comment 3 YangKun 2008-09-08 04:02:39 EDT
Hi,

The file you uploaded seems to be "results.xml.gz". I tried to gunzip it, but I can not open/read it after the gunzip. 

could you please upload it again without the compression ?

Thanks very much.
-YK
Comment 6 YangKun 2008-09-09 06:01:43 EDT
(In reply to comment #3)
> Hi,
> 
> The file you uploaded seems to be "results.xml.gz". I tried to gunzip it, but I
> can not open/read it after the gunzip. 
> 
> could you please upload it again without the compression ?
> 
> Thanks very much.
> -YK

the uploaded file was compressed twice, I gunzipped it twice and then can read it.
Comment 7 YangKun 2008-09-09 06:08:51 EDT
Hi,

In the uploaded results.xml file. I saw 18 swap partitions in total, and they were all restored correctly after the testing. Could you please point out where the error is ? Did I miss anything ?

Thanks
-YK
Comment 8 NIWA Hideyuki 2008-09-11 05:26:56 EDT
Hello,

The problem caused to /dev/sda3.

The other swaps don't set label, so they are all restored succesfully.

Regards.
Comment 9 YangKun 2008-09-17 04:01:46 EDT
Hi,

I checked the uploaded results.xml file again, turns out the "/dev/sda3" was also restored succesfully:

=====================================================================
 3182 *** Raw I/O testing passed.
 3183 
 3184 swap device has no label.
 3185 restoring swap device /dev/sda3 ...
 3186 done.
 3187 restored the swap device.
 3188 
 3189 Storage test on device sda passed
 3190 ...finished running ./storage.py, exit code=0
 3191 
 3192 </output>
 3193     </run>
 3194   </test>
 3195   <test name='storage' label='' logical-device='sdb' device-class='STORAGE' device-bus='SCSI' udi='' interactive='no'>
 3196     <run end-time='2008-08-05 08:57:22' run-time='2008-08-05 08:20:37' mode='normal' return-value='0' number='1'>
 3197       <kudzu>generic sg1
 3198 bus SCSI
 3199 driver ignore

.......

 3267 +---------- /proc/swaps ----------+
 3268 Filename                                Type            Size    Used    Priority
 3269 /dev/sdc1                               partition       10239936        0       -1
 3270 /dev/sdd1                               partition       10239936        0       -2
 3271 /dev/sde1                               partition       10239936        0       -3
 3272 /dev/sdf1                               partition       10239936        0       -4
 3273 /dev/sdg1                               partition       10239936        0       -5
 3274 /dev/sdh1                               partition       10239936        0       -6
 3275 /dev/sdi1                               partition       10239936        0       -7
 3276 /dev/sdj1                               partition       10239936        0       -8
 3277 /dev/sdk1                               partition       10239936        0       -9
 3278 /dev/sdl1                               partition       10239936        0       -10
 3279 /dev/sdm1                               partition       10239936        0       -11
 3280 /dev/sdn1                               partition       10239936        0       -12
 3281 /dev/sdo1                               partition       10239936        0       -13
 3282 /dev/sdp1                               partition       10239936        0       -14
 3283 /dev/sdq1                               partition       10239936        0       -15
 3284 /dev/sdr1                               partition       10239936        0       -16
 3285 /dev/sda3                               partition       10239968        0       -19
 3286 /dev/sdb1                               partition       10239936        0       -18
 3287 +---------- /proc/diskstats ----------+

......
=====================================================================

Please notice that after testing on sda, the test continued to run on sdb and other HDDs, and I did see "/dev/sda3" showed up in "/proc/swaps" while testing on other HDDs. If sda3 was not restored successfully, it will not be in "/proc/swaps".

Or did I miss anything ?

-YK
Comment 10 NIWA Hideyuki 2008-10-03 05:57:13 EDT
Hello,

After the storage test, swap partition is still enabled. But when I restart the system, swap partition is not mounted because of the label name is not restored.

1. Before the test, swap partition is enabled.
# cat /proc/swaps
Filename                                Type            Size    Used   Priority
/dev/sdc1                               partition       10239936        0      -1

2. Test storage
# hts certify --test storage

3. After the test, swap partition is restored
# cat /proc/swaps
Filename                                Type            Size    Used   Priority
/dev/sdc1                               partition       10239936        0      -1

4. Restart the system
# shutdown -r now

5. After the system restart, swap partition is NOT mounted
# cat /proc/swaps

6. Mount swap partition manually, but mount failed
# swapon -a
swapon: cannot find the device for LABEL=SWAP-sda3

Regards.
Comment 11 YangKun 2008-10-05 23:56:25 EDT
Hi,

Please see my inline comments below.


> 
> After the storage test, swap partition is still enabled. But when I restart the
> system, swap partition is not mounted because of the label name is not
> restored.
> 
> 1. Before the test, swap partition is enabled.
> # cat /proc/swaps
> Filename                                Type            Size    Used   Priority
> /dev/sdc1                               partition       10239936        0     
> -1

I'm confused, I think you've mentioned "The problem caused to /dev/sda3." in comment#8 . why sdc now ?

> 
> 2. Test storage
> # hts certify --test storage
> 
> 3. After the test, swap partition is restored
> # cat /proc/swaps
> Filename                                Type            Size    Used   Priority
> /dev/sdc1                               partition       10239936        0     
> -1
> 
> 4. Restart the system
> # shutdown -r now
> 
> 5. After the system restart, swap partition is NOT mounted
> # cat /proc/swaps
> 
> 6. Mount swap partition manually, but mount failed
> # swapon -a
> swapon: cannot find the device for LABEL=SWAP-sda3
> 
> Regards.

could you please attach the /etc/fstab file here ?

Thanks
-YK
Comment 12 NIWA Hideyuki 2008-10-17 06:23:35 EDT
Created attachment 320651 [details]
/etc/fstab

Hello,

> I'm confused, I think you've mentioned "The problem caused to /dev/sda3." in
> comment#8 . why sdc now ?

I'm sorry. comment#10 is wrong.
The correct /proc/swaps is follows:
Filename                                Type            Size    Used    Priority
/dev/sda3                               partition       10241428        0       -2

> could you please attach the /etc/fstab file here ?

OK. I attached fstab.

Regards.
Comment 13 YangKun 2008-10-20 03:53:35 EDT
Hi,

Thanks for your information. I re-produced this error on my testing machine.

This should be a "blkid" command's problem, I've escalated this issue, please check the details in https://bugzilla.redhat.com/show_bug.cgi?id=467679

Thanks
-YK
Comment 14 YangKun 2008-11-06 21:51:19 EST
closing this bug as duplicate of bug#467679 now. Please track this issue in that bug.

*** This bug has been marked as a duplicate of bug 467679 ***

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