[PLUG] Backup problems (urgent)
Robert Miesen
robert.miesen at gmail.com
Mon Aug 18 17:16:15 UTC 2014
If you need to be root and either (1) don't want to have a "true root"
account or (2) run a distro that doesn't have a "true root" account, you
can make yourself "99.9% root" by running the following command:
sudo -i
This will cause sudo to launch a new login shell with your account's
sudo privileges, which in the context of most personal installations of
GNU/Linux, will generally be root-like privileges. It's not the same as
being true-root, though, as there are some things that a "99.9% root"
shell can't do that a "true root" shell can do. I don't remember off the
top of my head what those are, but maybe someone else on this mailing
list will.
That being said, I agree with King's statement: there's no substitute
for being the real deal (root). I personally believe that Linux admins
can achieve many of the important benefits of having a "no root" policy
in-place by reconfiguring the ssh server to forbid root logins. This,
combined with a deployment of fail2ban will make brute force attacks on
servers much more difficult while still affording the system
administrator a "true root" account with all the pomp and circumstance
that comes with being the real thing.
On 08/17/2014 10:39 PM, King Beowulf wrote:
> On 08/17/2014 09:38 PM, John Jason Jordan wrote:
>> On Sun, 17 Aug 2014 21:02:47 -0700
>> I just tried it. The following commands executed without error (both
>> drives were already mounted, and the folders in /media had already been
>> created)
>>
>> sudo mount -o remount,rw /dev/sdb2 /media/Home2
>> sudo mount -o remount,rw /dev/sdc /media/Movies
>>
>> But when I try to copy anything from /media/Home2
>> to /media/Movies/Backup_8.17.14 it fails because it cannot create
>> folders in /media/Movies/Backup_8.17.14 ("permission denied").
>>
>> i believe the problem is ownership, but if I change the ownership of the
>> files in /dev/sdb2 it will be a disaster later.
>
> 1. [rant] You should be true root for this to properly work. Not
> "sudo" nonsense. A true root user can r/w anything to/from anywhere.
> Using sudo you are still in a user shell not a root shell. This can
> prevent you from accessing various files. IMHO, this is the greatest
> injustice that the *buntus and others have foisted onto the Linux
> public. [/rant]
>
> 2. Even though you can mount /dev/sdc, you really should not, even if
> Linux lets you (mount should kick an error; don't know why it didn't).
> That's the *drive* and you should only mount *partitions*. I sure as
> heck hope that was just a typo and you didn't format sdc without first
> making a partition.
>
> 3. "cp -a" is not an appropriate backup tool since its too slow and
> stupid. It was never meant to be used for large directory trees.
>
> Thus:
> A. Boot your live distro, gain root access.
> B. mount your source partition and destination partition somewhere
> without automount (or use remount):
>
> mount -o rw /dev/sdb2 /media/Home2
> mount -o rw /dev/sdc1 /media/Movies
>
> C.
> mkdir -p /media/Movies/Backup_8.17.14 (if it doesn't exist)
>
> rsync -av --progress /media/Home2 /media/Movies/Backup_8.17.14
> --exclude={"/media/home2/*/.local/share/Trash/*", "/media/home2/*/.cache/*"}
>
> You may want to add other excludes for any additional junk. This will
> create a proper archive backup. rsync is also *way* faster than cp...
>
> -Ed
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
More information about the PLUG
mailing list