Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #174275 > unrolled thread
| Started by | Richard Owlett <rowlett@cloud85.net> |
|---|---|
| First post | 2016-11-07 13:20 +0100 |
| Last post | 2016-11-07 15:00 +0100 |
| Articles | 20 on this page of 77 — 18 participants |
Back to article view | Back to linux.debian.user
parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-07 13:20 +0100
Re: parted is ALMOST suitable Felipe Salvador <felipe.salvador@gmail.com> - 2016-11-07 13:30 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-07 13:40 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-07 14:00 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-07 14:20 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-07 15:00 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-07 15:50 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-07 16:10 +0100
Re: parted is ALMOST suitable Lisi Reisz <lisi.reisz@gmail.com> - 2016-11-07 17:30 +0100
Re: parted is ALMOST suitable Felipe Salvador <felipe.salvador@gmail.com> - 2016-11-07 15:30 +0100
Re: parted is ALMOST suitable Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-11-07 16:20 +0100
Re: parted is ALMOST suitable Aldo Maggi <aldomaggi@katamail.com> - 2016-11-07 18:20 +0100
Re: parted is ALMOST suitable Felipe Salvador <felipe.salvador@gmail.com> - 2016-11-07 19:00 +0100
Re: parted is ALMOST suitable Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-11-08 19:10 +0100
Re: parted is ALMOST suitable Glenn English <ghe2001@gmail.com> - 2016-11-08 19:40 +0100
Re: parted is ALMOST suitable Stefan Monnier <monnier@iro.umontreal.ca> - 2016-11-08 21:10 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-08 21:50 +0100
Re: parted is ALMOST suitable Stefan Monnier <monnier@iro.umontreal.ca> - 2016-11-09 00:20 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-09 18:40 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-09 21:40 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-09 21:50 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-09 22:20 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-09 09:50 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-09 11:20 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-09 11:30 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-09 11:50 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-09 12:10 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-09 17:10 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-09 15:20 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-09 20:50 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-09 21:40 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-09 21:10 +0100
Re: parted is ALMOST suitable Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-11-10 01:20 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-10 10:10 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-09 19:30 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-09 21:40 +0100
Re: parted is ALMOST suitable Stefan Monnier <monnier@iro.umontreal.ca> - 2016-11-08 22:10 +0100
Re: parted is ALMOST suitable Lisi Reisz <lisi.reisz@gmail.com> - 2016-11-09 16:00 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-09 09:40 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-07 16:30 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-07 17:10 +0100
Re: parted is ALMOST suitable Felipe Salvador <felipe.salvador@gmail.com> - 2016-11-07 18:50 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-07 20:20 +0100
Re: parted is ALMOST suitable Lisi Reisz <lisi.reisz@gmail.com> - 2016-11-08 00:50 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-08 01:40 +0100
Re: parted is ALMOST suitable Michael Lange <klappnase@freenet.de> - 2016-11-08 03:50 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-08 12:00 +0100
Correction - Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-08 12:20 +0100
Re: Correction - Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-08 20:30 +0100
Re: parted is ALMOST suitable David Wright <deblis@lionunicorn.co.uk> - 2016-11-08 13:50 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-08 20:10 +0100
Re: parted is ALMOST suitable Frank <zuiderduin@gmx.com> - 2016-11-07 13:30 +0100
Re: parted is ALMOST suitable Darac Marjal <mailinglist@darac.org.uk> - 2016-11-07 13:40 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-07 13:50 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-07 14:30 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-07 15:10 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-07 15:20 +0100
Re: parted is ALMOST suitable Greg Wooledge <wooledg@eeg.ccf.org> - 2016-11-07 15:30 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-07 15:40 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-07 17:00 +0100
Re: parted is ALMOST suitable Greg Wooledge <wooledg@eeg.ccf.org> - 2016-11-07 17:10 +0100
Re: parted is ALMOST suitable Nicolas George <george@nsup.org> - 2016-11-07 17:20 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-07 15:30 +0100
Re: parted is ALMOST suitable Greg Wooledge <wooledg@eeg.ccf.org> - 2016-11-07 15:40 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-07 16:10 +0100
Re: parted is ALMOST suitable Reco <recoverym4n@gmail.com> - 2016-11-07 18:00 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-08 10:20 +0100
Re: parted is ALMOST suitable Pascal Hambourg <pascal@plouf.fr.eu.org> - 2016-11-07 21:10 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-08 01:00 +0100
Re: parted is ALMOST suitable Richard Owlett <rowlett@cloud85.net> - 2016-11-08 12:20 +0100
Re: parted is ALMOST suitable Pascal Hambourg <pascal@plouf.fr.eu.org> - 2016-11-11 15:40 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-11 17:30 +0100
Re: parted is ALMOST suitable Pascal Hambourg <pascal@plouf.fr.eu.org> - 2016-11-11 18:10 +0100
Re: parted is ALMOST suitable Brian <ad44@cityscape.co.uk> - 2016-11-11 18:40 +0100
Re: parted is ALMOST suitable David Wright <deblis@lionunicorn.co.uk> - 2016-11-07 15:10 +0100
Re: parted is ALMOST suitable <tomas@tuxteam.de> - 2016-11-07 15:10 +0100
Re: parted is ALMOST suitable rhkramer@gmail.com - 2016-11-07 15:00 +0100
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2016-11-07 17:10 +0100 |
| Message-ID | <sAUEF-5ny-21@gated-at.bofh.it> |
| In reply to | #174310 |
On Mon 07 Nov 2016 at 09:27:47 -0600, Richard Owlett wrote:
> On 11/7/2016 8:19 AM, Felipe Salvador wrote:
> >
> >I don't see this behaviour
> >
> >~$ lsblk -fr
> >NAME FSTYPE LABEL UUID MOUNTPOINT
> >sda
> >sda1 ext2 ... /boot
> >sda2 ext4 ... /
> >sda3 ext2 ... /tmp
> >etc etc etc
> >
> >or
> >
> >file -s /dev/sda{1..5} | awk '{print $5}'
>
> richard@full-jessier:~$ lsblk -fr
> NAME FSTYPE LABEL UUID MOUNTPOINT
> sda
> sda1
> sda2
> sda5
> sda6
> sda7
> sda8 [SWAP]
> sda9 /
> sda10
> sda11
> sda12
> sdb
> sdb1
> sr0
I get the same as you on Debian 8.6. On unstable the command 'lsblk -f'
shows all the fields populated. I wonder what Felipe Salvador is using?
At the least there is a little mystery. At the most it could be you have
run across buggy behaviour.
It appears to me that permissions, security, root privileges etc, etc
have nothing to do with it. None of the information is security
sensitive or requires root access and is available from elsewhere. For
example:
udevadm info --query=property --name=/dev/sda1 | grep ID_FS_TYPE
This command is probably more useful than lsblk for use in scripts.
--
Brian.
[toc] | [prev] | [next] | [standalone]
| From | Felipe Salvador <felipe.salvador@gmail.com> |
|---|---|
| Date | 2016-11-07 18:50 +0100 |
| Message-ID | <sAWdr-6oY-5@gated-at.bofh.it> |
| In reply to | #174312 |
On Mon, Nov 07, 2016 at 04:09:24PM +0000, Brian wrote:
> On Mon 07 Nov 2016 at 09:27:47 -0600, Richard Owlett wrote:
>
> > On 11/7/2016 8:19 AM, Felipe Salvador wrote:
> > >
> > >I don't see this behaviour
> > >
> > >~$ lsblk -fr
> > >NAME FSTYPE LABEL UUID MOUNTPOINT
> > >sda
> > >sda1 ext2 ... /boot
> > >sda2 ext4 ... /
> > >sda3 ext2 ... /tmp
> > >etc etc etc
> > >
> > >or
> > >
> > >file -s /dev/sda{1..5} | awk '{print $5}'
> >
> > richard@full-jessier:~$ lsblk -fr
> > NAME FSTYPE LABEL UUID MOUNTPOINT
> > sda
> > sda1
> > sda2
> > sda5
> > sda6
> > sda7
> > sda8 [SWAP]
> > sda9 /
> > sda10
> > sda11
> > sda12
> > sdb
> > sdb1
> > sr0
>
> I get the same as you on Debian 8.6. On unstable the command 'lsblk -f'
> shows all the fields populated. I wonder what Felipe Salvador is using?
~$ apt-show-versions util-linux
util-linux:amd64/testing 2.28.2-1 uptodate
~$ cat /etc/debian_version
stretch/sid
--
Felipe Salvador
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2016-11-07 20:20 +0100 |
| Message-ID | <sAXCy-7rh-43@gated-at.bofh.it> |
| In reply to | #174320 |
On Mon 07 Nov 2016 at 18:42:37 +0100, Felipe Salvador wrote: > On Mon, Nov 07, 2016 at 04:09:24PM +0000, Brian wrote: > > > > I get the same as you on Debian 8.6. On unstable the command 'lsblk -f' > > shows all the fields populated. I wonder what Felipe Salvador is using? > > ~$ apt-show-versions util-linux > util-linux:amd64/testing 2.28.2-1 uptodate > > ~$ cat /etc/debian_version > stretch/sid This is my situation too. 'lsblk -f' works. If not working on Jessie is thought to be a bug it is hardly worth reporting to the BTS except as a wishlist bug. It is unlikely to be fixed for Jessie. Richard Owlett and others are fortunately left with two methods to identify a file system on a mounted or unmounted partition as a user. Certain operations on a Linux system may require root privileges; getting this information is not one of them. In fact, the information is also available in /run/udev and /run/blkid; so there is another two sources. -- Brian.
[toc] | [prev] | [next] | [standalone]
| From | Lisi Reisz <lisi.reisz@gmail.com> |
|---|---|
| Date | 2016-11-08 00:50 +0100 |
| Message-ID | <sB1PP-1Bj-7@gated-at.bofh.it> |
| In reply to | #174324 |
On Monday 07 November 2016 19:15:50 Brian wrote: > On Mon 07 Nov 2016 at 18:42:37 +0100, Felipe Salvador wrote: > > On Mon, Nov 07, 2016 at 04:09:24PM +0000, Brian wrote: > > > I get the same as you on Debian 8.6. On unstable the command 'lsblk -f' > > > shows all the fields populated. I wonder what Felipe Salvador is using? > > > > ~$ apt-show-versions util-linux > > util-linux:amd64/testing 2.28.2-1 uptodate > > > > ~$ cat /etc/debian_version > > stretch/sid > > This is my situation too. 'lsblk -f' works. If not working on Jessie is > thought to be a bug it is hardly worth reporting to the BTS except as a > wishlist bug. It is unlikely to be fixed for Jessie. > > Richard Owlett and others are fortunately left with two methods to > identify a file system on a mounted or unmounted partition as a user. > Certain operations on a Linux system may require root privileges; > getting this information is not one of them. In fact, the information > is also available in /run/udev and /run/blkid; so there is another two > sources. Speaking as a Jessie user, changing to root and using lsblk -f is quicker and easier! It is a remarkably useful command that I had not come across before. (The -f). Thanks to those in this thread who have introduced it. I must explore lsblk more fully. Lisi
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2016-11-08 01:40 +0100 |
| Message-ID | <sB2Cd-29A-13@gated-at.bofh.it> |
| In reply to | #174329 |
On Mon 07 Nov 2016 at 23:48:53 +0000, Lisi Reisz wrote: > On Monday 07 November 2016 19:15:50 Brian wrote: > > On Mon 07 Nov 2016 at 18:42:37 +0100, Felipe Salvador wrote: > > > On Mon, Nov 07, 2016 at 04:09:24PM +0000, Brian wrote: > > > > I get the same as you on Debian 8.6. On unstable the command 'lsblk -f' > > > > shows all the fields populated. I wonder what Felipe Salvador is using? > > > > > > ~$ apt-show-versions util-linux > > > util-linux:amd64/testing 2.28.2-1 uptodate > > > > > > ~$ cat /etc/debian_version > > > stretch/sid > > > > This is my situation too. 'lsblk -f' works. If not working on Jessie is > > thought to be a bug it is hardly worth reporting to the BTS except as a > > wishlist bug. It is unlikely to be fixed for Jessie. > > > > Richard Owlett and others are fortunately left with two methods to > > identify a file system on a mounted or unmounted partition as a user. > > Certain operations on a Linux system may require root privileges; > > getting this information is not one of them. In fact, the information > > is also available in /run/udev and /run/blkid; so there is another two > > sources. > > Speaking as a Jessie user, changing to root and using lsblk -f is quicker and > easier! > > It is a remarkably useful command that I had not come across before. > (The -f). Thanks to those in this thread who have introduced it. I must > explore lsblk more fully. Yes, it is a useful command and a shame that FSTYPE, UUID, and LABEL are the only fields which need root to be displayed. It's likely #776905, which is fixed on testing/unstable. -- Brian.
[toc] | [prev] | [next] | [standalone]
| From | Michael Lange <klappnase@freenet.de> |
|---|---|
| Date | 2016-11-08 03:50 +0100 |
| Message-ID | <sB4E1-3lS-1@gated-at.bofh.it> |
| In reply to | #174329 |
On Mon, 7 Nov 2016 23:48:53 +0000 Lisi Reisz <lisi.reisz@gmail.com> wrote: > > Speaking as a Jessie user, changing to root and using lsblk -f is > quicker and easier! Sure, but the OP said that's not an option. I think that the command Brian suggested: udevadm info --query=property --name=/dev/sda1 | grep ID_FS_TYPE used with every partition that is returned by cat /proc/partitions might be a good option for the OP. Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Uncontrolled power will turn even saints into savages. And we can all be counted on to live down to our lowest impulses. -- Parmen, "Plato's Stepchildren", stardate 5784.3
[toc] | [prev] | [next] | [standalone]
| From | Richard Owlett <rowlett@cloud85.net> |
|---|---|
| Date | 2016-11-08 12:00 +0100 |
| Message-ID | <sBcid-8hA-7@gated-at.bofh.it> |
| In reply to | #174333 |
On 11/7/2016 8:36 PM, Michael Lange wrote: > On Mon, 7 Nov 2016 23:48:53 +0000 > Lisi Reisz <lisi.reisz@gmail.com> wrote: > > >> >> Speaking as a Jessie user, changing to root and using lsblk -f is >> quicker and easier! > > Sure, but the OP said that's not an option. > I think that the command Brian suggested: > > udevadm info --query=property --name=/dev/sda1 | grep ID_FS_TYPE > > used with every partition that is returned by > > cat /proc/partitions > > might be a good option for the OP. > > Regards > > Michael > Actually I now have two options, "udevadm info" and "/sbin/blkid". >From Brian's comment on bug #776905, in future releases "blkid" may be an option.
[toc] | [prev] | [next] | [standalone]
| From | Richard Owlett <rowlett@cloud85.net> |
|---|---|
| Date | 2016-11-08 12:20 +0100 |
| Subject | Correction - Re: parted is ALMOST suitable |
| Message-ID | <sBcBA-bB-11@gated-at.bofh.it> |
| In reply to | #174338 |
On 11/8/2016 4:58 AM, Richard Owlett wrote: > [snip] > > Actually I now have two options, "udevadm info" and "/sbin/blkid". >> From Brian's comment on bug #776905, in future releases "blkid" > may be an option. I'll have to modify that. Brian has stated in another sub-thread: > ... When blkid is run as root it creates the file > /run/blkid/blkid.tab. A user running blkid only gets to see the contents > of blkid.tab. There is no change to blkid.tab unless the command is run > by root again. This makes /sbin/blkid useless as a user command for the > purposes discussed in this thread.
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2016-11-08 20:30 +0100 |
| Subject | Re: Correction - Re: parted is ALMOST suitable |
| Message-ID | <sBkfM-5aV-35@gated-at.bofh.it> |
| In reply to | #174340 |
On Tue 08 Nov 2016 at 05:19:15 -0600, Richard Owlett wrote: > On 11/8/2016 4:58 AM, Richard Owlett wrote: > >[snip] > > > >Actually I now have two options, "udevadm info" and "/sbin/blkid". > >>From Brian's comment on bug #776905, in future releases "blkid" > >may be an option. > > I'll have to modify that. Brian has stated in another sub-thread: > >... When blkid is run as root it creates the file > >/run/blkid/blkid.tab. A user running blkid only gets to see the contents > >of blkid.tab. There is no change to blkid.tab unless the command is run > >by root again. This makes /sbin/blkid useless as a user command for the > >purposes discussed in this thread. I probably gave the impression somewhere in this narrative that blkid as non-root was ok. It isn't; apologies. On Jessie you basically have only the single choice of udevadm. But it is still a win. :) -- Brian.
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2016-11-08 13:50 +0100 |
| Message-ID | <sBe0G-Zj-17@gated-at.bofh.it> |
| In reply to | #174338 |
On Tue 08 Nov 2016 at 04:58:05 (-0600), Richard Owlett wrote: > On 11/7/2016 8:36 PM, Michael Lange wrote: [...] > >I think that the command Brian suggested: > > > > udevadm info --query=property --name=/dev/sda1 | grep ID_FS_TYPE > > > >used with every partition that is returned by > > > > cat /proc/partitions > > > >might be a good option for the OP. > > Actually I now have two options, "udevadm info" and "/sbin/blkid". > >From Brian's comment on bug #776905, in future releases "blkid" > may be an option. You may find useful information in /run/udev/data/b8:0 etc without having to run any commands yourself. These files stay up to date as devices are plugged/unplugged. Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2016-11-08 20:10 +0100 |
| Message-ID | <sBjWq-53v-15@gated-at.bofh.it> |
| In reply to | #174344 |
On Tue 08 Nov 2016 at 06:40:26 -0600, David Wright wrote: > On Tue 08 Nov 2016 at 04:58:05 (-0600), Richard Owlett wrote: > > On 11/7/2016 8:36 PM, Michael Lange wrote: > [...] > > >I think that the command Brian suggested: > > > > > > udevadm info --query=property --name=/dev/sda1 | grep ID_FS_TYPE > > > > > >used with every partition that is returned by > > > > > > cat /proc/partitions > > > > > >might be a good option for the OP. > > > > Actually I now have two options, "udevadm info" and "/sbin/blkid". > > >From Brian's comment on bug #776905, in future releases "blkid" > > may be an option. > > You may find useful information in /run/udev/data/b8:0 etc > without having to run any commands yourself. These files stay > up to date as devices are plugged/unplugged. I thought so too, but went off the idea when trying to figure out which device was which and script it. udevadm (and lsblk) gets it information from /run/udev/data/ anyway. -- Brian.
[toc] | [prev] | [next] | [standalone]
| From | Frank <zuiderduin@gmx.com> |
|---|---|
| Date | 2016-11-07 13:30 +0100 |
| Message-ID | <sARdL-33z-29@gated-at.bofh.it> |
| In reply to | #174275 |
Op 07-11-16 om 13:11 schreef Richard Owlett: > 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? Have a look at lsblk. It has many possible output format settings (lsblk --help shows a list) and most of them are available without root privileges (a few aren't - don't remember which ones, though). Regards, Frank
[toc] | [prev] | [next] | [standalone]
| From | Darac Marjal <mailinglist@darac.org.uk> |
|---|---|
| Date | 2016-11-07 13:40 +0100 |
| Message-ID | <sARns-376-19@gated-at.bofh.it> |
| In reply to | #174275 |
[Multipart message — attachments visible in raw view] — view raw
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? parted probably wants root privileges because it is, by nature a PARTition EDitor. Try, instead, "lsblk" (in package util-linux), which will LiSt BLocK devices. I'm not immediately sure how to get it to show ONLY partitions, but the following seems to work: $ lsblk -l|awk 'NR==1||/part/' (or just "|grep part" if you don't care about seeing the header :) >TIA > > > -- For more information, please reread.
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2016-11-07 13:50 +0100 |
| Message-ID | <sARx8-3aL-43@gated-at.bofh.it> |
| In reply to | #174275 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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. Same goes for lsblk (as has been recommended in this thread) or any other tool you might consider. That said, lsblk seems to be a better fit for your needs anyway. Parted has no problems running as a regular user if the (device) file under question is (readable/writable) by said user. It only tries to be helpful with some messages when it isn't running under root *and* encounters permission/owner conflicts. *That* might cause some confusion. Regards - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEUEARECAAYFAlggd98ACgkQBcgs9XrR2kaDxgCY1ArE0224tHxE6XyHBtpNXNv2 zgCfex3jBX/eggibGeXPZNm+YR7WzP8= =MMiF -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | Richard Owlett <rowlett@cloud85.net> |
|---|---|
| Date | 2016-11-07 14:30 +0100 |
| Message-ID | <sAS9Q-3GK-29@gated-at.bofh.it> |
| In reply to | #174282 |
On 11/7/2016 6:47 AM, tomas@tuxteam.de wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > 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. *THAT* sentence may be key to solving multiple problems. All of my installs have implicitly accepted default groups for user(s). > > Same goes for lsblk (as has been recommended in this thread) or > any other tool you might consider. That said, lsblk seems to be > a better fit for your needs anyway. > > Parted has no problems running as a regular user if the (device) > file under question is (readable/writable) by said user. It only > tries to be helpful with some messages when it isn't running under > root *and* encounters permission/owner conflicts. *That* might > cause some confusion. > > Regards > - -- tomás > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.12 (GNU/Linux) > > iEUEARECAAYFAlggd98ACgkQBcgs9XrR2kaDxgCY1ArE0224tHxE6XyHBtpNXNv2 > zgCfex3jBX/eggibGeXPZNm+YR7WzP8= > =MMiF > -----END PGP SIGNATURE----- > >
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2016-11-07 15:10 +0100 |
| Message-ID | <sASMy-4aH-19@gated-at.bofh.it> |
| In reply to | #174289 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, Nov 07, 2016 at 07:25:33AM -0600, Richard Owlett wrote:
[...]
> >>*HOWEVER* parted requires root privileges. That is not acceptable.
> >>Suggestions?
[...]
> >So you'd have to be associated to the "disk" group to read those
> >things and you'd have to *be* root to write.
>
> *THAT* sentence may be key to solving multiple problems. All of my
> installs have implicitly accepted default groups for user(s).
sudo adduser myself disk
might do that.
regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlggiPoACgkQBcgs9XrR2kbTsgCfV9uzYMV/rMqZAISqyzDB+3Zw
OOEAnjhrRNsRRK94E9+5KZalYhA9p3cN
=iUIM
-----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | Richard Owlett <rowlett@cloud85.net> |
|---|---|
| Date | 2016-11-07 15:20 +0100 |
| Message-ID | <sASWd-4ht-13@gated-at.bofh.it> |
| In reply to | #174289 |
On 11/7/2016 7:25 AM, Richard Owlett wrote: > On 11/7/2016 6:47 AM, tomas@tuxteam.de wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> 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. > > *THAT* sentence may be key to solving multiple problems. All of > my installs have implicitly accepted default groups for user(s). Evidently not a solution. Added myself to both "disk" and "root" groups. Had no effect when attempting to run either lsblk or parted. Off-list it was suggested I try /sbin/blkid /dev/sda. Although the man page has a caution when not used as root, it seems to currently work on my immediately available Debian machine. > >> >> Same goes for lsblk (as has been recommended in this thread) or >> any other tool you might consider. That said, lsblk seems to be >> a better fit for your needs anyway. >> >> Parted has no problems running as a regular user if the (device) >> file under question is (readable/writable) by said user. It only >> tries to be helpful with some messages when it isn't running under >> root *and* encounters permission/owner conflicts. *That* might >> cause some confusion. >> >> Regards >> - -- tomás >> >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.12 (GNU/Linux) >> >> iEUEARECAAYFAlggd98ACgkQBcgs9XrR2kaDxgCY1ArE0224tHxE6XyHBtpNXNv2 >> zgCfex3jBX/eggibGeXPZNm+YR7WzP8= >> =MMiF >> -----END PGP SIGNATURE----- >> >> > > >
[toc] | [prev] | [next] | [standalone]
| From | Greg Wooledge <wooledg@eeg.ccf.org> |
|---|---|
| Date | 2016-11-07 15:30 +0100 |
| Message-ID | <sAT5T-4ky-5@gated-at.bofh.it> |
| In reply to | #174298 |
On Mon, Nov 07, 2016 at 08:18:28AM -0600, Richard Owlett wrote: > Evidently not a solution. Added myself to both "disk" and "root" > groups. > Had no effect when attempting to run either lsblk or parted. Is there a reason you can't use sudo? Sample output on my system at work: $ lsblk -f NAME FSTYPE LABEL UUID MOUNTPOINT sda |-sda1 |-sda2 / `-sda3 [SWAP] sr0 $ sudo lsblk -f [sudo] password for wooledg: NAME FSTYPE LABEL UUID MOUNTPOINT sda |-sda1 ntfs Windows FE0EDCF30EDCA5C5 |-sda2 ext4 1a20ffb7-897c-4373-84c1-14089a6deab8 / `-sda3 swap b8d67062-8262-476d-9370-8166f7572fd3 [SWAP] sr0 You can even configure sudo not to prompt you for a password. Certain operations on a Linux system simply require root privileges, and your insistence on "not having to be root" is not rational.
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2016-11-07 15:40 +0100 |
| Message-ID | <sATfA-4nB-9@gated-at.bofh.it> |
| In reply to | #174299 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, Nov 07, 2016 at 09:27:11AM -0500, Greg Wooledge wrote: > On Mon, Nov 07, 2016 at 08:18:28AM -0600, Richard Owlett wrote: > > Evidently not a solution. Added myself to both "disk" and "root" > > groups. > > Had no effect when attempting to run either lsblk or parted. > > Is there a reason you can't use sudo? This is of course another option. Security-wise it's better than adding oneself to the relevant group(s), unless... > You can even configure sudo not to prompt you for a password. (rationale: if a rogue application tries to get to the disk with your user ID, you'd notice). regards - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlggkH4ACgkQBcgs9XrR2kbcLQCfZ5um3dyGOwKFiMK0dDv77bqC 3UcAniQ02EBBjB06gRsf8g0AfHbHGWqy =pdTG -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | Richard Owlett <rowlett@cloud85.net> |
|---|---|
| Date | 2016-11-07 17:00 +0100 |
| Message-ID | <sAUuZ-52M-9@gated-at.bofh.it> |
| In reply to | #174299 |
On 11/7/2016 8:27 AM, Greg Wooledge wrote:
> On Mon, Nov 07, 2016 at 08:18:28AM -0600, Richard Owlett wrote:
>> Evidently not a solution. Added myself to both "disk" and "root"
>> groups.
>> Had no effect when attempting to run either lsblk or parted.
>
> Is there a reason you can't use sudo?
Not a matter of "need" but of "desire".
>
> Sample output on my system at work:
> [*SNIP*
> You can even configure sudo not to prompt you for a password.
> Certain operations on a Linux system simply require root privileges,
> and your insistence on "not having to be root" is not rational.
>
Over the last three score years rationality not questioned, but
Prof. A. "This young man can be persistent."
Prof. B. "Yes", looong pause "about what he wants to be."
I was a youngster of 50 at the time.
This group has drummed into me that root privileges are not to be
taken lightly.
My innate sense of "how things SHOULD work" shouts there should
be finer control.
In any case, off-list someone suggested using
/sbin/blkid /dev/sda*
That works. *BUT* I wonder about unknown implications of "/sbin"
being required if not explicitly running as root.
[toc] | [prev] | [next] | [standalone]
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
Back to top | Article view | linux.debian.user
csiph-web