DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having trouble completing the install on the debian-installer. I'm trying to do a netinstall of debian 9 onto usb. On the partition page of the install wizard, I select my USB (sdg) and a new partition is created.
After I select this new partition as the boot partition I get an error message:
Code:
Partition(s) 1 on /dev/sdg have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
ERROR!!!
Does anyone know what that means?
I'm not using a swap partition as it's a usb. Apart from that I don't know what I need to do to complete the install.
A web search for the error message turned up not much at all except one link regarding that same error message, in which someone asked the poster whether that partition might have been already mounted.
A web search for the error message turned up not much at all except one link regarding that same error message, in which someone asked the poster whether that partition might have been already mounted.
This shows the usb is not mounted (it's not showing a mountpoint).
2. Then I re-copied the .iso file onto the usb:
Code:
# dd if=debian-9.2.1-amd64-netinst.iso of=/dev/sdg
593920+0 records in
593920+0 records out
304087040 bytes (304 MB) copied, 56.7293 s, 5.4 MB/s
3. This seems to show the .iso file has been copied to the USB.
Rather than rebooting from USB to complete the install, this time I looked to see if the USB was mounted again:
Code:
#lsblk -o name,mountpoint,label,size,uuid
sdg Debian 9.2.1 amd64 n 29.8G 2017-10-13-13-09-57-00
├─sdg1 Debian 9.2.1 amd64 n 290M 2017-10-13-13-09-57-00
└─sdg2 416K ACBB-956A
As you can see, the USB is still unmounted but a new sdg2 partition has appeared from nowhere!
4. I tried to delete sdg2 thinking this might be why it's not installing - but it won't delete and I get an error message:
Code:
The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes.
5. The output of fdisk -l is:
Code:
Disk /dev/sdg: 29.8 GiB, 32017047552 bytes, 62533296 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
At this point, I can't see where the problem is so I can deal with it.
If I understand the question is that you are trying to install the operating system on the same media that contains the installer?
Yes. I just realized that's what I'm doing.
Thank you for pointing that out.
It's probably not a good idea, is it?
Ok, is it better to use a second USB with debian Live so I can use the debian-installer?
Or alternatively, can I write the netinstall image to USB using the dd command, then compress that USB partition with gparted (e.g sdg1), create a new target partition on USB (e.g. sdg2), and then install onto the target partition?
the other option seems very complex to me, but should theoretically still be possible.
Not only is it complex but it is also impossible.
When trying to add a new target partition onto the usb, gparted gave an error message.
It says the device can only have one primary partition.
So it knows the device is a usb and not a hdd.
However, I don't know how gparted will respond to an external hdd with a usb interface.
It is possible to install from an iso on a flash drive to another partition on that same flash drive. I very much doubt it would work if you used dd to put the iso on the flash. I read about the "toram" option which can do this. First install Grub to the MBR of the flash pointing to an already created boot directory on that drive's first partition (doesn't have to be the first). Copy the iso file to that partition and manually create a grub.cfg file with a proper menuentry. You need the toram option on the linux line in the grub.cfg menuentry. Create a second partition using the rest of the drive.
I just did this out of curiosity and it did work although the install took over 3 hours, no idea why. I definitely would put this down as about the last option to use.
This wasn't with Debian and I've never done a netinstall so I'm not sure if that would pose a problem.
I have done many installs onto USB media with no issues, but always onto a different drive than what the installer itself is on.
Yes, that makes a lot of sense now.
Quote:
No adjustments to GRUB are needed. Debian switched to using UUIDs rather than device name ages ago.
During the OS install, I loaded grub onto the mbr of the usb.
However, afterwards an existing usb with an OS has suddenly disappeared. It's not showing up as an option on the grub boot menu.
I've used 'update-grub' and it's picking up the existing OS but it's still not given as a boot option on the grub menu.
If I chroot into the existing OS and run 'update-grub', will that resolve the problem?
It is possible to install from an iso on a flash drive to another partition on that same flash drive. I very much doubt it would work if you used dd to put the iso on the flash. I read about the "toram" option which can do this. First install Grub to the MBR of the flash pointing to an already created boot directory on that drive's first partition (doesn't have to be the first). Copy the iso file to that partition and manually create a grub.cfg file with a proper menuentry. You need the toram option on the linux line in the grub.cfg menuentry. Create a second partition using the rest of the drive.
I remember someone posting that debian make 'hybrid' .iso images so they can be installed on usb or cd.
This could mean the .iso of the distro has to be specially made for removable media rather than a hdd.
Although I can't be sure.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.