Installing Debian 9 from live image

New to Debian (Or Linux in general)? Ask your questions here!

Re: Installing Debian 9 from live image

Postby p.H » 2018-03-16 08:38

Huecuva wrote:Yeah, I know it's not a bad installation media. I've burned plenty of Linux ISOs (Mint, Debian, Puppy, etc) with Mint USB Image Writer and they've all worked just fine.

Maybe the size of these ISO images is smaller than the actual usable capacity of the SD card.
Huecuva wrote:EDIT: Turns out I still can't put the SD card right into the internal miniPCI-E card reader and install Debian though. It runs so slow in the USB adapter I don't know if it will let me edit the fstab file. I gave it a few minutes and it still wouldn't load more than the wallpaper and mouse cursor. *sigh*.

It's getting confused. IIUC you have two SD cards and two card readers (USB and PCI). What combinations did you use to try to install then run Debian, with what results ?
Note that some (possibly older) USB SD card readers are USB 1.1 only so have a very low throughput (1.5 MB/s at most).
p.H
 
Posts: 596
Joined: 2017-09-17 07:12

Re: Installing Debian 9 from live image

Postby Huecuva » 2018-03-16 23:00

p.H wrote:Maybe the size of these ISO images is smaller than the actual usable capacity of the SD card.
No no. This is the first time I've ever tried to install on an SD card. Head_on_a_Stick, as you know, was trying to suggest my USB was bad because I used Mint USB Image Writer, which I've never had a problem with. I've even used this very same USB with this very same Debian 9 Stretch image to install on the SSD I mentioned before in this thread.

p.H wrote:It's getting confused. IIUC you have two SD cards and two card readers (USB and PCI). What combinations did you use to try to install then run Debian, with what results ?
Note that some (possibly older) USB SD card readers are USB 1.1 only so have a very low throughput (1.5 MB/s at most).
I only have one plugged in at a time. The 32GB one was giving me no end of trouble so I decided to see if the 16GB one would work. I used the same USB adapter, and it's USB 3.0 and plugged into a USB 3.0 port. The SD card is kind of old though, which is probably slowing it down a lot. I installed Debian on the SD card while it was in the USB card reader because the installer won't even acknowledge the SD card exists when I put it in the MiniPCI-E card reader. The plan, as suggested by someone in this thread, was to install it using the USB SD card reader and then edit the fstab so that I could move the SD card into the PCI-E card reader, but it's so slow I don't know if it will let me. I tried just booting it from the SD card in the PCI-E card reader and it said it was a read-only file system. It says
Code: Select all
Read-only file system while trying to open /dev/sda1
Disk write-protected; use the -n option to do a read-only check of the device.
fsck exited with status code 8
Then it says write access is unavailable and it cannot proceed.

I just tried booting it from the USB again and it finally loaded the desktop. I added my user to the sudoers list and rebooted and now it's loaded the icons but not the panels :?

Here's my fstab. I'm not sure what changes I need to make so it will boot when I put it in the PCI-E card reader:
Code: Select all
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=3ca05a7a-342b-4a1e-9f29-56331ccbfd41 /               ext4    errors=remount-ro 0       1

EDIT: Just rebooted again. Still no panels. WTF?

So I figured out how to run the panel manually and it said I couldn't make any changes to it because it was in "kiosk mode". I dug around on the internet for a little bit and found this thread: https://forum.xfce.org/viewtopic.php?id=8801 (Yeah, I'm using xfce) but I was unable to navigate to the folder mentioned as it doesn't appear to exist. Or I'm doing it wrong.

Man, if it's not one thing it's another.
Huecuva
 
Posts: 63
Joined: 2017-06-09 04:00

Re: Installing Debian 9 from live image

Postby p.H » 2018-03-17 11:46

Huecuva wrote:No no. This is the first time I've ever tried to install on an SD card. Head_on_a_Stick, as you know, was trying to suggest my USB was bad because I used Mint USB Image Writer, which I've never had a problem with.

OK, I misunderstood what you wrote. I thought you meant that you had written ISO images on the SD card with no problem.

Huecuva wrote:I decided to see if the 16GB one would work. I used the same USB adapter, and it's USB 3.0 and plugged into a USB 3.0 port. The SD card is kind of old though, which is probably slowing it down a lot.

Did you observe unusual slowness during the installation too or only at runtime ?
Also, did you measure its read and write speed ?
I run Debian a Stretch LXDE installation (not a live ISO image) from a rather slow 8 GB USB 2.0 stick which has an average read speed of 15 MB/s (and a much lower write speed) and it is not that slow. I just made a few adjustments to put anything volatile (/tmp, /var/log, /var/cache) on tmpfs.

Huecuva wrote:I tried just booting it from the SD card in the PCI-E card reader and it said it was a read-only file system.

SD cards have a "write only" lock which is sensed by a switch inside the card reader, just like floppy disks and drives. Maybe the switch in the card reader is stuck in "write only" position ?
Did you watch sd/mmc related messages in the kernel log ?

Huecuva wrote:Here's my fstab. I'm not sure what changes I need to make so it will boot when I put it in the PCI-E card reader

You don't have to make any change. As usual, by default the root filesystem is identified by its UUID, not its device name.

I have no clue why Xfce does not work as expected. I do not use it. Did you check the kernel log for I/O errors on the SD card ?
p.H
 
Posts: 596
Joined: 2017-09-17 07:12

Re: Installing Debian 9 from live image

Postby Huecuva » 2018-03-17 18:15

p.H wrote:Did you observe unusual slowness during the installation too or only at runtime ?
Also, did you measure its read and write speed ?
I run Debian a Stretch LXDE installation (not a live ISO image) from a rather slow 8 GB USB 2.0 stick which has an average read speed of 15 MB/s (and a much lower write speed) and it is not that slow. I just made a few adjustments to put anything volatile (/tmp, /var/log, /var/cache) on tmpfs.
It seemed fine during installation. Meh. It's booting. It actually seems a bit faster now that it has booted more than once. Maybe it was just the initial first time setup that was taking so long. I'm not too concerned about it. Once I get it working in the PCI-E card reader it won't be getting rebooted very often anyway.
p.H wrote:SD cards have a "write only" lock which is sensed by a switch inside the card reader, just like floppy disks and drives. Maybe the switch in the card reader is stuck in "write only" position ?
Did you watch sd/mmc related messages in the kernel log ?
Yeah there isn't one on the card itself. It's actually a microSD card which I have to put into a miniSD card adapter for the miniPCI-E card reader. I didn't see any switches on the reader either. There is one on the miniSD card adapter and I switched it, but it didn't make any difference. I will have another look at it later today when I get time.
p.H wrote:You don't have to make any change. As usual, by default the root filesystem is identified by its UUID, not its device name.
Well, that's good to know. One less step.
p.H wrote:I have no clue why Xfce does not work as expected. I do not use it. Did you check the kernel log for I/O errors on the SD card ?
No, but I can. Where do I find that?
Huecuva
 
Posts: 63
Joined: 2017-06-09 04:00

Re: Installing Debian 9 from live image

Postby debiman » 2018-03-17 19:10

why can't i UNsubscribe from this thread...
User avatar
debiman
 
Posts: 2900
Joined: 2013-03-12 07:18

Re: Installing Debian 9 from live image

Postby Huecuva » 2018-03-17 23:48

When I put the miniSD card adapter back into the miniPCI-E card reader, it was pushing the lock switch half way back to the lock position. A little piece of tape fixed that issue. It is now booting in the miniPCI-E card reader. :D

However, I'm still getting this annoying kiosk mode thing. I read it was a problem with the user account and deleting and recreating the user account would fix that. i tried that and still have the same problem.

Also, when I put in the 750GB 2.5" NTFS formatted SATA hard drive that is to be the storage drive, it boots GRUB off the SD card and lets me select Debian to boot into, and then throws a bunch of errors:
Code: Select all
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /run on /dev/run failed: No such file or directory
run-init: opening console: No such file or directory
Target filesystem doesn't have requested /sbin/init.
run-init: opening console: No such file or directory
(repeated 5 times)
No init found. Try passing init= bootarg.
and then it runs BusyBox or something and gives me a command prompt that says (initranfs) and just stops. It still boots fine into Debian if I take the HDD back out.

EDIT: I managed to run
Code: Select all
sudo e2fsck -f /dev/sdc1
in live Stretch booted from the USB (since, with the live USB and the HDD connected the SD card is sdc) but it didn't change anything. I tried booting with another SSD in the SATA slot and I get very similar errors with the addition of
Code: Select all
mount: mounting /dev/sda1 on /root failed: No such device
and instead of run-init: opening console: No such file or directory it says
Code: Select all
run-init: current directory on the same filesystem as the root: error 0


It looks like it's still trying to mount /dev/sda1 to boot, only sda isn't the SD card anymore. I imagine this issue would be easily solved by reinstalling with the HDD connected so that the SD card's UUID is symlinked to sdb during installation but is there a way change the symlink without reinstalling? if I can't fix the kiosk mode problem I will ultimately have to reinstall with a different GUI anyway.
Huecuva
 
Posts: 63
Joined: 2017-06-09 04:00

Re: Installing Debian 9 from live image

Postby Huecuva » 2018-03-18 06:05

After hours of digging around online, I finally fixed the kiosk mode issue. I had to delete the contents of /home/user/.cache/sessions/ and delete the xfce4-panel.xml file, uncheck the "save session for future logins" box and reboot. Now I just need to reinstall to fix the sda/sdb boot symlink issue. I'll do that tomorrow unless there's a quicker way to do it. After looking around on the Internet though, it doesn't look like it's easy to replace a drive symlink file.
Huecuva
 
Posts: 63
Joined: 2017-06-09 04:00

Re: Installing Debian 9 from live image

Postby p.H » 2018-03-18 10:13

Huecuva wrote:When I put the miniSD card adapter back into the miniPCI-E card reader, it was pushing the lock switch half way back to the lock position. A little piece of tape fixed that issue.

Write protect lock switch issue as expected. Once again, error messages provide valuable information and lead to the right direction.
Huecuva wrote:It is now booting in the miniPCI-E card reader.

It was already booting in the PCI card reader. It was just not booting all the way due to the read-only root device.
Huecuva wrote:Also, when I put in the 750GB 2.5" NTFS formatted SATA hard drive that is to be the storage drive, it boots GRUB off the SD card and lets me select Debian to boot into, and then throws a bunch of errors:

It seems that the initramfs is mounting the wrong device as the root filesystem. Check the root= parameter in the linux command line (not set lines), from /proc/cmdline and /boot/grub/grub.cfg. It should be root=UUID=3ca05a7a-342b-4a1e-9f29-56331ccbfd41 but in your case I suspect that it is root=/dev/sda1.

I have observed that sometimes, for an unknown reason, when update-grub generates grub.cfg, it puts the device name root=/dev/xxx instead of the UUID root=UUID=xxx, even though GRUB_DISABLE_LINUX_UUID=true is commented out in /etc/default/grub. Running again update-grub to rebuild grub.cfg may fix the issue.
p.H
 
Posts: 596
Joined: 2017-09-17 07:12

Re: Installing Debian 9 from live image

Postby Huecuva » 2018-03-18 18:40

You were right. The line in the grub.cfg file was just root=/dev/sda1. I ran update-grub and it fixed that. It is now booting with the HDD connected.

However, now on boot it still tries first to boot from the HDD and says
Code: Select all
This is not a bootable disk. Please insert a bootable floppy and press any key to try again.
When any key is pressed, it proceeds to boot into Debian.

In BIOS, the boot priority order when nothing else is plugged in is:

1. USB HDD: Generic STORAGE DEVICE (My SDcard?)
2. ATA HDD0: HGST HT541075A9E6B0 (The HDD)

And a bunch of other stuff, none of which are explicitly the SD card. There are no USB devices (other than my trackball keyboard) connected so I'm guessing that USB HDD mentioned is my SDcard. Or maybe it isn't.

EDIT: Well, that's weird. Upon booting into BIOS and then exiting (without saving anything, I might add), it now boots correctly without complaining about the bootable disk. I don't get it.
Huecuva
 
Posts: 63
Joined: 2017-06-09 04:00

Re: Installing Debian 9 from live image

Postby p.H » 2018-03-19 07:30

The priority among boot devices is set in the BIOS settings anyway. If not possible you could install a copy of GRUB on the hard disk as a workaround.

So everything seems to be working now except the 32 GB SD card ?

About that card, you should probe it again in both the USB and PCI readers to check whether it is bad, or one of the readers cannot handle it properly.
p.H
 
Posts: 596
Joined: 2017-09-17 07:12

Re: Installing Debian 9 from live image

Postby Huecuva » 2018-03-19 13:19

Everything is working except the 32GB card, yes. I put it in my Windows rig and ran H2testw on it. Turns out only 7GB of it is usable. I guess I got screwed somewhere. Oh well.

Thanks again for all your help, mate.
Huecuva
 
Posts: 63
Joined: 2017-06-09 04:00

Re: Installing Debian 9 from live image

Postby p.H » 2018-03-19 13:50

You're welcome.

I have very little experience with SD cards and readers, even less with high capacity ones. The only one I have is from my GPS device and has a capacity of 1 GB.
The capacity advertised by the card may be fake, or the reader cannot access it all. However in the latter case, I assume that the advertised capacity would be reduced too.
When you tested the SD Card on Windows, did you use the same USB reader ?

Just a last warning : I read that an SD card can wear out fast when used as a system drive with ext4. But again, I have no personal experience with such use.
p.H
 
Posts: 596
Joined: 2017-09-17 07:12

Re: Installing Debian 9 from live image

Postby Huecuva » 2018-03-19 22:47

I did use the same USB reader in my Windows rig. The same one I used to install Debian on the 16GB card. The USB reader works fine. There's nothing wrong with it, I'm sure of that. The card is probably fake. Hell, it doesn't even have a brand name printed on it. Too late to file a claim on ebay, though. I bought this thing like 3 years ago. Ah well, 7GB card and it came with a USB card reader (a completely different one than the one I used, but it works) so, not a complete loss. It didn't cost much or I wouldn't have bought it. Funny thing: when I ordered the card, it took so long to show up in the mail that I messaged the seller on ebay and he sent me another one, only to have the first one show up soon after so I actually got two of them. I have both USB card readers, but I don't recall where the other card went.

As for that warning regarding SD cards and ext4 system drives: That's good to know, thanks. I'll look into that a little more and keep a eye on it. Like I said, it won't be getting rebooted much once I have it all configured and set up to do what I want it to do, so hopefully that will reduce the wear on it. I had kind of considered that already though. That's one reason I didn't put a swap partition on the SD card. Does ext4 perform a lot of write operations to the drive? Maybe I should reinstall and use ext2 instead?
Huecuva
 
Posts: 63
Joined: 2017-06-09 04:00

Re: Installing Debian 9 from live image

Postby p.H » 2018-03-20 09:00

Ext4 performs extra writes due to journaling : changes are written into the journal then into the metadata and data areas. Also this causes repeated writes to the journal area, which may wear out this area in the flash memory faster if the card FTL (flash translation layer, performed by the embedded controller) does not perform efficient wear leveling. You can disable the journal with tune2fs and still benefit the other enhancements of ext4 instead of using ext2 which is a bit outdated.

As an alternative, there are flash oriented filesystems. They are mostly log-structured filesystems, designed to optimize write and limit wear. You may have heard of JFFS2 or UBIFS, but these are designed to work on raw flash memory chips without a FTL, not on flash memory based block devices with a FTL such as SSDs, memory cards or USB drives. They require an emulation layer block2mtd to be used on such devices.

F2FS and NILFS are flash oriented filesystems designed for flash block devices. Unfortunately none is supported by the Debian installer. So using them as the root filesystem requires to install the system on a supported filesystem first then transferring it on the target filesystem. Also note that GRUB supports NILFS but not F2F2 so using F2FS as the root filesystem requires a separate /boot with a supported filesystem (or another boot loader which supports F2F2 ; also, any filesystem-independent blocklist-based boot loader such as LILO may no work reliably with a log-structured filesystem).

Another common optimization to limit writes is to put volatile and temporary data on tmpfs if you have enough memory. This can include /tmp, /var/cache, /var/log (if you don't need to keep logs between reboots)...
p.H
 
Posts: 596
Joined: 2017-09-17 07:12

Re: Installing Debian 9 from live image

Postby Huecuva » 2018-03-20 23:42

I think disabling journaling is probably my best bet. Maybe also setting up a tmpfs in RAM. There's only 4GB of RAM, but this thing is going to be just streaming an internet music stream and that's literally all it will be doing so there should be plenty of room. I think for tmpfs all you need to do is add a line to fstab, right? I'll look into all this more later.
Huecuva
 
Posts: 63
Joined: 2017-06-09 04:00

PreviousNext

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable