0

I seem to have messed up /boot/cmdline.txt while trying to edit it to get GPS working under UART.

I now cannot access the Pi.

Is there a way to replace the file on the SD card without using the PI and without starting from scratch and rewriting the SD card

Thanks. Alan

3 Answers 3

1

Yes, there is a way to update cmdline.txt without starting again. The SD card has a partition with the name boot. I was able to plug the card into my laptop (a Mac, but the partition is FAT so it opens on Windows too) and edit cmdline.txt.

Below is what my working line looks like:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait
1

As long as you are not using NOOBS you should just be able to edit cmdline.txt on a Windows PC (it is on the partition visible to Windows).

The single line contents of mine is

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

2
  • Not sure NOOBS really matters. I installed using NOOBS and I can edit cmdline.txt just fine.
    – berto
    Commented Jul 16, 2015 at 20:43
  • @berto I don't use NOOBS so wasn't sure. I know you can't edit config.txt because the version visible to Windows is not the version used when the Pi is booted.
    – joan
    Commented Jul 16, 2015 at 20:46
1

Thanks to you all. I tried the NOOBS recovery by using shift and that allowed me to boot and edit. I will look for the boot partition on the SD card later.

For those who are as stupid as me the command line is just that - one line so you cannot split it up on to several lines which is what it looks like when it appears in an answer (see below)!!!

My pi is RPi2 so the correct original line is :

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.