[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: parted is ALMOST suitable



On Mon 07 Nov 2016 at 13:47:27 (+0100), tomas@tuxteam.de wrote:
> On Mon, Nov 07, 2016 at 06:11:50AM -0600, Richard Owlett wrote:
> > I need to identify file system on all partitions of my hard drive
> > whether mounted or not.
> >     parted /dev/sda print | grep ext | grep -v exte
> > reports the desired information [partitions formatted ext?] in a
> > convenient format.
> > *HOWEVER* parted requires root privileges. That is not acceptable.
> > Suggestions?
> 
> It's not parted. It's the partitions themselves (or more accurately,
> the devices via which your operating system makes the partitions
> available to user space). By default (and there are some reasons
> for it) they're not readable by everyone. They are writable by
> even less. On my box, for example:
> 
>   tomas@rasputin:~$ ls -al /dev/sd*
>   brw-rw---- 1 root disk 8, 0 Nov  7 09:06 /dev/sda
>   brw-rw---- 1 root disk 8, 1 Nov  7 09:06 /dev/sda1
>   brw-rw---- 1 root disk 8, 2 Nov  7 09:06 /dev/sda2
>   brw-rw---- 1 root disk 8, 5 Nov  7 09:06 /dev/sda5
> 
> So you'd have to be associated to the "disk" group to read those
> things and you'd have to *be* root to write.

Are you sure? I read that as group disk having read *and* write access.

Obviously the OP seems unworried about read-access by himself or
anyone else, so world-readable on pretty much everything might
be appropriate.

Reading anything about a filesystem without going through the
normal access methods would appear to circumvent any file
protection scheme within it, so it's no surprise to me that
all the suggestions with lsblk etc have failed.

Cheers,
David.


Reply to: