Author Topic: Borked Partition Ordering [SOLVED]  (Read 1843 times)

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Borked Partition Ordering
« Reply #15 on: January 03, 2011, 04:14:48 PM »

OK. We want to save the old image, just in case.

[root@localhost boot]# mv initrd-2.6.33.7-pclos6.bfs.img initrd-2.6.33.7-pclos6.bfs.img-old          <Enter>

Then we make the new one;

[root@localhost boot]# mkinitrd -v initrd-2.6.33.7-pclos6.bfs.img 2.6.33.7-pclos6.bfs

You should see many lines of text scroll by as the process unfolds. That's what the -v option causes; otherwise mkinitrd runs silently, and you might think it's stalled, with no output. When you are returned to the prompt, the process is complete. Then do another ls -l check.

[root@localhost boot]# ls -l |grep initrd                  <Enter>

You should now see both initrd-2.6.33.7-pclos6.bfs.img, and initrd-2.6.33.7-pclos6.bfs.img-old, and the initrd.img link should be pointing at the new initrd-2.6.33.7-pclos6.bfs.img

If that's what you see, it's time to reboot, to see if everything works. You may still see the warning, but the actual delay should be gone.

I've done this on two KDE4 installations, and one still shows the warning while the other does not. Both boot without the delay. Go figure?  ???   ;D ;D

Well, it looks like I didn't do something right - there is no pause anymore waiting for sda7, but during boot the screen kicks into a much lower resolution for a brief moment (then back to the 1024x768) and there were big blank areas in the boot screen that I've never seen before.

Ignoring that, there is no swap space available again.

As the system stands now:

root@Acer_5732Z:/boot# blkid
/dev/sda1: LABEL="AcerAspireSys" UUID="2420E4E220E4BBC4" TYPE="ntfs"
/dev/sda5: LABEL="ASPIRESHARE" UUID="902E-D45C" TYPE="vfat"
/dev/sda6: UUID="5d573e46-c168-4309-b1ef-7623b514d097" TYPE="ext4" LABEL="rootKDE"
/dev/sda8: UUID="43137ca1-a3fa-4e96-8bdc-0bb6b8a7b473" TYPE="ext4" LABEL="tmpKDE"
/dev/sda9: UUID="a6544641-e257-4f68-ad69-282eb23eba46" TYPE="ext4" LABEL="homeKDE"
/dev/sda7: UUID="2f935d74-4524-4cd5-8cab-07d8aa22ec61" TYPE="swap" LABEL="swapKDE"
/dev/sda10: UUID="d79a16d0-0d1d-4d2d-a4a1-fb44610ab5d7" TYPE="ext4" LABEL="JCGBkup"

root@Acer_5732Z:/boot# swapon -s
Filename                                Type            Size    Used    Priority

root@Acer_5732Z:/boot# ls -l |grep initrd
-rw------- 1 root root  5795343 Jan  3 16:47 initrd-2.6.33.7-pclos6.bfs.img
-rw------- 1 root root  7088048 Nov  6 22:17 initrd-2.6.33.7-pclos6.bfs.img-old
lrwxrwxrwx 1 root root       30 Nov  6 22:17 initrd.img -> initrd-2.6.33.7-pclos6.bfs.img
-rw------- 1 root root 11164169 Jun 21  2010 initrd.img.old
root@Acer_5732Z:/boot#

It looks like swap is not getting turned on as swapon -s finds nothing.

If I type swapon LABEL=swapKDE it shows up again in the GKRELL info display.  When I do the swapon -s now, I get:

root@Acer_5732Z:/boot# swapon -s
Filename                                Type            Size    Used    Priority                     
/dev/sda7                               partition       5261248 0       -1                           
root@Acer_5732Z:/boot#


What did I mess up?

HWDude

It would seem like it would be in /etc/fstab. Lets see the swap line again, to check for typos.

[root@localhost ~]# cat /etc/fstab |grep swap

Post your results.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline HWDude

  • Full Member
  • ***
  • Posts: 193
  • HWDude
    • N8OBJ's Home Page
Re: Borked Partition Ordering
« Reply #16 on: January 03, 2011, 04:56:57 PM »
It would seem like it would be in /etc/fstab. Lets see the swap line again, to check for typos.

[root@localhost ~]# cat /etc/fstab |grep swap

Post your results.

root@Acer_5732Z:/etc# cat /etc/fstab |grep swap
root@Acer_5732Z:/etc#

Hmmm,  me thinks there be the problem...arrrrrgh!

fstab has no reference to swap or sda7.  Should there be?

HWDude

Welcome My Son -- Welcome -- To -- The Machine ; Pink Floyd "Wish You Were Here"


Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Borked Partition Ordering
« Reply #17 on: January 03, 2011, 05:09:05 PM »
It would seem like it would be in /etc/fstab. Lets see the swap line again, to check for typos.

[root@localhost ~]# cat /etc/fstab |grep swap

Post your results.

root@Acer_5732Z:/etc# cat /etc/fstab |grep swap
root@Acer_5732Z:/etc#

Hmmm,  me thinks there be the problem...arrrrrgh!

fstab has no reference to swap or sda7.  Should there be?

HWDude

Yes there should be.  ;D ;D  I had you do that because I looked at what you posted before and there's no swap line at all.  ;D

I swear, the devil made me do it... irresistible impulse.  ;D

As root edit the file to add a line;

LABEL=swapKDE  swap   swap   sw,pri=-1   0 0

Save the file, then reboot.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline HWDude

  • Full Member
  • ***
  • Posts: 193
  • HWDude
    • N8OBJ's Home Page
Re: Borked Partition Ordering
« Reply #18 on: January 03, 2011, 06:01:39 PM »

Yes there should be.  ;D ;D  I had you do that because I looked at what you posted before and there's no swap line at all.  ;D

I swear, the devil made me do it... irresistible impulse.  ;D

As root edit the file to add a line;

LABEL=swapKDE  swap   swap   sw,pri=-1   0 0

Save the file, then reboot.

Actually, I gave it some thought while you were creating your last post and looked at another system and from that created the following in fstab:

# Entry for /dev/sda7 :
LABEL=swapKDE swap swap defaults 0 0

I tried this and it seemed to work.  What is the difference between 'defaults' and 'sw,pri=-1'  ?  Or are they really the same thing?

I also figured out the video mode switching problem --- I went into PCLCC -> boot and redid the boot loader partition and discovered that all of the settings for the video boot mode and the resume=LABEL=swapKDE splash=verbose were missing.  Putting them back in seems to calm down the display on booting.   And the swap partition is loading correctly without complaining.

I'm going to mark this one as solved - I've learned a lot from going thru this and want to THANK YOU profusely for taking the time and having the patience to walk me thru all of this.  It is SINCERELY appreciated! You've clearly got teacher's blood running thru your veins as your technique of showing what to look for by example is the fastest way and the most efficient technique for conveying all of the subtle details that command line work entails.  

Thank you again for all of your effort and I promise to not try and move a partition again!  -- and not to be so stingy in setting up the root partition size either... ;)

One last question - judging from your fstab file, you have multiple Linux systems booting off of the same machine.  Do you keep the swap partitions from trashing each other by using the techniques you used in your solution?  I've tried multiple boots before and they seem to all want to use the same swap partition.  Also, the live boot CD seems to grab the first linux swap partition it can find and uses it.  Can this be prevented?

HWDude





« Last Edit: January 03, 2011, 06:17:31 PM by HWDude »
Welcome My Son -- Welcome -- To -- The Machine ; Pink Floyd "Wish You Were Here"


Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Borked Partition Ordering
« Reply #19 on: January 03, 2011, 07:38:56 PM »

Yes there should be.  ;D ;D  I had you do that because I looked at what you posted before and there's no swap line at all.  ;D

I swear, the devil made me do it... irresistible impulse.  ;D

As root edit the file to add a line;

LABEL=swapKDE  swap   swap   sw,pri=-1   0 0

Save the file, then reboot.

Actually, I gave it some thought while you were creating your last post and looked at another system and from that created the following in fstab:

# Entry for /dev/sda7 :
LABEL=swapKDE swap swap defaults 0 0

I tried this and it seemed to work.  What is the difference between 'defaults' and 'sw,pri=-1'  ?  Or are they really the same thing?

I also figured out the video mode switching problem --- I went into PCLCC -> boot and redid the boot loader partition and discovered that all of the settings for the video boot mode and the resume=LABEL=swapKDE splash=verbose were missing.  Putting them back in seems to calm down the display on booting.   And the swap partition is loading correctly without complaining.

I'm going to mark this one as solved - I've learned a lot from going thru this and want to THANK YOU profusely for taking the time and having the patience to walk me thru all of this.  It is SINCERELY appreciated! You've clearly got teacher's blood running thru your veins as your technique of showing what to look for by example is the fastest way and the most efficient technique for conveying all of the subtle details that command line work entails.  

Thank you again for all of your effort and I promise to not try and move a partition again!  -- and not to be so stingy in setting up the root partition size either... ;)

One last question - judging from your fstab file, you have multiple Linux systems booting off of the same machine.  Do you keep the swap partitions from trashing each other by using the techniques you used in your solution?  I've tried multiple boots before and they seem to all want to use the same swap partition.  Also, the live boot CD seems to grab the first linux swap partition it can find and uses it.  Can this be prevented?

HWDude


As you only have one swap partition, the line you set up will work fine. I have one swap partition for each hard drive, as each hard drive has at least one OS installed. The two drives showing in my examples are external drives that can be connected by eSATA or USB cable, so are completely portable. I use them on different machines, which is why some of the partitions in my fstab are commented out; they're for another machine.

To aid in efficiency, I use my swap partitions in a striped manner, similar to a RAID, for faster read/writes when swapping. To do that, each swap partition must have the same pri= number. With one swap partition the pri=-1 is used as the default, which is why your line is equivalent to the one I posted.

I ran my own businesses for over 30 years, and personally trained every employee to do things my way. I deliberately looked for those with enthusiasm, but no experience, as it was easier to teach them without having to un-teach them a bunch of bad habits first. When I started playing with computers, I found it was easier to teach kids with no experience, for the same reasons. I kind of got used to doing the examples and such at a level even kids can follow, without too much difficulty. It does work great for long distance troubleshooting too. With a step by step example, one knows what to expect, and can see an error almost immediately, and correct it with a short backtrack. Basically it's the kind of information I wish I'd had available when I was first learning this stuff, and provided so no one else has to go through what I had to. Linux was a bit tougher to learn 12 years ago, and I was the only one I knew who used it, for a long time. (I learned the fine art of world class cussing at the same time.) ;D

As to using these techniques myself, certainly.  ;D  I even use the same fstab on all my installations, with only the label of the / partition varying. No matter which OS I boot, all my important data is always in the same relative place. As noted previously, some partitions in fstab get commented out, and others un-commented, when the drives get moved to different machines.

Having the liveCD grab an existing swap partition is actually a good thing, especially if the machine it's on doesn't have a lot of physical RAM. Sometimes it's the difference between getting a good installation, or a borked one. For the most part, Linux doesn't use swap except as a last resort, when it runs out of physical RAM during a process, or for suspending to disk. A lot of people with extensive RAM don't have a swap partition, because they don't do anything that actually uses all the RAM they have. As time goes by, I tend to use it less and less, but I keep it there, just in case I decide to get heavy duty, on a whim. Checking, just now, I'm using ~57 MB of swap, out of ~14 GB currently available.

[root@fatman ~]# swapon -s
Code: [Select]
Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       8096752 29016   3
/dev/sdb2                               partition       6008300 28944   3

As you can see, it's pretty evenly distributed between the two drives. If you really wanted to have the liveCD not use the swap partition, I suppose you could try noswap as a boot parameter. I really don't know if that would work, as I've never tried it before. I never saw a reason to not use the swap, if it was available.

Anyway, glad you're up and running properly again. I appreciate your appreciation, but when I say it's my pleasure, it really is. I get to fix a problem/solve a puzzle without having to bork my own machine. What could be better?  ;D
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline HWDude

  • Full Member
  • ***
  • Posts: 193
  • HWDude
    • N8OBJ's Home Page
Re: Borked Partition Ordering [SOLVED]
« Reply #20 on: January 09, 2011, 12:43:47 PM »
OP,

Got another small knot to untie on the same related topic.  Just spent the weekend creating and putting a new system together (for my HAM Software Defined Radio Project) and was trying to apply what you taught me.

The system is an ASUS M4A78LT-M Socket AM3 Mobo with an AMD Athlon II X2 3.2Ghz/core, 8GB DDR3 memory, NVIDIA GeForce 9800 GT w/1GB DDR3, 320GB SATA HD

As the system stands, I have:

root@HAM_SDR_Systm:/# blkid
/dev/sda6: LABEL="rootSDR" UUID="e1b4e930-f649-4593-82b1-1a368b15ccca" TYPE="ext4"
/dev/sda7: UUID="ed9acc8f-201c-4ede-ba43-62fe1793f83a" TYPE="swap"
/dev/sda1: LABEL="HAMSDR_C" UUID="329598BF1FEE4D98" TYPE="ntfs"
/dev/sda5: LABEL="HAM_SDR_SHARE" UUID="4E1D26E941460EB1" TYPE="ntfs"
/dev/sda8: LABEL="tmpSDR" UUID="58415aa9-c11b-4abd-96ad-6734e00c14cf" TYPE="ext4"
/dev/sda9: LABEL="homeSDR" UUID="e28e84dc-960b-4f06-8df0-7ba8485f5502" TYPE="ext4"

So, all partitons have labels correctly applied except the swap so.....
I tried to label the swap partition and got the following:

root@HAM_SDR_Systm:/# tune2fs -L swapSDR /dev/sda7
tune2fs 1.41.14 (22-Dec-2010)
tune2fs: Bad magic number in super-block while trying to open /dev/sda7
Couldn't find valid filesystem superblock.

UhOh - what "learning opportunity" did I create this time?

fdisk yields the following:

root@HAM_SDR_Systm:/# fdisk -l /dev/sda -u=cylinders

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcae2cae2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        7648    61432528+   7  HPFS/NTFS
/dev/sda2            7649       18242    85096305    5  Extended
/dev/sda5            7649       11520    31101808+   7  HPFS/NTFS
/dev/sda6           11521       15392    31101808+  83  Linux
/dev/sda7           15393       15901     4088511   82  Linux swap / Solaris
/dev/sda8           15902       16920     8185086   83  Linux
/dev/sda9           16921       18242    10618933+  83  Linux
root@HAM_SDR_Systm:/#

Things seem to be OK partition sequence-wise, what am I missing?

HWDude
Welcome My Son -- Welcome -- To -- The Machine ; Pink Floyd "Wish You Were Here"


Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Borked Partition Ordering [SOLVED]
« Reply #21 on: January 09, 2011, 03:46:59 PM »
HWDude:

Swap doesn't use an ext filesystem, it has it's own. You have to label it with the mkswap command, which will reformat the swap partition at the same time. The procedure is to turn off the swap partition, reformat with the -L <labelname>, check the label, edit fstab and menu.lst to use the label, then make a new initrd image that works with the changes made. In order, as root;

[root@localhost ~]# swapoff /dev/sda7

[root@localhost ~]# mkswap -L swapSDR /dev/sda7

To test:

[root@localhost ~]# blkid /dev/sda7

[root@localhost ~]# swapon LABEL=swapSDR

[root@localhost ~]# swapon -s

Having verified that the swap can be turned on with the LABEL= parameter, you can now edit fstab and menu.lst to use the labels.

Line for fstab:

LABEL=swapSDR   swap   swap   defaults   0 0

Edits for menu.lst:

root=LABEL=rootSDR              resume=LABEL=swapSDR

With the above done, to avoid the 1 minute delay at startup, you must make a new initrd image that incorporates the changes. See Reply #11 and Reply #13 of this thread for details.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline HWDude

  • Full Member
  • ***
  • Posts: 193
  • HWDude
    • N8OBJ's Home Page
Re: Borked Partition Ordering [SOLVED]
« Reply #22 on: January 09, 2011, 09:43:44 PM »
HWDude:

Swap doesn't use an ext filesystem, it has it's own. You have to label it with the mkswap command, which will reformat the swap partition at the same time. The procedure is to turn off the swap partition, reformat with the -L <labelname>, check the label, edit fstab and menu.lst to use the label, then make a new initrd image that works with the changes made. In order, as root;

[root@localhost ~]# swapoff /dev/sda7

[root@localhost ~]# mkswap -L swapSDR /dev/sda7

To test:

[root@localhost ~]# blkid /dev/sda7

[root@localhost ~]# swapon LABEL=swapSDR

[root@localhost ~]# swapon -s

Having verified that the swap can be turned on with the LABEL= parameter, you can now edit fstab and menu.lst to use the labels.

Line for fstab:

LABEL=swapSDR   swap   swap   defaults   0 0

Edits for menu.lst:

root=LABEL=rootSDR              resume=LABEL=swapSDR

With the above done, to avoid the 1 minute delay at startup, you must make a new initrd image that incorporates the changes. See Reply #11 and Reply #13 of this thread for details.

OP,

Thanks again for taking the time to straighten me out - going back over the whole post the swap label naming is definitely done in the formatting of the partition.  In any event, the whole process went perfectly and it worked on the first try!  ;D ;D ;D

As you can see, the blkid and fstab results show success!

n8obj@HAM_SDR_Systm:/etc$ blkid
/dev/sda6: LABEL="rootSDR" UUID="e1b4e930-f649-4593-82b1-1a368b15ccca" TYPE="ext4"
/dev/sda7: UUID="f3c98118-7b62-4821-ace7-00d3a061d2a3" TYPE="swap" LABEL="swapSDR"
/dev/sda1: LABEL="HAMSDR_C" UUID="329598BF1FEE4D98" TYPE="ntfs"
/dev/sda5: LABEL="HAM_SDR_SHARE" UUID="4E1D26E941460EB1" TYPE="ntfs"
/dev/sda8: LABEL="tmpSDR" UUID="58415aa9-c11b-4abd-96ad-6734e00c14cf" TYPE="ext4"
/dev/sda9: LABEL="homeSDR" UUID="e28e84dc-960b-4f06-8df0-7ba8485f5502" TYPE="ext4"
n8obj@HAM_SDR_Systm:/etc$

n8obj@HAM_SDR_Systm:/etc$ cat /etc/fstab
# Entry for /dev/sda6 :
LABEL=rootSDR / ext4 relatime 1 1
GPSTimeRef:/Repo09 /Repo09 nfs user,rsize=8192,wsize=8192,ro,soft 0 0
none /dev/pts devpts defaults 0 0
# Entry for /dev/sda9 :
LABEL=homeSDR /home ext4 relatime 1 2
GPSTimeRef:/mnt/GPS_NFS_Xfer /mnt/GPS_NFS_Xfer nfs user,rsize=8192,wsize=8192,soft 0 0
//gpstimeref/GPS_Xfer /mnt/GPS_Xfer cifs user,credentials=/etc/samba/auth.gpstimeref.gps 0 0
# Entry for /dev/sda1 :
LABEL=HAMSDR_C /mnt/HAM_SDR_C ntfs-3g user,umask=000 0 0
# Entry for /dev/sda5 :
LABEL=HAM_SDR_SHARE /mnt/HAM_SDR_Share ntfs-3g user,umask=000 0 0
none /proc proc defaults 0 0
# Entry for /dev/sda8 :
LABEL=tmpSDR /tmp ext4 relatime 1 2
# Entry for /dev/sda7 :
LABEL=swapSDR swap swap defaults 0 0

Everything boots smoothly with no error messages or delays.

THANKS AGAIN!!!!

HWDude
Welcome My Son -- Welcome -- To -- The Machine ; Pink Floyd "Wish You Were Here"


Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Borked Partition Ordering [SOLVED]
« Reply #23 on: January 09, 2011, 10:13:51 PM »
HWDude:

We like the sound of "it worked on the first try!"  ;D
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...