0

My Ubuntu 18.04 LTS on an ASUS VivoBook S15 is taking about 30 seconds to boot from the time that Grub2 initiates the Ubuntu boot until the login box appears (dual boot system with Windows but I don't think that this is relevant - Windows boots fast). From the output of dmesg I see that most of this time is due to trying to find an "Attached SCSI removable disk":

[2.922832] scsi 3:0:0:0: Direct-Access Canon MG6800 series 0203 PQ: 0 ANSI: 2

[2.923136] sd 3:0:0:0: Attached scsi generic sg1 type 0

[2.923740] sd 3:0:0:0: Power-on or device reset occurred

[2.925122] sd 3:0:0:0: [sdb] Attached SCSI removable disk

[33.459029] fbcon: Taking over console

I sometimes attach an external hard disk by USB and also some USB pen-disks, but they have all been ejected/unmounted; the delay happens whether the Canon printer (connected by USB) is on or off. I don't see what Ubuntu could be looking for. Could you please advise on where the problem might be?

Thanks and best wishes, John

user717045
  • 43
  • 2
  • 9
  • I am now wondering whether the dual boot might be involved after all. This boot delay started after I had a mishap with AOMEI partition manager in Windows trying to reduce an NTFS partition; there was an apparent crash and I lost my Ubuntu partitions and had to restore them with testdisk. In this process a Microsoft Reserved partition then at /dev/sda2 was corrupted and did not try get it back since the EFI boot partition (/dev/sda1) does all that is needed to boot Windows. – user717045 Apr 18 '20 at 18:51
  • The corrupted/deleted partition was never mounted (never in fstab), but it is possibly still visible somewhere to Ubuntu (an NTFS partition is now named /dev/sda2 as the device numbers changed)? – user717045 Apr 18 '20 at 18:52
  • 2
    If your /etc/fstab has mounts for disks that are sometimes not connected, you need to change the mount options to include nofail,x-systemd.device-timeout=30. – heynnema Apr 18 '20 at 21:35
  • All of the partitions in my etc/fstab are meant to be mounted and all are (eventually) correctly mounted. I only have one physical hard disk (sda) with both Windows and Ubuntu partitions, so that I don't understand the reference to sdb. I unplugged all USB devices and got no sdb reference with reboot, but got the same 30 second wait with dark screen then the same "fbcon: Taking over console". I am sure that I didn't have this long wait before my disk accident - sda is an SSD and it was certainly taking less than 10 seconds before. – user717045 Apr 19 '20 at 19:54
  • Well, you lost me there :-) Without sitting down, playing with it myself, and wrapping my head around it, I can't help any more. Sorry. – heynnema Apr 19 '20 at 20:15
  • The 30 second blank screen is purple not black. I'm wondering if instead of a partition mount problem I may have a video problem as in https://wiki.ubuntu.com/X/Troubleshooting/BlankScreen ? – user717045 Apr 19 '20 at 20:30
  • 1
    Try booting with nomodeset. – heynnema Apr 19 '20 at 21:30
  • Same time delay (about 31 seconds with solid deep purple screen) but it boots into a low resolution display. – user717045 Apr 21 '20 at 13:20
  • I am now tending to think again that it is a mount problem after all and probably due to my swap partition (https://www.dedoimedo.com/computers/ubuntu-beaver-slow-boot.html). To check I completely removed the swap partition line in fstab, but it still boots up with the partition (sda8) mounted and with swap active (following the same blank screen delay). I don't see how this can happen - is the fstab info memorised somewhere? I would like not to delete the partition if possible but can try that next. I have no swap file, only swap partition. – user717045 Apr 21 '20 at 13:21
  • When I resolved my partition erasure problem with testdisk, my root and home directories were apparently perfectly restored, but my 8GB swap partition was reduced to only 16MiB which could not be expanded or formatted. I thus deleted it and added a new swap partition with a new device number (and UUID). I guess that this must be part of the problem. – user717045 Apr 21 '20 at 13:32
  • You didn't say anything about using testdisk to restore your disk in your question. That would have been critical info to share. Now you have to add the mount, with the new UUID, back to /etc/fstab. Do free -h to confirm swap. – heynnema Apr 21 '20 at 14:18
  • 1
    Please see my quick answer. Please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks! – heynnema Apr 21 '20 at 14:22

2 Answers2

1

From the comments...

Not declared in the original question, testdisk had been used to restore their HDD from a partition erasure, and some partitions were clearly not working correctly.

Rebuilt the swap partition, edited /etc/fstab with the new UUID, and it's all working ok now.

Update #1:

I guess that it's not fully operational after all. Recommend backing up important data, wipe the disk, lay down a fresh MBR/GPT partition table (this will wipe the disk), and reinstalling Windows/Ubuntu.

Regarding swap, modern SSD's work fine with swap, without causing wear issues.

heynnema
  • 70,711
  • The problem is not completely resolved, but I voted for heynnema's 3 replies since they were relevant and helpful. – user717045 Apr 21 '20 at 15:49
  • I had already before asking this question deleted the corrupted swap partition and rebuilt a new one which worked, but there was still a problem not only with the 31 second blank screen (subject of my question) but also with the fact that the swap partition was mounted and activated upon booting even when the relevant mount line was deleted from fstab. Thus I found myself with an active swap which had not been asked for. I disabled swap under GParted which worked, ran free -h which showed that the swap memory was 0, then rebooted but the swap partition was again remounted with swap active. – user717045 Apr 21 '20 at 15:50
  • So I went back to GParted, deleted the swap partition and rebooted. Now I have no swap partition or swap (as wanted for the moment) but I still have the 31 second blank screen upon rebooting (between GRUB and the splash with Ubuntu and dots prior to logon). I think that there are probably other mount problems (probably with root or home which had been lost and restored) but not sure how to proceed without completely disabling my installation? – user717045 Apr 21 '20 at 15:52
  • @user717045 Does your boot delay occur on the screen that says "Ubuntu" with the rotating dots? – heynnema Apr 21 '20 at 23:11
  • @user717045 You need a swap partition or /swapfile. Why would you try and run without? Edit your question and show me swapon and grep -i swap /etc/fstab and sudo blkid. Report back. Also, accepting my answer is not upvoting my comments, but clicking on the checkmark icon beside my answer. – heynnema Apr 21 '20 at 23:13
  • The delay occurs during the "Purple without cursor (long)" sequence as described at https://wiki.ubuntu.com/X/Troubleshooting/BlankScreen . This is after I select Ubuntu in Grub and before the splash prior to the login box (for me the splash is "ubuntu" with row of dots underneath, nothing rotating). – user717045 Apr 22 '20 at 07:44
  • Thanks so much heynnema, but so I did want to upvote but not accept the answer since the problem has not been completely solved (-: – user717045 Apr 22 '20 at 08:16
  • No swap partition in either fstab or blkid since I completely removed the swap partition (and of course the corresponding fstab entry) vecause swap was behaving abnormally (mounting even after the fstab entry had been removed). I believe this was due to corruption of the swap partition due to crash of AOMEI partition manager within Windows. I have not [yet] reinstalled swap since the machine is running fine for now without it and I want to fix the blank screen problem before installing it. – user717045 Apr 22 '20 at 08:17
  • But there is also a controversy about whether to activate swap on an SSD device, one saying that it could be harmful to the disk (https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-18-04) and another (https://askubuntu.com/questions/652337/why-no-swap-partitions-on-ssd-drives) saying that it is probably OK under certain conditions. When my problem is fixed I intend to reinstall swap and monitor its possible overuse. – user717045 Apr 22 '20 at 08:18
  • I now believe that the mount problems are likely due to a destroyed Windows partition during (or maybe causing) the AOMEI crash (this was the second partition containing a MBR record back-up, happily the EFI boot partition contains the right information to boot Windows). This means that all of the device numbers had changed after restoration with testdisk (for example Linux root changed from sda8 to sda6). This could somehow mean delays in mounting even if the UUIDs are right. A similar problem was reported at https://www.dedoimedo.com/computers/ubuntu-beaver-slow-boot.html . – user717045 Apr 22 '20 at 08:20
  • So I now propose to fully back up my data and to change the device numbers back to the way they were before the crash using fdisk (as per https://journalxtra.com/linux/how-to-reorder-linux-drive-partition-numbers/) and to see if the blank screen problem goes away. – user717045 Apr 22 '20 at 08:20
  • @user717045 I've updated my answer. Recommend complete rebuild/reinstall. – heynnema Apr 22 '20 at 12:30
  • It's absolutely normal that Ubuntu detetcs and uses an existing swap partition even if there is no line in fstab for it. You can try this with your installer USB (Try Ubuntu without installing) and when logged in just issue the command swapon, you should find your swap partition in use. – mook765 Apr 22 '20 at 15:09
  • Thanks so much for all of your support, heynnema. Your clarification about swap is much appreciated. Complete rebuild and reinstall from a clean disk would cost me days in getting all of applications and configuration back to normal, so I have nothing to lose by first trying my less drastic method. In any case I will make sure to save everything before going forward, and at least my system is working for now without other problems than the blank screen (-:

    I had used AOMEI many times in the past, and this is the first time I had any trouble with it - one cannot be too careful.

    – user717045 Apr 22 '20 at 16:41
0

I did not want to follow the expert's suggestion of reinstalling Windows/Ubuntu because the system was working fine with the 30 blank screen delay, and reinstalling would have been a super bother to get all the applications and configuration back. I also decided not to reorder the partitions to the original configuration since I had found that whenever I modified partitions in Windows AOMEI partition manager the Ubuntu partitions were lost and had to be retrieved, and changing NTFS partitions in GPARTED often caused problems in Windows. So I just waited and suddenly around 3 April 2021 the 30 second wait went down to 6 seconds like before the problem! I have the installation log if someone is interested in which system update may have done the trick, but I think it is also possible that after exactly one year the system resets itself with the existing partition numbers? Anyway, wanted to say that all is now fine, and that if anyone has the same problem he/she can try waiting a year!

user717045
  • 43
  • 2
  • 9