LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   setup cannot find swap space - pushing GPT to extremes (https://www.linuxquestions.org/questions/slackware-14/setup-cannot-find-swap-space-pushing-gpt-to-extremes-866674/)

Skaperen 03-05-2011 06:52 PM

setup cannot find swap space - pushing GPT to extremes
 
While installing slackware64-current, setup cannot find swap space. This is an extreme case pushing limits with a huge GPT partition table. So there is probably some limit on the number of partitions, or partition number, the swap search looks for. Of 41 partitions I made scattered around the number range from 1 to 128, the swap space exists as partition 90. Maybe the problem is it can only check partitions 1-15 because 16 and beyond have to use a different device major number? When I do proceed with the install, /dev/sda90 is listed as a choice.

FYI, so many partitions is planning ahead for a multi-boot system.

The rest of the install went OK.

Skaperen 03-05-2011 07:06 PM

Here's the layout after the install completed. I have not added the swap space to /etc/fstab, yet, but it does work OK when I manually do "swapon /dev/sda90".

Code:

bash-4.1# parted /dev/sda u s p
Model: ATA WDC WD10EADS-22M (scsi)
Disk /dev/sda: 1953525168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start        End          Size        File system    Name                Flags
100    34s          2047s        2014s                        Linux Reserved
 1      2048s        524287s      522240s      ext2            Linux/Windows data
101    524288s      526335s      2048s                        Linux Reserved
11      526336s      1048575s    522240s                      Linux/Windows data
102    1048576s    1050623s    2048s                        Linux Reserved
21      1050624s    1572863s    522240s                      Linux/Windows data
103    1572864s    1574911s    2048s                        Linux Reserved
31      1574912s    2097151s    522240s                      Linux/Windows data
 2      2097152s    4194303s    2097152s    ext4            Linux/Windows data
 5      4194304s    6291455s    2097152s    ext4            Linux/Windows data
 6      6291456s    10485759s    4194304s    ext4            Linux/Windows data
 7      10485760s    29360127s    18874368s    ext4            Linux/Windows data
 8      29360128s    31457279s    2097152s    ext4            Linux/Windows data
12      31457280s    33554431s    2097152s                    Linux/Windows data
15      33554432s    35651583s    2097152s                    Linux/Windows data
16      35651584s    39845887s    4194304s                    Linux/Windows data
17      39845888s    58720255s    18874368s                    Linux/Windows data
18      58720256s    60817407s    2097152s                    Linux/Windows data
22      60817408s    62914559s    2097152s                    Linux/Windows data
25      62914560s    65011711s    2097152s                    Linux/Windows data
26      65011712s    69206015s    4194304s                    Linux/Windows data
27      69206016s    88080383s    18874368s                    Linux/Windows data
28      88080384s    90177535s    2097152s                    Linux/Windows data
32      90177536s    92274687s    2097152s                    Linux/Windows data
35      92274688s    94371839s    2097152s                    Linux/Windows data
36      94371840s    98566143s    4194304s                    Linux/Windows data
37      98566144s    117440511s  18874368s                    Linux/Windows data
38      117440512s  119537663s  2097152s                    Linux/Windows data
50      119537664s  150994943s  31457280s                    Linux/Windows data
51      150994944s  182452223s  31457280s                    Linux/Windows data
52      182452224s  213909503s  31457280s                    Linux/Windows data
53      213909504s  245366783s  31457280s                    Linux/Windows data
54      245366784s  276824063s  31457280s                    Linux/Windows data
55      276824064s  308281343s  31457280s                    Linux/Windows data
56      308281344s  339738623s  31457280s                    Linux/Windows data
57      339738624s  371195903s  31457280s                    Linux/Windows data
58      371195904s  402653183s  31457280s                    Linux/Windows data
59      402653184s  434110463s  31457280s                    Linux/Windows data
90      434110464s  467664895s  33554432s    linux-swap(v1)  Linux swap
 9      467664896s  1953523711s  1485858816s  ext4            Linux/Windows data
128    1953523712s  1953525134s  1423s                        Linux Reserved

bash-4.1# df -a
Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/root              1032088    206804    772856  22% /
proc                        0        0        0  -  /proc
sysfs                        0        0        0  -  /sys
/dev/sda1              252879    15181    224642  7% /boot
/dev/sda5              1032088    45136    934524  5% /var
/dev/sda6              2064208    92484  1866868  5% /var/log
/dev/sda7              9289080  6310612  2506612  72% /usr
/dev/sda8              1032088    34172    945488  4% /usr/local
/dev/sda9            731270632    201588 693922576  1% /home
tmpfs                  1893872        0  1893872  0% /dev/shm
bash-4.1#


piratesmack 03-05-2011 09:31 PM

Did your format the swap partition before running the installer?
http://www.linuxquestions.org/questi...7/#post4260866

Skaperen 03-05-2011 10:45 PM

Quote:

Originally Posted by piratesmack (Post 4280227)
Did your format the swap partition before running the installer?
http://www.linuxquestions.org/questi...7/#post4260866

Good point. I do believe I did, because it looks formatted and seems to be working. It has a UUID.

volkerdi 03-06-2011 01:31 PM

Tested here, and setup found swap space on /dev/sda19 GPT, which uses the higher 259 major number. I think /dev/sda90 should also work if the partition is formatted with mkswap first, but didn't have the patience to make that many partitions. :)

Skaperen 03-06-2011 01:52 PM

I tried repeating the install. Sometimes it detects the swap and sometimes it does not. I hate intermittent problems (more often it is hardware).

Skaperen 03-06-2011 01:56 PM

You can "jump" partitions and make just the numbers you want, at least for GPT and primary MBR partitions. I only have 41 partitions, with some numbered 90, 100, and 128. At least that is the case with the "gdisk" program I used (did not use "parted" except to list partitions).

But I definitely don't see sda90 having any more issues than sda19. It must be hardware on this cheap machine from Walmart I'm using for tests.

Darth Vader 03-06-2011 02:44 PM

For Gods sake, why someone will need 90 partitions in one disk? :D

I think that it's terrible inefficient this setup.

Just think about one thing: for every ext4 partition, kernel start a little daemon, to update the partition journal every 5 seconds (in a typical configuration). Now imagine 90 daemons yelling every 5 seconds that they want access to disk, of course, in different sections ... ;)

Skaperen 03-08-2011 07:07 PM

Quote:

Originally Posted by Darth Vader (Post 4280754)
For Gods sake, why someone will need 90 partitions in one disk? :D

I think that it's terrible inefficient this setup.

Just think about one thing: for every ext4 partition, kernel start a little daemon, to update the partition journal every 5 seconds (in a typical configuration). Now imagine 90 daemons yelling every 5 seconds that they want access to disk, of course, in different sections ... ;)

Who has 90 partitions?

Ramurd 03-09-2011 03:28 AM

Skaperen has 41 partitions, the numbers are not linear in his setup. Read the OP more carefully.
The question I'd have is: what kind of disks do you have, because 41 still seems a bit high to me and my not be supported in certain configurations. You may have to check the definitions and their limits. (e.g. IDE drives these maxima: either 4 primary partitions or 3 primary, 1 extended with 4 secondary = 7 effective partitions) other protocols may be different.

wildwizard 03-09-2011 04:37 AM

Quote:

Originally Posted by Ramurd (Post 4283859)
The question I'd have is: what kind of disks do you have, because 41 still seems a bit high to me and my not be supported in certain configurations.

He/She is using GPT so you can throw out the old thinking completely.

http://en.wikipedia.org/wiki/GUID_Partition_Table

Skaperen 03-09-2011 06:45 AM

Quote:

Originally Posted by wildwizard (Post 4283944)
He/She is using GPT so you can throw out the old thinking completely.

http://en.wikipedia.org/wiki/GUID_Partition_Table

You can do this with MBR, too. It's easy with the first 4 primary partitions. You can have just partition number 4 all by itself. It's technically possible with the logical partitions, too, but a couple programs I've tried it with (years ago) would not set it up. It's wasteful, too, because logical partitions are actually a nested layer of extended partitions. And they use up one of the primary slots.

GPT just makes things simple and easy. You get 128 slots and can use them pretty much as you please, in any order you please. Look at my partition table previously posted and you can see that the number order and allocation order are not the same. GPT handles this just fine (as did MBR, though doing so for logical partitions numbered 5 and up would be tricky and limited, and no tools I've seen can accomplish it for other than the 4 primary partitions).

BTW, it is said that MBR works only for drives up to 2TB. Reality is, it can work on any size drive, but limits the size of any partition to just under 2TB, and limits the starting sector of any partition to the sector just before the 2TB line. You could allocate nearly 4TB based on the structure of the MBR partition table format. However, I have found that partition tools end up doing calculations in error, probably as a result of 32 bit integer overflows, when pushing beyond the 2TB line. I haven't yet tested to see if the kernel itself would have an issue with MBR partitions running past the 2TB line.

The classic Linux device node numbering provided only 15 partitions for SCSI (SATA is classified as SCSI), but 63 for IDE. Several years ago I took advantage of that and set up a 27 partition box (a mix of Linux and BSD). How? I put BSD (label) partitions inside each of 4 MBR partitions. Linux saw them all (it does understand BSD labels from at least the popular BSD systems).

Quote:

Originally Posted by Ramurd (Post 4283859)
Skaperen has 41 partitions, the numbers are not linear in his setup. Read the OP more carefully.
The question I'd have is: what kind of disks do you have, because 41 still seems a bit high to me and my not be supported in certain configurations. You may have to check the definitions and their limits. (e.g. IDE drives these maxima: either 4 primary partitions or 3 primary, 1 extended with 4 secondary = 7 effective partitions) other protocols may be different.

This is a test box where I am setting up multiple installs, mostly Slackware, but also Debian, Fedora, and Ubuntu. There are 4 groups of partitions arranged for split filesystems (e.g. / /boot /var /var/log /usr /usr/local on different partitions). These are in 1 through 38 (not all numbers used). Then there are 10 single-partition systems numbered 50 to 59. These are intended for running in virtual machines but are being given partitions rather than files so I can, if needed, run or install them on the real hardware.

This is a 1TB SATA drive. I've installed the first 2 systems, Slackware64-current (on 1-8,9,90) and Slackware-current (on 11-18,9,90), and they are working fine, able to access every partition. The 3rd system will a multi-lib -current, and the 4th will be Slackware-current with a 64-bit kernel. Initially, I'm going to put old versions of Slackware in the 10 single-partition slots (on 50-59) just to shake things out.

The original post was because I encountered the problem with the swap space. I could work around it, but I was sure I had it set up right so it would be found. Turns out sometimes it works and sometimes not. I don't know the cause of that. When I run into something I'm not sure is, or is not, an issue, I post here to get information on other people's experiences with it, before I report it as a bug. Since it does work at least sometimes, I know the mechanism to detect it is there. As long as udev sets up the device nodes and the scanner looks at all devices listed in /proc/partitions, it should find it. And that seems to be in place (at first I was concerned it might not be). I don't know the cause of the failures I've seen now a couple times. Eventually, I'll have some time to dig into the installer so I can see where something might be failing. I do have a 2nd machine just like this one which is currently occupied with another project. That should be done soon, and I'm going to do the same setup on that one just to see if there are any hardware glitches (e.g. maybe the scan for swap trips up on hardware errors).

edit...

Oh, and the MBR partition table can keep going beyond 7 (whether IDE, SCSI, SATA, or whatever). I've done 12 before on IDE. In theory it can go on indefinitely. The way it works is that it starts with one of the 4 primary partitions being an extended type. Within that partition is another partition table which is designated to have 2 entries. One of these 2 entries defines how much of that extended partition is another nested extended partition, and the other is how much of that extended partition is a data partition. Now inside that nested extended parition just repeat the same thing with yet another partition table. Once you reach a level that lacks a deeper extended partition, you're done. The nested extended partition entries do not show up with numbers, and the data ones are numbered in order as you deeper, starting at 5.

piratesmack 03-09-2011 06:59 AM

FWIW, I created a new swap partition on my disk, and gave it number 90.
The Slackware installer detects mine every time.
Code:

# gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.6.14

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 312581808 sectors, 149.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): C66D92FA-CAF0-4414-B895-87B694A1B02F
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 312581774
Partitions will be aligned on 2048-sector boundaries
Total free space is 77698669 sectors (37.0 GiB)

Number  Start (sector)    End (sector)  Size      Code  Name
  1            2048            4095  1024.0 KiB  EF02  BIOS boot partition
  2            4096        2101247  1024.0 MiB  8200  Linux swap
  3        2101248        23072767  10.0 GiB    0700  Linux root
  4        23072768      232787967  100.0 GiB  0700  Linux home
  90      232787968      234885119  1024.0 MiB  8200  Linux swap


Skaperen 03-09-2011 09:58 AM

It's detecting mine most of the time. It's the 1st and 4th tries that it failed to. But because I had not yet seen a success after just the 1st try, I had a wide range of possible causes. I probably should have done more tries before posting here. When the other machine just like it gets done with its Ubuntu project, I'll redo all this on that machine and see what happens (these 2 machines are identical cheap $300 machines from Walmart). I have had one case of the system just not coming up at all from a power up, too (hung loading kernel). Re-seating cables might be in order.


All times are GMT -5. The time now is 04:46 AM.