[SOLVED] login to live cd as Root

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

[SOLVED] login to live cd as Root

Post by chowse »

The title says it all...how can I become Root for all things in the live cd?

Many thanks,
Charles

[Edit] I suppose I should explain. I want to boot the live cd and open the Disks utility to make an image of the sda drive, but I am always presented with "You don't have permission to..."
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Some people make happiness wherever they go, others whenever they go.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: login to live cd as Root

Post by catweazel »

If you need to make an image for backup purposes, you're better off using clonezilla.

http://clonezilla.org/downloads/downloa ... nch=stable
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Mute Ant

Re: login to live cd as Root

Post by Mute Ant »

"can I become root for all things in the live cd" Yes. That's all I am going to say. It should be sufficient to just run Disks. A 'permissions' problem might be because the destination is mounted, for example. Being root won't help with that.

Imaging a drive doesn't need Disks...
sudo cp /dev/sr0 /dev/sr1
...does exactly what it says on the tin, copies drive /dev/sr0 into drive /dev/sr1. It doesn't care if one or both are mounted and the command will generate useless rubbish in the destination.
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

Re: login to live cd as Root

Post by chowse »

catweazel wrote:If you need to make an image for backup purposes, you're better off using clonezilla.

http://clonezilla.org/downloads/downloa ... nch=stable
Thanks for the reply! I have a Parted Magic boot disc, and have made drive images with Clonezilla. Haven't had the courage to Secure Erase my SSD and restore an image to test it.
Some people make happiness wherever they go, others whenever they go.
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

Re: login to live cd as Root

Post by chowse »

Mute Ant wrote:"can I become root for all things in the live cd" Yes. That's all I am going to say. It should be sufficient to just run Disks. A 'permissions' problem might be because the destination is mounted, for example. Being root won't help with that.

Imaging a drive doesn't need Disks...
sudo cp /dev/sr0 /dev/sr1
...does exactly what it says on the tin, copies drive /dev/sr0 into drive /dev/sr1. It doesn't care if one or both are mounted and the command will generate useless rubbish in the destination.
Thanks for the reply! Not exactly what I'm looking for. I would prefer to save an image to another disc, not overwrite the disc with the files from the source disc, if that makes sense. Then I can restore the latest image to the source if a disaster occurs.
With respect, what do you mean by "generate useless rubbish in the destination"?
Some people make happiness wherever they go, others whenever they go.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: login to live cd as Root

Post by catweazel »

chowse wrote: Thanks for the reply! I have a Parted Magic boot disc, and have made drive images with Clonezilla. Haven't had the courage to Secure Erase my SSD and restore an image to test it.
There's no need to secure erase an SSD before restoring an image, and clonezilla has saved my neck more times than I can remember.

Cheers.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

Re: login to live cd as Root

Post by chowse »

catweazel wrote:
chowse wrote: Thanks for the reply! I have a Parted Magic boot disc, and have made drive images with Clonezilla. Haven't had the courage to Secure Erase my SSD and restore an image to test it.
There's no need to secure erase an SSD before restoring an image, and clonezilla has saved my neck more times than I can remember.

Cheers.
Wow, I didn't realize that. The weekend's coming up, I'll try to restore yesterday's CZ image and report back. Thanks for sticking with me.
BTW, where are you? I'm in West Tennessee. :D
Some people make happiness wherever they go, others whenever they go.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: login to live cd as Root

Post by catweazel »

chowse wrote:Thanks for sticking with me.
You're most welcome.
BTW, where are you? I'm in West Tennessee. :D
The land of Oz :)
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Mute Ant

Re: login to live cd as Root

Post by Mute Ant »

"...if that makes sense..." Oh yes. Just replace the destination with a file name on the backup drive...
sudo cp /dev/sda1 /media/mute/toshipod2/2017-12-08-sda1-ext4.img

That might be the problem you started with, if you told Disks to write to a mounted partition instead of to a file in the mounted partition.

"generate useless rubbish" If a file system is mounted and writeable, you should only access it file-by-file using the mount point. What's stored on the drive is a work-in-progress until the file system is unmounted again.
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

Re: login to live cd as Root

Post by chowse »

Mute Ant wrote:"...if that makes sense..." Oh yes. Just replace the destination with a file name on the backup drive...
sudo cp /dev/sda1 /media/mute/toshipod2/2017-12-08-sda1-ext4.img

That might be the problem you started with, if you told Disks to write to a mounted partition instead of to a file in the mounted partition.

"generate useless rubbish" If a file system is mounted and writeable, you should only access it file-by-file using the mount point. What's stored on the drive is a work-in-progress until the file system is unmounted again.
Alright, can I do the "sudo cp..." command while logged in as a member of the admin group with my regular user account?
Next, assuming my SSD crashes, how would I restore that img?
With respect to catweazel, do you agree there's no need to secure erase my SSD before restoring an image?
BTW, both of you have been a great source of information, thank you!! :D
Some people make happiness wherever they go, others whenever they go.
Mute Ant

Re: login to live cd as Root

Post by Mute Ant »

"Alright, can I do the "sudo cp..." command while logged in as a member of the admin group with my regular user account?" If your sda1 is mounted, part of your OS, no. In a pinch you can boot into Recovery Mode, where the file systems are read-only, but if you are going to reboot anyway, a Live Session is friendlier, with a graphic environment.

"how would I restore that img?" I'm sure you could have guessed this one...
sudo cp /media/mute/toshipod2/2017-12-08-sda1-ext4.img /dev/sda1

Secure-Erase only clears the SSD blocks, I don't think it would change the performance any more than writing useful data would.
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

Re: login to live cd as Root

Post by chowse »

Mute Ant wrote:--sigh-- You could have guessed this one...
sudo cp /media/mute/toshipod2/2017-12-08-sda1-ext4.img /dev/sda1
Yes, that much was obvious. Respectfully, I'm still wondering about doing all this as 'charles' or needing to boot to the live cd and do it from there.
Also, my long experience with SSD's tells me that you just can't treat them like spinny discs. I have a lot of experience in this sort of thing in Windows, and it was always necessary to erase the SSD before writing an image to it. Wondering if that's true in Mint.

If I'm boring or frustrating anyone, I sincerely apologize.
Some people make happiness wherever they go, others whenever they go.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: login to live cd as Root

Post by catweazel »

chowse wrote:I have a lot of experience in this sort of thing in Windows, and it was always necessary to erase the SSD before writing an image to it. Wondering if that's true in Mint.
It has never been necessary to secure erase an SSD in any operating system, including Windwoes. And, depending on how you do the erasure, you are likely drastically shortening the life of the SSD. The only way to correctly erase an SSD is to use the ATA secure erase command, and I am aware of only one program that does that on Windwoes, and not all SSDs support the ATA command set. Any other method of erasing the SSD will quickly ruin it. Simply restore your image, and when it's booted, use the fstrim command to erase unused blocks:

Code: Select all

fstrim /
To have the SSD trimmed regularly, do this in a terminal:

sudo nano /etc/cron.daily/fstrim

Add the following to the newly created file:

Code: Select all

#!/bin/sh
fstrim /
ctrl-o <enter> to save, then ctrl-x to exit, then:

sudo chmod +x /etc/cron.daily/fstrim

Once a day, your system will safely clear unused blocks. This will maintain your SSD's performance at its peak.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

Re: login to live cd as Root

Post by chowse »

catweazel wrote:
chowse wrote:I have a lot of experience in this sort of thing in Windows, and it was always necessary to erase the SSD before writing an image to it. Wondering if that's true in Mint.
It has never been necessary to secure erase an SSD in any operating system, including Windwoes. And, depending on how you do the erasure, you are likely drastically shortening the life of the SSD. The only way to correctly erase an SSD is to use the ATA secure erase command, and I am aware of only one program that does that on Windwoes, and not all SSDs support the ATA command set. Any other method of erasing the SSD will quickly ruin it. Simply restore your image, and when it's booted, use the fstrim command to erase unused blocks:

Code: Select all

fstrim /
To have the SSD trimmed regularly, do this in a terminal:

sudo nano /etc/cron.daily/fstrim

Add the following to the newly created file:

Code: Select all

#!/bin/sh
fstrim /
ctrl-o <enter> to save, then ctrl-x to exit, then:

sudo chmod +x /etc/cron.daily/fstrim

Once a day, your system will safely clear unused blocks. This will maintain your SSD's performance at its peak.
Thank you kindly! Merry Christmas!!
Some people make happiness wherever they go, others whenever they go.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: login to live cd as Root

Post by catweazel »

chowse wrote: Thank you kindly!
You're very welcome.
Merry Christmas!!
Funny you should say that. I'm celebrating Christmas this afternoon with my family because I'll be visiting Indonesia over Christmas and the new year :)

I'm off to see Mt Agung blow its top.

All the best of the season to you too.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Installation & Boot”